Commit a7ef1821 authored by Philip Müller's avatar Philip Müller

[graphic drivers] add nvidia-390xx

parent df1738cb
......@@ -2,7 +2,7 @@
NAME="video-hybrid-intel-nvidia-340xx-bumblebee"
INFO="Hybrid bumblebee solution for NVIDIA Optimus Technology - Closed source NVIDIA legacy driver & open source intel driver."
VERSION="2018.02.23"
VERSION="2018.05.04"
FREEDRIVER="false"
PRIORITY="7"
......@@ -18,7 +18,7 @@ DEVICEIDS="*"
BLACKLISTEDDEVICEIDS="0be1 8108"
# Conflicts with other mhwd configs
MHWDCONFLICTS="video-intel video-nvidia video-nvidia-304xx video-nvidia-340xx video-hybrid-intel-nvidia-bumblebee video-hybrid-intel-nouveau-bumblebee"
MHWDCONFLICTS="video-intel video-nvidia video-nvidia-304xx video-nvidia-340xx video-nvidia-390xx video-hybrid-intel-nvidia-bumblebee video-hybrid-intel-nvidia-304xx-bumblebee video-hybrid-intel-nvidia-390xx-bumblebee video-hybrid-intel-nouveau-bumblebee"
# Dependencies
DEPENDS="bumblebee nvidia-340xx-utils xf86-video-intel"
......
# mhwd Driver Config
NAME="video-hybrid-intel-nvidia-390xx-bumblebee"
INFO="Hybrid bumblebee solution for NVIDIA Optimus Technology - Closed source NVIDIA driver & open source intel driver."
VERSION="2018.05.04"
FREEDRIVER="false"
PRIORITY="8"
# NVIDIA cards
CLASSIDS="0300 0302"
VENDORIDS="10de"
DEVICEIDS=">/var/lib/mhwd/ids/pci/nvidia-390xx.ids"
# Intel cards
CLASSIDS="0300"
VENDORIDS="8086"
DEVICEIDS="*"
BLACKLISTEDDEVICEIDS="0be1 8108"
# Conflicts with other mhwd configs
MHWDCONFLICTS="video-intel video-nvidia video-nvidia-304xx video-nvidia-340xx video-nvidia-390xx video-hybrid-intel-nvidia-bumblebee video-hybrid-intel-nouveau-bumblebee"
# Dependencies
DEPENDS="bumblebee nvidia-390xx-utils xf86-video-intel"
[[ -d /run/openrc ]] && DEPENDS="bumblebee-openrc nvidia-390xx-utils xf86-video-intel"
DEPENDS_64="lib32-primus lib32-nvidia-390xx-utils"
DEPKMOD="nvidia-390xx bbswitch"
XORGFILE="/etc/X11/mhwd.d/intel.conf"
BXORGFILE="/etc/bumblebee/xorg.conf.nvidia"
MODULESFILE="/etc/modprobe.d/mhwd-bbswitch.conf"
MODULESBLACKLIST="/etc/modprobe.d/mhwd-nvidia.conf"
make_bumblebee_xorg_config()
{
MHWD_HEADING "${BXORGFILE}"
echo 'Section "ServerLayout"' >> "${BXORGFILE}"
echo ' Identifier "Layout0"' >> "${BXORGFILE}"
echo ' Option "AutoAddDevices" "false"' >> "${BXORGFILE}"
echo 'EndSection' >> "${BXORGFILE}"
echo '' >> "${BXORGFILE}"
MHWD_ADD_DEVICE_SECTION_FOR_EACH_BUSID "nvidia" "${BXORGFILE}" 10de "VendorName \"NVIDIA Corporation\"|Option \"NoLogo\" \"true\"|Option \"UseEDID\" \"false\"|Option \"ConnectedMonitor\" \"DFP\""
}
post_install()
{
# Create intel xorg configuration with enabled sna acceleration method
MHWD_HEADING "${XORGFILE}"
MHWD_ADD_DEVICE_SECTION_FOR_EACH_BUSID "intel" "${XORGFILE}" 8086 "Option \"AccelMethod\" \"sna\""
MHWD_ADD_DRI "${XORGFILE}"
MHWD_ADD_COMPOSITING "${XORGFILE}"
MHWD_ADD_BACKSPACE "${XORGFILE}"
# Create nvidia bumblebee xorg configuration
make_bumblebee_xorg_config
MHWD_HEADING "${MODULESFILE}"
echo "options bbswitch load_state=0 unload_state=0" >> "${MODULESFILE}"
MHWD_HEADING "${MODULESBLACKLIST}"
echo "blacklist nouveau" >> "${MODULESBLACKLIST}"
echo "blacklist nvidia" >> "${MODULESBLACKLIST}"
echo "blacklist nvidia-modeset" >> "${MODULESBLACKLIST}"
echo "blacklist nvidia-uvm" >> "${MODULESBLACKLIST}"
echo "blacklist ttm" >> "${MODULESBLACKLIST}"
echo "blacklist drm_kms_helper" >> "${MODULESBLACKLIST}"
echo "blacklist drm" >> "${MODULESBLACKLIST}"
# Unload modules if X is not running
if [ ! "$(pgrep X)" ]; then
rmmod -f nouveau
rmmod -f nvidia
rmmod -f nvidia-modeset
rmmod -f nvidia-uvm
rmmod -f ttm
rmmod -f drm_kms_helper
rmmod -f drm
fi
modprobe bbswitch
set_bumblebee_driver "nvidia"
mhwd-gpu --setxorg "${XORGFILE}"
if [[ -d /run/openrc ]];then
rc-update add bumblebee default
rc-service bumblebee start
else
systemctl enable bumblebeed.service
systemctl start bumblebeed.service
fi
}
pre_remove()
{
modprobe -r bbswitch
if [[ -d /run/openrc ]];then
rc-update del bumblebee default
rc-service bumblebee stop
else
systemctl disable bumblebeed.service
systemctl stop bumblebeed.service
fi
}
post_remove()
{
if [ -e "${XORGFILE}" ]; then
rm "${XORGFILE}"
fi
if [ -e "${MODULESFILE}" ]; then
rm "${MODULESFILE}"
fi
if [ -e "${MODULESBLACKLIST}" ]; then
rm "${MODULESBLACKLIST}"
fi
mhwd-gpu --check
}
set_bumblebee_driver()
{
sed -i "/(#)/!s/^[ ]*Driver[ ]*=.*/Driver=$1/g" /etc/bumblebee/bumblebee.conf
}
......@@ -2,9 +2,9 @@
NAME="video-hybrid-intel-nvidia-bumblebee"
INFO="Hybrid bumblebee solution for NVIDIA Optimus Technology - Closed source NVIDIA driver & open source intel driver."
VERSION="2018.02.23"
VERSION="2018.05.04"
FREEDRIVER="false"
PRIORITY="8"
PRIORITY="9"
# NVIDIA cards
CLASSIDS="0300 0302"
......@@ -18,7 +18,7 @@ DEVICEIDS="*"
BLACKLISTEDDEVICEIDS="0be1 8108"
# Conflicts with other mhwd configs
MHWDCONFLICTS="video-intel video-nvidia video-nvidia-304xx video-nvidia-340xx video-hybrid-intel-nvidia-340xx-bumblebee video-hybrid-intel-nouveau-bumblebee"
MHWDCONFLICTS="video-intel video-nvidia video-nvidia-304xx video-nvidia-340xx video-nvidia-390xx video-hybrid-intel-nvidia-390xx-bumblebee video-hybrid-intel-nouveau-bumblebee"
# Dependencies
DEPENDS="bumblebee nvidia-utils xf86-video-intel"
......
......@@ -2,7 +2,7 @@
NAME="video-nvidia-304xx"
INFO="Closed source NVIDIA legacy drivers for linux."
VERSION="2018.02.23"
VERSION="2018.05.04"
FREEDRIVER="false"
PRIORITY="3"
......@@ -16,7 +16,7 @@ CONFLICTS_64="lib32-nvidia-utils lib32-nvidia-340xx-utils"
CONKMOD="nvidia nvidia-340xx"
# Conflicts with other mhwd configs
MHWDCONFLICTS="video-hybrid-intel-nvidia-bumblebee video-nvidia video-nvidia-340xx video-hybrid-intel-nvidia-340xx-bumblebee"
MHWDCONFLICTS="video-hybrid-intel-nvidia-bumblebee video-nvidia video-nvidia-340xx video-nvidia video-nvidia-390xx video-nvidia-340xx video-nvidia-390xx video-nvidia"
# Dependencies
DEPENDS="nvidia-304xx-utils"
......
......@@ -2,7 +2,7 @@
NAME="video-nvidia-340xx"
INFO="Closed source NVIDIA legacy drivers for linux."
VERSION="2018.02.23"
VERSION="2018.05.04"
FREEDRIVER="false"
PRIORITY="4"
......@@ -16,7 +16,7 @@ CONFLICTS_64="lib32-nvidia-utils lib32-nvidia-304xx-utils"
CONKMOD="nvidia nvidia-304xx"
# Conflicts with other mhwd configs
MHWDCONFLICTS="video-hybrid-intel-nvidia-bumblebee video-nvidia video-nvidia-304xx video-hybrid-intel-nvidia-340xx-bumblebee"
MHWDCONFLICTS="video-hybrid-intel-nvidia-bumblebee video-hybrid-intel-nvidia-304xx-bumblebee video-hybrid-intel-nvidia-390xx-bumblebee video-nvidia video-nvidia-304xx video-nvidia-390xx"
# Dependencies
DEPENDS="nvidia-340xx-utils"
......
# mhwd Driver Config
NAME="video-nvidia-390xx"
INFO="Closed source NVIDIA drivers for linux."
VERSION="2018.05.04"
FREEDRIVER="false"
PRIORITY="5"
CLASSIDS="0300 0302"
VENDORIDS="10de"
DEVICEIDS=">/var/lib/mhwd/ids/pci/nvidia-390xx.ids"
# Conflicts
CONFLICTS="nvidia-304xx-utils nvidia-340xx-utils nvidia-utils"
CONFLICTS_64="lib32-nvidia-304xx-utils lib32-nvidia-340xx-utils lib32-nvidia-utils"
CONKMOD="nvidia-304xx nvidia-340xx nvidia"
# Conflicts with other mhwd configs
MHWDCONFLICTS="video-hybrid-intel-nvidia-bumblebee video-hybrid-intel-nvidia-390xx-bumblebee video-nvidia-304xx video-nvidia-340xx video-nvidia"
# Dependencies
DEPENDS="nvidia-390xx-utils"
DEPENDS_64="lib32-nvidia-390xx-utils"
DEPKMOD="nvidia-390xx"
XORGFILE="/etc/X11/mhwd.d/nvidia.conf"
MHWDGPU_BLCKLSTNVIDIA="/etc/modprobe.d/mhwd-gpu.conf"
MHWDGPU_MODLDNVIDIA="/etc/modules-load.d/mhwd-gpu.conf"
fix_screen_flickering()
{
sed -i /'Section "Device"'/,/'EndSection'/s/'EndSection'/"\tOption \"RegistryDwords\" \"PowerMizerEnable=0x1; PerfLevelSrc=0x2222; PowerMizerDefault=0x2; PowerMizerDefaultAC=0x1\"\nEndSection"/g "${XORGFILE}"
}
post_install()
{
nvidia-xconfig -o "${XORGFILE}" --composite &>/dev/null
MHWD_ADD_BACKSPACE "${XORGFILE}"
# Remove logo
sed -i /'Section "Device"'/,/'EndSection'/s/'EndSection'/"\tOption \"NoLogo\" \"1\"\nEndSection"/g "${XORGFILE}"
# Fix screen flickering for some nvidia devices
MHWD_FUNC_ON_MATCH 0300 10de "0400 0401 0402 0403 0407 0409 0425" fix_screen_flickering
mhwd-gpu --setmod nvidia --setxorg "${XORGFILE}"
# Without this 'glxgears' don't work in live-session
MODULES_LOAD="/etc/modules-load.d"
echo "nvidia-drm" >> "${MODULES_LOAD}/mhwd-gpu.conf"
if [ ! "$(pgrep X)" ]; then
modprobe nvidia-drm
fi
}
post_remove()
{
if [ -e "${XORGFILE}" ]; then
rm "${XORGFILE}"
fi
if [ -f "${MHWDGPU_BLCKLSTNVIDIA}" ]; then
sed -i '/^blacklist nouveau/d' "${MHWDGPU_BLCKLSTNVIDIA}"
sed -i '/^blacklist ttm/d' "${MHWDGPU_BLCKLSTNVIDIA}"
sed -i '/^blacklist drm_kms_helper/d' "${MHWDGPU_BLCKLSTNVIDIA}"
sed -i '/^blacklist drm/d' "${MHWDGPU_BLCKLSTNVIDIA}"
fi
if [ -f "${MHWDGPU_MODLDNVIDIA}" ]; then
sed -i '/^nvidia/d' "${MHWDGPU_MODLDNVIDIA}"
fi
mhwd-gpu --check
}
......@@ -2,9 +2,9 @@
NAME="video-nvidia"
INFO="Closed source NVIDIA drivers for linux."
VERSION="2018.02.23"
VERSION="2018.05.04"
FREEDRIVER="false"
PRIORITY="5"
PRIORITY="6"
CLASSIDS="0300 0302"
VENDORIDS="10de"
......@@ -16,7 +16,7 @@ CONFLICTS_64="lib32-nvidia-304xx-utils lib32-nvidia-340xx-utils"
CONKMOD="nvidia-304xx nvidia-340xx"
# Conflicts with other mhwd configs
MHWDCONFLICTS="video-hybrid-intel-nvidia-bumblebee video-nvidia-304xx video-nvidia-340xx video-hybrid-intel-nvidia-340xx-bumblebee"
MHWDCONFLICTS="video-hybrid-intel-nvidia-bumblebee video-hybrid-intel-nvidia-390xx-bumblebee video-nvidia-304xx video-nvidia-340xx video-nvidia-390xx"
# Dependencies
DEPENDS="nvidia-utils"
......
......@@ -2,9 +2,9 @@
NAME="video-linux"
INFO="Standard open source drivers."
VERSION="2018.02.15"
VERSION="2018.05.04"
FREEDRIVER="true"
PRIORITY="3"
PRIORITY="2"
# VENDOR AMD=1002 INTEL=8086 NVIDIA=10de
VENDORIDS="1002 8086 10de"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment