Add tearfree configs for both amd and intel gpus

This commit is contained in:
natemaia 2019-10-17 20:57:47 -07:00
parent 2e730506e0
commit 7a69886935

View File

@ -224,23 +224,20 @@ select_boot()
select_show() select_show()
{ {
local pkgs="${USER_PKGS// / } ${PACKAGES// / }" local pkgs="${USER_PKGS// / } ${PACKAGES// / }"
[[ $BOOT_PART ]] && local mnt="/$BOOTDIR"
[[ $INSTALL_WMS == *dwm* ]] && pkgs="dwm st dmenu $pkgs" [[ $INSTALL_WMS == *dwm* ]] && pkgs="dwm st dmenu $pkgs"
pkgs="${pkgs// / }" pkgs="${pkgs# }" pkgs="${pkgs// / }" pkgs="${pkgs# }"
msg "Show Configuration" " msg "Show Configuration" "
---------- PARTITION CONFIGURATION ------------ ---------- PARTITION CONFIGURATION ------------
Root: ${ROOT_PART:-none} Root Part: $ROOT_PART
Boot: ${BOOT_PART:-${BOOT_DEV:-none}} Boot Part: ${BOOT_PART:-${BOOT_DEV:-none}}
Mount: ${mnt:-none} Swap Part/File: ${SWAP_PART:-none}
Swap: ${SWAP_PART:-none} Swap Size: ${SWAP_SIZE:-none}
Size: ${SWAP_SIZE:-none} Extra Mounts: ${EXMNTS:-${EXMNT:-none}}
Extra: ${EXMNTS:-${EXMNT:-none}} Mkinit Hooks: ${HOOKS:-none}
Hooks: ${HOOKS:-none}
LVM: ${LVM:-none}
LUKS: ${LUKS:-none}
LVM used: ${LVM:-none}
LUKS used: ${LUKS:-none}
------------ SYSTEM CONFIGURATION ------------- ------------ SYSTEM CONFIGURATION -------------
@ -249,7 +246,6 @@ select_show()
Hostname: ${MYHOST:-none} Hostname: ${MYHOST:-none}
Timezone: ${ZONE:-none}/${SUBZ:-none} Timezone: ${ZONE:-none}/${SUBZ:-none}
------------ USER CONFIGURATION --------------- ------------ USER CONFIGURATION ---------------
Username: ${NEWUSER:-none} Username: ${NEWUSER:-none}
@ -258,7 +254,6 @@ select_show()
Autologin: ${AUTOLOGIN:-none} Autologin: ${AUTOLOGIN:-none}
Login Type: ${LOGIN_TYPE:-none} Login Type: ${LOGIN_TYPE:-none}
----------- PACKAGE CONFIGURATION ------------- ----------- PACKAGE CONFIGURATION -------------
Kernel: ${KERNEL:-none} Kernel: ${KERNEL:-none}
@ -810,7 +805,7 @@ part_format()
mkfs.$fs ${FS_CMD_FLAGS[$fs]} "$part" >/dev/null 2>$ERR mkfs.$fs ${FS_CMD_FLAGS[$fs]} "$part" >/dev/null 2>$ERR
errshow "mkfs.$fs ${FS_CMD_FLAGS[$fs]} "$part"" || return 1 errshow "mkfs.$fs ${FS_CMD_FLAGS[$fs]} "$part"" || return 1
FORMATTED+="$part " FORMATTED+="$part "
sleep "${delay:-0}" sleep $delay
} }
part_device() part_device()
@ -1029,7 +1024,7 @@ select_filesystem()
[[ $fs == 'skip' ]] && return 0 [[ $fs == 'skip' ]] && return 0
yesno "Filesystem" "\nFormat $part as $fs?\n" || fs='' yesno "Filesystem" "\nFormat $part as $fs?\n" || fs=''
done done
part_format "$part" "$fs" part_format "$part" "$fs" 0
} }
select_efi_partition() select_efi_partition()
@ -1240,7 +1235,7 @@ install_base()
if [[ $VM ]]; then if [[ $VM ]]; then
find $MNT/etc/X11/xorg.conf.d/ -name '*.conf' -delete find $MNT/etc/X11/xorg.conf.d/ -name '*.conf' -delete
elif lspci | grep ' VGA ' | grep -q 'Intel'; then elif lspci | grep ' VGA ' | grep -q 'Intel'; then
echo "Creating Intel VGA Tear Free config /etc/X11/xorg.conf.d/20-intel.conf" echo "Creating Intel Tear Free config /etc/X11/xorg.conf.d/20-intel.conf"
cat > $MNT/etc/X11/xorg.conf.d/20-intel.conf <<- EOF cat > $MNT/etc/X11/xorg.conf.d/20-intel.conf <<- EOF
Section "Device" Section "Device"
Identifier "Intel Graphics" Identifier "Intel Graphics"
@ -1248,6 +1243,24 @@ install_base()
Option "TearFree" "true" Option "TearFree" "true"
EndSection EndSection
EOF EOF
elif lspci | grep ' VGA ' | grep -q 'AMD/ATI.*RX'; then # newer RX cards can use the amdgpu driver
echo "Creating AMD Tear Free config /etc/X11/xorg.conf.d/20-amdgpu.conf"
cat > $MNT/etc/X11/xorg.conf.d/20-amdgpu.conf <<- EOF
Section "Device"
Identifier "AMD Graphics"
Driver "amdgpu"
Option "TearFree" "true"
EndSection
EOF
elif lspci | grep ' VGA ' | grep -q 'AMD/ATI.*HD [2-6][0-9]*'; then # older HD 2xxx-6xxx cards must use the radeon driver
echo "Creating Radeon Tear Free config /etc/X11/xorg.conf.d/20-radeon.conf"
cat > $MNT/etc/X11/xorg.conf.d/20-radeon.conf <<- EOF
Section "Device"
Identifier "AMD Graphics"
Driver "radeon"
Option "TearFree" "on"
EndSection
EOF
fi fi
[[ -e /run/archiso/sfs/airootfs ]] && cp -vf $RUN/x86_64/vmlinuz $MNT/boot/vmlinuz-linux [[ -e /run/archiso/sfs/airootfs ]] && cp -vf $RUN/x86_64/vmlinuz $MNT/boot/vmlinuz-linux