commit 786382da08e08371ae2e81de67e2dd50163b1e73
Author: Henrik Nordström <henrik(a)hno.se>
Date: Sun Jun 27 14:48:38 2021 +0200
Import kernel 5.12 patch from OpenSuSE via Arch
kernel-5.12.patch | 47 +++++++++++++++++++++++++++++++++++++++++++++++
nvidia-390xx-kmod.spec | 12 ++++++++++--
2 files changed, 57 insertions(+), 2 deletions(-)
---
diff --git a/kernel-5.12.patch b/kernel-5.12.patch
new file mode 100644
index 0000000..8413156
--- /dev/null
+++ b/kernel-5.12.patch
@@ -0,0 +1,47 @@
+Taken from
https://build.opensuse.org/package/view_file/X11:Drivers:Video/nvidia-gfx...
+Credit to Larry Finger <Larry.Finger(a)lwfinger.net>
+390.143 refresh and version check by JF
+
+Index: NVIDIA-Linux-x86_64-390.143-no-compat32/kernel/nvidia-drm/nvidia-drm-drv.c
+===================================================================
+--- NVIDIA-Linux-x86_64-390.143-no-compat32.orig/kernel/nvidia-drm/nvidia-drm-drv.c
++++ NVIDIA-Linux-x86_64-390.143-no-compat32/kernel/nvidia-drm/nvidia-drm-drv.c
+@@ -20,6 +20,8 @@
+ * DEALINGS IN THE SOFTWARE.
+ */
+
++#include <linux/version.h>
++
+ #include "nvidia-drm-conftest.h" /* NV_DRM_AVAILABLE and
NV_DRM_DRM_GEM_H_PRESENT */
+
+ #include "nvidia-drm-priv.h"
+@@ -737,6 +737,17 @@ static struct drm_driver nv_drm_driver =
+ #endif
+ };
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 12, 0)
++/* Starting with kernel 5.12, drm_gem_dumb_destroy() is no longer exported.
++ * For that reason, we need to supply a replacement version.
++ */
++int replace_dumb_destroy(struct drm_file *file,
++ struct drm_device *dev,
++ u32 handle)
++{
++ return drm_gem_handle_delete(file, handle);
++}
++#endif
+
+ /*
+ * Update the global nv_drm_driver for the intended features.
+@@ -760,7 +767,11 @@ static void nv_drm_update_drm_driver_fea
+
+ nv_drm_driver.dumb_create = nv_drm_dumb_create;
+ nv_drm_driver.dumb_map_offset = nv_drm_dumb_map_offset;
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0)
+ nv_drm_driver.dumb_destroy = nv_drm_dumb_destroy;
++#else
++ nv_drm_driver.dumb_destroy = replace_dumb_destroy;
++#endif
+
+ #if defined(NV_DRM_DRIVER_HAS_GEM_PRIME_CALLBACKS)
+ nv_drm_driver.gem_vm_ops = &nv_drm_gem_vma_ops;
diff --git a/nvidia-390xx-kmod.spec b/nvidia-390xx-kmod.spec
index 7738487..fb64ece 100644
--- a/nvidia-390xx-kmod.spec
+++ b/nvidia-390xx-kmod.spec
@@ -12,7 +12,7 @@ Name: nvidia-390xx-kmod
Epoch: 3
Version: 390.143
# Taken over by kmodtool
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: NVIDIA 390xx display driver kernel module
Group: System Environment/Kernel
License: Redistributable, no modification permitted
@@ -20,9 +20,13 @@ URL:
http://www.nvidia.com/
Source11: nvidia-390xx-kmodtool-excludekernel-filterfile
-# Patches from Debian
https://salsa.debian.org/nvidia-team/nvidia-graphics-drivers/-/tree/390xx...
+# Patches partially sourced from
+# Debian
https://salsa.debian.org/nvidia-team/nvidia-graphics-drivers/-/tree/390xx...
+# Arch
https://aur.archlinux.org/packages/nvidia-390xx-dkms/
+
# kernel support
Patch10: do-div-cast.patch
+Patch11: kernel-5.12.patch
# build system updates
Patch30: use-kbuild-compiler.patch
@@ -63,6 +67,7 @@ kmodtool --target %{_target_cpu} --repo rpmfusion --kmodname %{name}
--filterf
tar --use-compress-program xz -xf
%{_datadir}/%{name}-%{version}/%{name}-%{version}-%{_target_cpu}.tar.xz
# Apply patches
%patch10 -p1 -d kernel
+%patch11 -p2 -d kernel
%patch30 -p1 -d kernel
%patch31 -p1 -d kernel
%patch32 -p1 -d kernel
@@ -98,6 +103,9 @@ done
%changelog
+* Sun Jun 27 2021 Henrik Nordstrom <henrik(a)henriknordstrom.net> - 390.143-2
+- Kernel 5.12 patch taken from OpenSuSE via Arch
+
* Tue Apr 20 2021 Henrik Nordstrom <henrik(a)henriknordstrom.net> - 390.143-1
- Update to 390.143