commit a393c00e134a2e78d4c462357d015e90b711214e
Author: leigh123linux <leigh123linux(a)googlemail.com>
Date: Sat Aug 12 16:31:55 2017 +0100
patch for kernel-4.12
kernel_4.10.patch => 4.10_kernel.patch | 0
4.12_kernel.patch | 41 ++++++++++++++++++++++++++++++++++
4.9.0_kernel.patch => 4.9_kernel.patch | 0
nvidia-304xx-kmod.spec | 11 ++++++---
4 files changed, 49 insertions(+), 3 deletions(-)
---
diff --git a/kernel_4.10.patch b/4.10_kernel.patch
similarity index 100%
rename from kernel_4.10.patch
rename to 4.10_kernel.patch
diff --git a/4.12_kernel.patch b/4.12_kernel.patch
new file mode 100644
index 0000000..c3aee15
--- /dev/null
+++ b/4.12_kernel.patch
@@ -0,0 +1,41 @@
+From 5c46c537c864f08b22c6db4c187755c66bfcaa70 Mon Sep 17 00:00:00 2001
+From: Seth Forshee <seth.forshee(a)canonical.com>
+Date: Tue, 25 Jul 2017 08:05:39 -0500
+Subject: [PATCH] Add support for Linux 4.12
+
+---
+ nv-linux.h | 18 +++++++++++++++++-
+ 1 file changed, 17 insertions(+), 1 deletion(-)
+
+diff --git a/kernel/nv-linux.h b/kernel/nv-linux.h
+index 3081c065992b..c22b103c7c1f 100644
+--- a/kernel/nv-linux.h
++++ b/kernel/nv-linux.h
+@@ -1378,7 +1378,23 @@ typedef void irqreturn_t;
+ })
+ #define NV_PMD_UNMAP(pmd) pmd_unmap(pmd);
+ #else
+-#if defined(PUD_SHIFT) /* 4-level pgtable */
++#if defined(P4D_SHIFT) /* 5-level pgtable */
++#define NV_PMD_OFFSET(address, pgd) \
++ ({ \
++ pmd_t *__pmd; \
++ p4d_t *__p4d; \
++ pud_t *__pud; \
++ __p4d = p4d_offset(pgd, address); \
++ if (__p4d == NULL || \
++ (p4d_bad(*__p4d) || p4d_none(*__p4d))) \
++ return NULL; \
++ __pud = pud_offset(__p4d, address); \
++ if (__pud == NULL || \
++ (pud_bad(*__pud) || pud_none(*__pud))) \
++ return NULL; \
++ __pmd = pmd_offset(__pud, address); \
++ })
++#elif defined(PUD_SHIFT) /* 4-level pgtable */
+ #define NV_PMD_OFFSET(address, pgd) \
+ ({ \
+ pmd_t *__pmd = NULL; \
+--
+2.11.0
+
diff --git a/4.9.0_kernel.patch b/4.9_kernel.patch
similarity index 100%
rename from 4.9.0_kernel.patch
rename to 4.9_kernel.patch
diff --git a/nvidia-304xx-kmod.spec b/nvidia-304xx-kmod.spec
index d986b14..217187c 100644
--- a/nvidia-304xx-kmod.spec
+++ b/nvidia-304xx-kmod.spec
@@ -9,7 +9,7 @@
Name: nvidia-304xx-kmod
Version: 304.135
# Taken over by kmodtool
-Release: 4%{?dist}
+Release: 5%{?dist}
Summary: NVIDIA display driver kernel module
Group: System Environment/Kernel
License: Redistributable, no modification permitted
@@ -22,9 +22,10 @@ Source0: nvidia-kmod-data-%{version}.tar.xz
Source11: nvidia-304xx-kmodtool-excludekernel-filterfile
#
https://anonscm.debian.org/viewvc/pkg-nvidia/packages/nvidia-graphics-dri...
#Patch0: disable-mtrr.patch
-Patch1: 4.9.0_kernel.patch
-Patch2: kernel_4.10.patch
+Patch1: 4.9_kernel.patch
+Patch2: 4.10_kernel.patch
Patch3: 4.11_kernel.patch
+Patch4: 4.12_kernel.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -55,6 +56,7 @@ pushd nvidiapkg-${arch}
%patch1 -p1
%patch2 -p1
%patch3 -p1
+%patch4 -p1
popd
done
@@ -88,6 +90,9 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Sat Aug 12 2017 Leigh Scott <leigh123linux(a)googlemail.com> - 304.135-5
+- patch for kernel-4.12
+
* Sun Apr 23 2017 Leigh Scott <leigh123linux(a)googlemail.com> - 304.135-4
- patch for kernel-4.11rc