commit c093f408d381c97cd2300665fc0facda926bd750
Author: Henrik Nordström <henrik(a)hno.se>
Date: Wed Sep 22 22:42:57 2021 +0200
Kernel 5.14 patch from openSUSE
kernel-5.14.patch | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++
nvidia-390xx-kmod.spec | 10 +++++--
2 files changed, 87 insertions(+), 2 deletions(-)
---
diff --git a/kernel-5.14.patch b/kernel-5.14.patch
new file mode 100644
index 0000000..e6a11c0
--- /dev/null
+++ b/kernel-5.14.patch
@@ -0,0 +1,79 @@
+diff -u -p -r NVIDIA-Linux-x86_64-390.144/kernel.orig/conftest.sh
NVIDIA-Linux-x86_64-390.144/kernel/conftest.sh
+--- NVIDIA-Linux-x86_64-390.144/kernel.orig/conftest.sh 2021-08-31 16:58:57.799629833
+0200
++++ NVIDIA-Linux-x86_64-390.144/kernel/conftest.sh 2021-08-31 18:00:09.257825534 +0200
+@@ -4493,6 +4493,30 @@ compile_test() {
+ fi
+ ;;
+
++ drm_device_has_pdev)
++ #
++ # Determine if the 'drm_device' structure has a 'pdev'
field.
++ #
++ # Removed by commit b347e04452ff ("drm: Remove pdev field from
++ # struct drm_device") in v5.14-rc1.
++ #
++ CODE="
++ #if defined(NV_DRM_DRMP_H_PRESENT)
++ #include <drm/drmP.h>
++ #endif
++
++ #if defined(NV_DRM_DRM_DEVICE_H_PRESENT)
++ #include <drm/drm_device.h>
++ #endif
++
++ int conftest_drm_device_has_pdev(void) {
++ return offsetof(struct drm_device, pdev);
++ }"
++
++ compile_check_conftest "$CODE" "NV_DRM_DEVICE_HAS_PDEV"
"" "types"
++ ;;
++
++
+ esac
+ }
+
+diff -u -p -r NVIDIA-Linux-x86_64-390.144/kernel.orig/nvidia/nvlink_linux.c
NVIDIA-Linux-x86_64-390.144/kernel/nvidia/nvlink_linux.c
+--- NVIDIA-Linux-x86_64-390.144/kernel.orig/nvidia/nvlink_linux.c 2021-08-31
16:58:57.787629590 +0200
++++ NVIDIA-Linux-x86_64-390.144/kernel/nvidia/nvlink_linux.c 2021-08-31
17:51:49.207744327 +0200
+@@ -597,7 +597,7 @@ void NVLINK_API_CALL nvlink_sleep(unsign
+ // the requested timeout has expired, loop until less
+ // than a jiffie of the desired delay remains.
+ //
+- current->state = TASK_INTERRUPTIBLE;
++ set_current_state(TASK_INTERRUPTIBLE);
+ do
+ {
+ schedule_timeout(jiffies);
+diff -u -p -r NVIDIA-Linux-x86_64-390.144/kernel.orig/nvidia/os-interface.c
NVIDIA-Linux-x86_64-390.144/kernel/nvidia/os-interface.c
+--- NVIDIA-Linux-x86_64-390.144/kernel.orig/nvidia/os-interface.c 2021-08-31
16:58:57.787629590 +0200
++++ NVIDIA-Linux-x86_64-390.144/kernel/nvidia/os-interface.c 2021-08-31
17:51:58.043922420 +0200
+@@ -580,7 +580,7 @@ NV_STATUS NV_API_CALL os_delay(NvU32 Mil
+ // the requested timeout has expired, loop until less
+ // than a jiffie of the desired delay remains.
+ //
+- current->state = TASK_INTERRUPTIBLE;
++ set_current_state(TASK_INTERRUPTIBLE);
+ do
+ {
+ schedule_timeout(jiffies);
+diff -u -p -r NVIDIA-Linux-x86_64-390.144/kernel.orig/nvidia-drm/nvidia-drm-drv.c
NVIDIA-Linux-x86_64-390.144/kernel/nvidia-drm/nvidia-drm-drv.c
+--- NVIDIA-Linux-x86_64-390.144/kernel.orig/nvidia-drm/nvidia-drm-drv.c 2021-08-31
16:58:57.783629508 +0200
++++ NVIDIA-Linux-x86_64-390.144/kernel/nvidia-drm/nvidia-drm-drv.c 2021-08-31
17:56:41.345633279 +0200
+@@ -811,7 +811,9 @@ static void nv_drm_register_drm_device(c
+
+ dev->dev_private = nv_dev;
+ nv_dev->dev = dev;
++#if defined(NV_DRM_DEVICE_HAS_PDEV)
+ dev->pdev = pdev;
++#endif
+
+ /* Register DRM device to DRM sub-system */
+
+diff -u -p -r NVIDIA-Linux-x86_64-390.144/kernel.orig/nvidia-drm/nvidia-drm.Kbuild
NVIDIA-Linux-x86_64-390.144/kernel/nvidia-drm/nvidia-drm.Kbuild
+--- NVIDIA-Linux-x86_64-390.144/kernel.orig/nvidia-drm/nvidia-drm.Kbuild 2021-08-31
16:58:57.783629508 +0200
++++ NVIDIA-Linux-x86_64-390.144/kernel/nvidia-drm/nvidia-drm.Kbuild 2021-08-31
17:53:18.265539346 +0200
+@@ -102,3 +102,4 @@ NV_CONFTEST_TYPE_COMPILE_TESTS += drm_dr
+ NV_CONFTEST_TYPE_COMPILE_TESTS += drm_crtc_atomic_check_has_atomic_state_arg
+ NV_CONFTEST_TYPE_COMPILE_TESTS += drm_gem_object_vmap_has_map_arg
+ NV_CONFTEST_TYPE_COMPILE_TESTS += drm_plane_atomic_check_has_atomic_state_arg
++NV_CONFTEST_TYPE_COMPILE_TESTS += drm_device_has_pdev
diff --git a/nvidia-390xx-kmod.spec b/nvidia-390xx-kmod.spec
index c2b1008..09351de 100644
--- a/nvidia-390xx-kmod.spec
+++ b/nvidia-390xx-kmod.spec
@@ -12,7 +12,7 @@ Name: nvidia-390xx-kmod
Epoch: 3
Version: 390.144
# Taken over by kmodtool
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: NVIDIA 390xx display driver kernel module
Group: System Environment/Kernel
License: Redistributable, no modification permitted
@@ -24,11 +24,13 @@ Source11: nvidia-390xx-kmodtool-excludekernel-filterfile
# Debian
https://salsa.debian.org/nvidia-team/nvidia-graphics-drivers/-/tree/390xx...
# Arch
https://aur.archlinux.org/packages/nvidia-390xx-dkms/
#
https://gitlab.com/herecura/packages/nvidia-390xx-dkms/
+# openSUSE
https://build.opensuse.org/package/show/home:luc14n0:nvidia/nvidia-gfxG04
# kernel support
Patch10: do-div-cast.patch
Patch11: kernel-5.12.patch
Patch12:
https://gitlab.com/herecura/packages/nvidia-390xx-dkms/-/raw/herecura/ker...
+Patch13:
https://build.opensuse.org/source/home:luc14n0:nvidia/nvidia-gfxG04/kerne...
# build system updates
Patch30: use-kbuild-compiler.patch
@@ -71,6 +73,7 @@ tar --use-compress-program xz -xf
%{_datadir}/%{name}-%{version}/%{name}-%{versi
%patch10 -p1 -b 10 -d kernel
%patch11 -p2 -b 11 -d kernel
%patch12 -p2 -b 12 -d kernel
+%patch13 -p2 -b 12 -d kernel
%patch30 -p1 -b 30 -d kernel
%patch31 -p1 -b 31 -d kernel
%patch32 -p1 -b 32 -d kernel
@@ -106,6 +109,9 @@ done
%changelog
+* Wed Sep 22 2021 Henrik Nordstrom <henrik(a)henriknordstrom.net> - 390.144-3
+- Kernel 5.14 patch taken from openSUSE
+
* Wed Aug 04 2021 RPM Fusion Release Engineering <leigh123linux(a)gmail.com> -
3:390.144-2
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
@@ -113,7 +119,7 @@ done
- Update to 390.144
* Sun Jun 27 2021 Henrik Nordstrom <henrik(a)henriknordstrom.net> - 390.143-2
-- Kernel 5.12 patch taken from OpenSuSE via Arch repo
+- Kernel 5.12 patch taken from openSUSE via Arch repo
- Kernel 5.13 patch taken from Herecura Arch repo
* Tue Apr 20 2021 Henrik Nordstrom <henrik(a)henriknordstrom.net> - 390.143-1