summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIonen Wolkens <ionen@gentoo.org>2022-05-20 20:05:42 -0400
committerIonen Wolkens <ionen@gentoo.org>2022-05-20 20:18:50 -0400
commitf56310fc9f3542319950e223dacfcbf301f596ec (patch)
treef0dacd1038f8851cd0a16fc0e0b171c350ae7a93 /x11-drivers
parentsec-keys/openpgp-keys-evenrouault: update EAPI 7 -> 8 (diff)
downloadgentoo-f56310fc9f3542319950e223dacfcbf301f596ec.tar.gz
gentoo-f56310fc9f3542319950e223dacfcbf301f596ec.tar.bz2
gentoo-f56310fc9f3542319950e223dacfcbf301f596ec.zip
x11-drivers/nvidia-drivers: install PM udev rules from README.txt
User reported it solved some power management issues (e.g. oddities followed by Xorg segfault when using sleep with GNOME), and other distros like Fedora install these unconditionally. Only for 470+ given wasn't included in nvidia's README for 390.xx and likely not relevant. Skip revbump, not known(?) to affect many and will propagate on kernel upgrades + rebuild. Thanks-to: Randall T. Vasquez Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
Diffstat (limited to 'x11-drivers')
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-470.rules7
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-470.129.06.ebuild13
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-470.62.29.ebuild13
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-510.73.05.ebuild13
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-515.43.04.ebuild13
5 files changed, 51 insertions, 8 deletions
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-470.rules b/x11-drivers/nvidia-drivers/files/nvidia-470.rules
new file mode 100644
index 000000000000..ba3cefef9876
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-470.rules
@@ -0,0 +1,7 @@
+# Enable runtime PM for NVIDIA VGA/3D controller devices on driver bind
+ACTION=="bind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030000", TEST=="power/control", ATTR{power/control}="auto"
+ACTION=="bind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030200", TEST=="power/control", ATTR{power/control}="auto"
+
+# Disable runtime PM for NVIDIA VGA/3D controller devices on driver unbind
+ACTION=="unbind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030000", TEST=="power/control", ATTR{power/control}="on"
+ACTION=="unbind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030200", TEST=="power/control", ATTR{power/control}="on"
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-470.129.06.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-470.129.06.ebuild
index ba4807bf5a9c..7a1897471468 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-470.129.06.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-470.129.06.ebuild
@@ -5,7 +5,7 @@ EAPI=8
MODULES_OPTIONAL_USE="driver"
inherit desktop flag-o-matic linux-mod multilib readme.gentoo-r1 \
- systemd toolchain-funcs unpacker user-info
+ systemd toolchain-funcs udev unpacker user-info
NV_KERNEL_MAX="5.17"
NV_URI="https://download.nvidia.com/XFree86/"
@@ -367,6 +367,9 @@ https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers"
# symlink non-versioned so nvidia-settings can use it even if misdetected
dosym nvidia-application-profiles-${PV}-key-documentation \
${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation
+
+ # udev rules taken from nvidia's README.txt to help with power management
+ use driver && udev_newrules "${FILESDIR}"/nvidia-470.rules 60-nvidia.rules
}
pkg_preinst() {
@@ -397,7 +400,8 @@ pkg_preinst() {
}
pkg_postinst() {
- use driver && linux-mod_pkg_postinst
+ linux-mod_pkg_postinst
+ use driver && udev_reload
readme.gentoo_print_elog
@@ -449,3 +453,8 @@ pkg_postinst() {
elog "supported by a few wayland compositors (e.g. kwin / mutter, not sway)."
fi
}
+
+pkg_postrm() {
+ linux-mod_pkg_postrm
+ use driver && udev_reload
+}
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-470.62.29.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-470.62.29.ebuild
index cab98353f284..f2528612b9fc 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-470.62.29.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-470.62.29.ebuild
@@ -5,7 +5,7 @@ EAPI=8
MODULES_OPTIONAL_USE="driver"
inherit desktop flag-o-matic linux-mod multilib readme.gentoo-r1 \
- systemd toolchain-funcs unpacker user-info
+ systemd toolchain-funcs udev unpacker user-info
NV_KERNEL_MAX="5.15"
NV_PIN="470.103.01"
@@ -363,6 +363,9 @@ https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers"
systemd_dounit systemd/system/nvidia-{hibernate,resume,suspend}.service
dobin nvidia-bug-report.sh
+
+ # udev rules taken from nvidia's README.txt to help with power management
+ use driver && udev_newrules "${FILESDIR}"/nvidia-470.rules 60-nvidia.rules
}
pkg_preinst() {
@@ -393,7 +396,8 @@ pkg_preinst() {
}
pkg_postinst() {
- use driver && linux-mod_pkg_postinst
+ linux-mod_pkg_postinst
+ use driver && udev_reload
readme.gentoo_print_elog
@@ -445,3 +449,8 @@ pkg_postinst() {
elog "supported by a few wayland compositors (e.g. kwin / mutter, not sway)."
fi
}
+
+pkg_postrm() {
+ linux-mod_pkg_postrm
+ use driver && udev_reload
+}
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-510.73.05.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-510.73.05.ebuild
index 043bb8ba2030..60d3a7e68313 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-510.73.05.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-510.73.05.ebuild
@@ -5,7 +5,7 @@ EAPI=8
MODULES_OPTIONAL_USE="driver"
inherit desktop flag-o-matic linux-mod multilib readme.gentoo-r1 \
- systemd toolchain-funcs unpacker user-info
+ systemd toolchain-funcs udev unpacker user-info
NV_KERNEL_MAX="5.17"
NV_URI="https://download.nvidia.com/XFree86/"
@@ -382,6 +382,9 @@ https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers"
# symlink non-versioned so nvidia-settings can use it even if misdetected
dosym nvidia-application-profiles-${PV}-key-documentation \
${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation
+
+ # udev rules taken from nvidia's README.txt to help with power management
+ use driver && udev_newrules "${FILESDIR}"/nvidia-470.rules 60-nvidia.rules
}
pkg_preinst() {
@@ -412,7 +415,8 @@ pkg_preinst() {
}
pkg_postinst() {
- use driver && linux-mod_pkg_postinst
+ linux-mod_pkg_postinst
+ use driver && udev_reload
readme.gentoo_print_elog
@@ -461,3 +465,8 @@ pkg_postinst() {
elog "Of note, may possibly cause issues with SLI and Reverse PRIME."
fi
}
+
+pkg_postrm() {
+ linux-mod_pkg_postrm
+ use driver && udev_reload
+}
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-515.43.04.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-515.43.04.ebuild
index 2894896e70c1..d9a29874e5ad 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-515.43.04.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-515.43.04.ebuild
@@ -5,7 +5,7 @@ EAPI=8
MODULES_OPTIONAL_USE="driver"
inherit desktop flag-o-matic linux-mod multilib readme.gentoo-r1 \
- systemd toolchain-funcs unpacker user-info
+ systemd toolchain-funcs udev unpacker user-info
NV_KERNEL_MAX="5.17"
NV_URI="https://download.nvidia.com/XFree86/"
@@ -406,6 +406,9 @@ https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers"
# fails to detect version (i.e. mismatch, or with kernel-open)
dosym nvidia-application-profiles-${PV}-key-documentation \
${paths[APPLICATION_PROFILE]}/nvidia-application-profiles-key-documentation
+
+ # udev rules taken from nvidia's README.txt to help with power management
+ use driver && udev_newrules "${FILESDIR}"/nvidia-470.rules 60-nvidia.rules
}
pkg_preinst() {
@@ -436,7 +439,8 @@ pkg_preinst() {
}
pkg_postinst() {
- use driver && linux-mod_pkg_postinst
+ linux-mod_pkg_postinst
+ use driver && udev_reload
readme.gentoo_print_elog
@@ -496,3 +500,8 @@ pkg_postinst() {
elog "Of note, may possibly cause issues with SLI and Reverse PRIME."
fi
}
+
+pkg_postrm() {
+ linux-mod_pkg_postrm
+ use driver && udev_reload
+}