commit 4b83baf53224f7a78291e673f7eb3b15b1b4c526
Author: Thaison Nguyen <thieson08(a)me.com>
Date: Thu Dec 24 08:53:50 2020 +0100
Patch for kernel-5.10.0
kernel-5.10.patch | 24 ++++++++++++++++++++++++
nvidia-340xx-kmod.spec | 7 ++++++-
2 files changed, 30 insertions(+), 1 deletion(-)
---
diff --git a/kernel-5.10.patch b/kernel-5.10.patch
new file mode 100644
index 0000000..ed7441a
--- /dev/null
+++ b/kernel-5.10.patch
@@ -0,0 +1,24 @@
+diff -Naur a/kernel/nv-drm.c b/kernel/nv-drm.c
+--- a/kernel/nv-drm.c 2020-12-15 21:24:49.983592055 +0100
++++ b/kernel/nv-drm.c 2020-12-15 21:27:50.188647605 +0100
+@@ -13,6 +13,7 @@
+ #include "nv-misc.h"
+ #include "os-interface.h"
+ #include "nv-linux.h"
++#include <linux/version.h>
+
+ #if defined(NV_DRM_AVAILABLE)
+
+@@ -365,7 +365,11 @@
+ struct nv_gem_object *nv_obj = container_of(obj, struct nv_gem_object, base);
+ int page_count = obj->size >> PAGE_SHIFT;
+
+- return drm_prime_pages_to_sg(nv_obj->pages, page_count);
++ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)
++ return drm_prime_pages_to_sg(obj->dev, nv_obj->pages, page_count);
++ #else
++ return drm_prime_pages_to_sg(nv_obj->pages, page_count);
++ #endif
+ }
+
+ static void* nv_gem_prime_vmap(
diff --git a/nvidia-340xx-kmod.spec b/nvidia-340xx-kmod.spec
index 7af4cc1..b28f0c6 100644
--- a/nvidia-340xx-kmod.spec
+++ b/nvidia-340xx-kmod.spec
@@ -12,7 +12,7 @@ Name: nvidia-340xx-kmod
Epoch: 1
Version: 340.108
# Taken over by kmodtool
-Release: 8%{?dist}
+Release: 9%{?dist}
Summary: NVIDIA display driver kernel module
Group: System Environment/Kernel
License: Redistributable, no modification permitted
@@ -23,6 +23,7 @@ Patch0: nv-linux-arm.patch
Patch1: kernel-5.7.patch
Patch2: kernel-5.8.patch
Patch3: kernel-5.9.patch
+Patch4: kernel-5.10.patch
BuildRequires: elfutils-libelf-devel
BuildRequires: gcc
@@ -52,6 +53,7 @@ tar --use-compress-program xz -xf
%{_datadir}/%{name}-%{version}/%{name}-%{versi
%patch1 -p1
%patch2 -p1
%patch3 -p1
+%patch4 -p1
%patch0 -p1
for kernel_version in %{?kernel_versions} ; do
@@ -82,6 +84,9 @@ done
%{?akmod_install}
%changelog
+* Tue Dec 15 2020 Thaison Nguyen <thieson08(a)me.com> - 1:340.108-9
+- Patch for kernel-5.10.0
+
* Tue Dec 8 2020 Thaison Nguyen <thieson08(a)me.com> - 1:340.108-8
- rebuilt with rpmdev-bumpspec -D