summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIonen Wolkens <ionen@gentoo.org>2024-09-18 18:16:48 -0400
committerIonen Wolkens <ionen@gentoo.org>2024-09-18 18:42:35 -0400
commit86de42c9fddf3c7a693b77d3662a2677d2b402f3 (patch)
tree3478408622fb165982b6eb544757c3c6655e34de
parentnet-misc/lldpd: stabilize 1.0.18 for amd64 (bug #918553) (diff)
downloadgentoo-86de42c9fddf3c7a693b77d3662a2677d2b402f3.tar.gz
gentoo-86de42c9fddf3c7a693b77d3662a2677d2b402f3.tar.bz2
gentoo-86de42c9fddf3c7a693b77d3662a2677d2b402f3.zip
x11-drivers/nvidia-drivers: add fbdev_ttm detection for kernel 6.11
See patch comment. "If" it does what I think it does, do not believe it is worth a revbump but should still patched before wider use of 6.11.x. Will either way be propagated when users rebuild modules for upcoming 6.11.1. Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-drivers-550.107.02-kernel-6.11-fbdev.patch134
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-550.107.02-r1.ebuild1
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-550.40.71-r1.ebuild1
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-560.35.03-r1.ebuild1
4 files changed, 137 insertions, 0 deletions
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-550.107.02-kernel-6.11-fbdev.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-550.107.02-kernel-6.11-fbdev.patch
new file mode 100644
index 000000000000..01f7e2aa1660
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-550.107.02-kernel-6.11-fbdev.patch
@@ -0,0 +1,134 @@
+At a glance this should(?) only be affecting fbdev=1 (default-off and
+marked experimental in nvidia.conf). Compiles fine either way given
+the test would've failed resulting in usage being skipped.
+
+NVIDIA is already aware[1] and this should be unnecessary next bumps.
+[1] https://github.com/NVIDIA/open-gpu-kernel-modules/pull/692
+--- a/kernel/conftest.sh
++++ b/kernel/conftest.sh
+@@ -6612,2 +6612,21 @@
+
++ drm_fbdev_ttm_setup)
++ #
++ # Determine whether drm_fbdev_ttm_setup is present.
++ #
++ # Added by commit 9060d7f49376 ("drm/fb-helper: Finish the
++ # generic fbdev emulation") in v4.19.
++ #
++ CODE="
++ #include <drm/drm_fb_helper.h>
++ #if defined(NV_DRM_DRM_FBDEV_TTM_H_PRESENT)
++ #include <drm/drm_fbdev_ttm.h>
++ #endif
++ void conftest_drm_fbdev_ttm_setup(void) {
++ drm_fbdev_ttm_setup();
++ }"
++
++ compile_check_conftest "$CODE" "NV_DRM_FBDEV_TTM_SETUP_PRESENT" "" "functions"
++ ;;
++
+ drm_aperture_remove_conflicting_pci_framebuffers)
+--- a/kernel/header-presence-tests.mk
++++ b/kernel/header-presence-tests.mk
+@@ -17,2 +17,3 @@
+ drm/drm_fbdev_generic.h \
++ drm/drm_fbdev_ttm.h \
+ drm/drm_framebuffer.h \
+--- a/kernel/nvidia-drm/nvidia-drm-drv.c
++++ b/kernel/nvidia-drm/nvidia-drm-drv.c
+@@ -75,2 +75,6 @@
+
++#if defined(NV_DRM_DRM_FBDEV_TTM_H_PRESENT)
++#include <drm/drm_fbdev_ttm.h>
++#endif
++
+ #include <linux/pci.h>
+@@ -1853,3 +1857,7 @@
+ }
++#if defined(NV_DRM_FBDEV_TTM_AVAILABLE)
++ drm_fbdev_ttm_setup(dev, 32);
++#else
+ drm_fbdev_generic_setup(dev, 32);
++#endif
+ }
+--- a/kernel/nvidia-drm/nvidia-drm-os-interface.h
++++ b/kernel/nvidia-drm/nvidia-drm-os-interface.h
+@@ -60,4 +60,7 @@
+
+-#if defined(NV_DRM_FBDEV_GENERIC_SETUP_PRESENT) && defined(NV_DRM_APERTURE_REMOVE_CONFLICTING_PCI_FRAMEBUFFERS_PRESENT)
++#if (defined(NV_DRM_FBDEV_GENERIC_SETUP_PRESENT) || defined(NV_DRM_FBDEV_TTM_SETUP_PRESENT)) && defined(NV_DRM_APERTURE_REMOVE_CONFLICTING_PCI_FRAMEBUFFERS_PRESENT)
+ #define NV_DRM_FBDEV_GENERIC_AVAILABLE
++#if defined(NV_DRM_FBDEV_TTM_SETUP_PRESENT)
++#define NV_DRM_FBDEV_TTM_AVAILABLE
++#endif
+ #endif
+--- a/kernel/nvidia-drm/nvidia-drm-sources.mk
++++ b/kernel/nvidia-drm/nvidia-drm-sources.mk
+@@ -69,2 +69,3 @@
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_fbdev_generic_setup
++NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_fbdev_ttm_setup
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_connector_attach_hdr_output_metadata_property
+--- a/kernel-module-source/kernel-open/conftest.sh
++++ b/kernel-module-source/kernel-open/conftest.sh
+@@ -6612,2 +6612,21 @@
+
++ drm_fbdev_ttm_setup)
++ #
++ # Determine whether drm_fbdev_ttm_setup is present.
++ #
++ # Added by commit 9060d7f49376 ("drm/fb-helper: Finish the
++ # generic fbdev emulation") in v4.19.
++ #
++ CODE="
++ #include <drm/drm_fb_helper.h>
++ #if defined(NV_DRM_DRM_FBDEV_TTM_H_PRESENT)
++ #include <drm/drm_fbdev_ttm.h>
++ #endif
++ void conftest_drm_fbdev_ttm_setup(void) {
++ drm_fbdev_ttm_setup();
++ }"
++
++ compile_check_conftest "$CODE" "NV_DRM_FBDEV_TTM_SETUP_PRESENT" "" "functions"
++ ;;
++
+ drm_aperture_remove_conflicting_pci_framebuffers)
+--- a/kernel-module-source/kernel-open/header-presence-tests.mk
++++ b/kernel-module-source/kernel-open/header-presence-tests.mk
+@@ -17,2 +17,3 @@
+ drm/drm_fbdev_generic.h \
++ drm/drm_fbdev_ttm.h \
+ drm/drm_framebuffer.h \
+--- a/kernel-module-source/kernel-open/nvidia-drm/nvidia-drm-drv.c
++++ b/kernel-module-source/kernel-open/nvidia-drm/nvidia-drm-drv.c
+@@ -75,2 +75,6 @@
+
++#if defined(NV_DRM_DRM_FBDEV_TTM_H_PRESENT)
++#include <drm/drm_fbdev_ttm.h>
++#endif
++
+ #include <linux/pci.h>
+@@ -1853,3 +1857,7 @@
+ }
++#if defined(NV_DRM_FBDEV_TTM_AVAILABLE)
++ drm_fbdev_ttm_setup(dev, 32);
++#else
+ drm_fbdev_generic_setup(dev, 32);
++#endif
+ }
+--- a/kernel-module-source/kernel-open/nvidia-drm/nvidia-drm-os-interface.h
++++ b/kernel-module-source/kernel-open/nvidia-drm/nvidia-drm-os-interface.h
+@@ -60,4 +60,7 @@
+
+-#if defined(NV_DRM_FBDEV_GENERIC_SETUP_PRESENT) && defined(NV_DRM_APERTURE_REMOVE_CONFLICTING_PCI_FRAMEBUFFERS_PRESENT)
++#if (defined(NV_DRM_FBDEV_GENERIC_SETUP_PRESENT) || defined(NV_DRM_FBDEV_TTM_SETUP_PRESENT)) && defined(NV_DRM_APERTURE_REMOVE_CONFLICTING_PCI_FRAMEBUFFERS_PRESENT)
+ #define NV_DRM_FBDEV_GENERIC_AVAILABLE
++#if defined(NV_DRM_FBDEV_TTM_SETUP_PRESENT)
++#define NV_DRM_FBDEV_TTM_AVAILABLE
++#endif
+ #endif
+--- a/kernel-module-source/kernel-open/nvidia-drm/nvidia-drm-sources.mk
++++ b/kernel-module-source/kernel-open/nvidia-drm/nvidia-drm-sources.mk
+@@ -69,2 +69,3 @@
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_fbdev_generic_setup
++NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_fbdev_ttm_setup
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_connector_attach_hdr_output_metadata_property
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-550.107.02-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-550.107.02-r1.ebuild
index 17ddc58a0cfc..c0427557f1a5 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-550.107.02-r1.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-550.107.02-r1.ebuild
@@ -90,6 +90,7 @@ QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*"
PATCHES=(
"${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
"${FILESDIR}"/nvidia-settings-530.30.02-desktop.patch
+ "${FILESDIR}"/nvidia-drivers-550.107.02-kernel-6.11-fbdev.patch
)
pkg_setup() {
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-550.40.71-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-550.40.71-r1.ebuild
index ce8321ba3ab2..abee29c518c4 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-550.40.71-r1.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-550.40.71-r1.ebuild
@@ -91,6 +91,7 @@ QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*"
PATCHES=(
"${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
"${FILESDIR}"/nvidia-settings-530.30.02-desktop.patch
+ "${FILESDIR}"/nvidia-drivers-550.107.02-kernel-6.11-fbdev.patch
)
pkg_setup() {
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-560.35.03-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-560.35.03-r1.ebuild
index bfa3b9e55501..ac755f870b2e 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-560.35.03-r1.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-560.35.03-r1.ebuild
@@ -93,6 +93,7 @@ QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*"
PATCHES=(
"${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
"${FILESDIR}"/nvidia-settings-530.30.02-desktop.patch
+ "${FILESDIR}"/nvidia-drivers-550.107.02-kernel-6.11-fbdev.patch
)
pkg_setup() {