commit ccbbefe00c913680213c42f7bae5cec10da3dfaf
Author: Leigh Scott <leigh123linux(a)gmail.com>
Date: Sat Aug 17 17:38:20 2024 +0100
Fix nvidia framebuffer with 6.11rc
kernel-611-framebuffer.patch | 92 ++++++++++++++++++++++++++++++++++++++++++++
nvidia-kmod.spec | 7 +++-
2 files changed, 98 insertions(+), 1 deletion(-)
---
diff --git a/kernel-611-framebuffer.patch b/kernel-611-framebuffer.patch
new file mode 100644
index 0000000..245c53a
--- /dev/null
+++ b/kernel-611-framebuffer.patch
@@ -0,0 +1,92 @@
+diff -uNrp a/conftest.sh b/conftest.sh
+--- a/conftest.sh 2024-07-30 21:14:40.000000000 +0100
++++ b/conftest.sh 2024-08-17 12:15:07.311710767 +0100
+@@ -6610,6 +6610,25 @@ compile_test() {
+ compile_check_conftest "$CODE"
"NV_DRM_FBDEV_GENERIC_SETUP_PRESENT" "" "functions"
+ ;;
+
++ 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)
+ #
+ # Determine whether drm_aperture_remove_conflicting_pci_framebuffers is
present.
+diff -uNrp a/header-presence-tests.mk b/header-presence-tests.mk
+--- a/header-presence-tests.mk 2024-07-30 21:14:40.000000000 +0100
++++ b/header-presence-tests.mk 2024-08-17 12:11:21.315334757 +0100
+@@ -15,6 +15,7 @@ NV_HEADER_PRESENCE_TESTS = \
+ drm/drm_atomic_uapi.h \
+ drm/drm_drv.h \
+ drm/drm_fbdev_generic.h \
++ drm/drm_fbdev_ttm.h \
+ drm/drm_framebuffer.h \
+ drm/drm_connector.h \
+ drm/drm_probe_helper.h \
+diff -uNrp a/nvidia-drm/nvidia-drm-drv.c b/nvidia-drm/nvidia-drm-drv.c
+--- a/nvidia-drm/nvidia-drm-drv.c 2024-07-30 21:31:46.000000000 +0100
++++ b/nvidia-drm/nvidia-drm-drv.c 2024-08-17 15:56:09.777675388 +0100
+@@ -73,8 +73,13 @@
+ #include <drm/drm_fbdev_generic.h>
+ #endif
+
++#if defined(NV_DRM_DRM_FBDEV_TTM_H_PRESENT)
++#include <drm/drm_fbdev_ttm.h>
++#endif
++
+ #include <linux/pci.h>
+ #include <linux/workqueue.h>
++#include <linux/version.h>
+
+ /*
+ * Commit fcd70cd36b9b ("drm: Split out drm_probe_helper.h")
+@@ -1851,7 +1856,11 @@ void nv_drm_register_drm_device(const nv
+ drm_aperture_remove_conflicting_pci_framebuffers(pdev, nv_drm_driver.name);
+ #endif
+ }
++#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 11, 0)
+ drm_fbdev_generic_setup(dev, 32);
++#else
++ drm_fbdev_ttm_setup(dev, 32);
++#endif
+ }
+ #endif /* defined(NV_DRM_FBDEV_GENERIC_AVAILABLE) */
+
+diff -uNrp a/nvidia-drm/nvidia-drm-os-interface.h b/nvidia-drm/nvidia-drm-os-interface.h
+--- a/nvidia-drm/nvidia-drm-os-interface.h 2024-07-30 21:31:46.000000000 +0100
++++ b/nvidia-drm/nvidia-drm-os-interface.h 2024-08-17 15:49:18.703671076 +0100
+@@ -58,7 +58,7 @@ typedef struct nv_timer nv_drm_timer;
+ #error "Need to define kernel timer callback primitives for this OS"
+ #endif
+
+-#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
+ #endif
+
+diff -uNrp a/nvidia-drm/nvidia-drm-sources.mk b/nvidia-drm/nvidia-drm-sources.mk
+--- a/nvidia-drm/nvidia-drm-sources.mk 2024-07-30 21:17:37.000000000 +0100
++++ b/nvidia-drm/nvidia-drm-sources.mk 2024-08-17 16:06:05.645589668 +0100
+@@ -67,6 +67,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += fe
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += sync_file_get_fence
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_aperture_remove_conflicting_pci_framebuffers
+ 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
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_helper_crtc_enable_color_mgmt
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_crtc_enable_color_mgmt
diff --git a/nvidia-kmod.spec b/nvidia-kmod.spec
index 33644e5..c4112d0 100644
--- a/nvidia-kmod.spec
+++ b/nvidia-kmod.spec
@@ -12,13 +12,14 @@ Name: nvidia-kmod
Epoch: 3
Version: 560.31.02
# Taken over by kmodtool
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: NVIDIA display driver kernel module
License: Redistributable, no modification permitted
URL:
https://www.nvidia.com/
Source11: nvidia-kmodtool-excludekernel-filterfile
Patch0: make_modeset_default.patch
+Patch1: kernel-611-framebuffer.patch
# needed for plague to make sure it builds for i586 and i686
ExclusiveArch: x86_64 aarch64
@@ -52,6 +53,7 @@ echo "Using original nvidia defaults"
%else
echo "Set nvidia to fbdev=1 modeset=1"
%patch -P0 -p1
+%patch -P1 -p1 -d kernel/
%endif
for kernel_version in %{?kernel_versions} ; do
cp -a kernel _kmod_build_${kernel_version%%___*}
@@ -86,6 +88,9 @@ done
%changelog
+* Sat Aug 17 2024 Leigh Scott <leigh123linux(a)gmail.com> - 3:560.31.02-1
+- rebuilt
+
* Tue Aug 06 2024 Leigh Scott <leigh123linux(a)gmail.com> - 3:560.31.02-1
- Update to 560.31.02 beta