[packages/xorg-driver-video-nvidia-legacy-304xx] - rel 5 - fix building with kernel 4.12

baggins baggins at pld-linux.org
Tue Aug 1 10:36:19 CEST 2017


commit 105dfaf5c45aa05445bd7f5d2a0aa0d966ce93e4
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Tue Aug 1 10:36:03 2017 +0200

    - rel 5
    - fix building with kernel 4.12

 linux-4.12.patch                           | 45 ++++++++++++++++++++++++++++++
 xorg-driver-video-nvidia-legacy-304xx.spec |  4 ++-
 2 files changed, 48 insertions(+), 1 deletion(-)
---
diff --git a/xorg-driver-video-nvidia-legacy-304xx.spec b/xorg-driver-video-nvidia-legacy-304xx.spec
index b1a93ab..1638c5e 100644
--- a/xorg-driver-video-nvidia-legacy-304xx.spec
+++ b/xorg-driver-video-nvidia-legacy-304xx.spec
@@ -25,7 +25,7 @@ exit 1
 
 %define		no_install_post_check_so 1
 
-%define		rel	4
+%define		rel	5
 %define		mname	nvidia-legacy-304xx
 %define		pname	xorg-driver-video-%{mname}
 Summary:	Linux Drivers for nVidia GeForce/Quadro Chips
@@ -50,6 +50,7 @@ Patch1:		X11-driver-nvidia-desktop.patch
 Patch2:		linux-4.0.patch
 Patch3:		linux-4.10.patch
 Patch4:		linux-4.11.patch
+Patch5:		linux-4.12.patch
 URL:		http://www.nvidia.com/object/unix.html
 BuildRequires:	rpmbuild(macros) >= 1.701
 %{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}}
@@ -252,6 +253,7 @@ rm -rf NVIDIA-Linux-x86*-%{version}*
 %patch2 -p1
 %patch3 -p1
 %patch4 -p0
+%patch5 -p0
 
 %build
 %{?with_kernel:%{expand:%build_kernel_packages}}
diff --git a/linux-4.12.patch b/linux-4.12.patch
new file mode 100644
index 0000000..4b90c3f
--- /dev/null
+++ b/linux-4.12.patch
@@ -0,0 +1,45 @@
+--- kernel/nv-vtophys.c	2016-12-09 20:30:08.000000000 +0100
++++ kernel/nv-vtophys.c	2017-05-10 10:05:28.452722808 +0200
+@@ -25,6 +25,9 @@ NvU64 nv_get_phys_address(
+ #else
+     struct mm_struct *mm;
+     pgd_t *pgd = NULL;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
++    p4d_t *p4d = NULL;
++#endif
+     pmd_t *pmd = NULL;
+     pte_t *pte = NULL;
+     NvU64 retval;
+@@ -41,7 +42,11 @@ NvU64 nv_get_phys_address(
+     if (!NV_PGD_PRESENT(pgd))
+         goto failed;
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
++    pmd = NV_PMD_OFFSET(address, p4d);
++#else
+     pmd = NV_PMD_OFFSET(address, pgd);
++#endif
+     if (!NV_PMD_PRESENT(pmd))
+         goto failed;
+ 
+--- kernel/nv-linux.h	2017-05-10 09:19:05.820789291 +0200
++++ kernel/nv-linux.h	2017-05-10 10:05:57.656844602 +0200
+@@ -1389,11 +1389,16 @@ typedef void irqreturn_t;
+ #define NV_PMD_UNMAP(pmd) pmd_unmap(pmd);
+ #else
+ #if defined(PUD_SHIFT) /* 4-level pgtable */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
++#define _PGD_P4D p4d
++#else
++#define _PGD_P4D pgd
++#endif
+-#define NV_PMD_OFFSET(address, pgd)                     \
++#define NV_PMD_OFFSET(address, _PGD_P4D)                \
+    ({                                                   \
+         pmd_t *__pmd = NULL;                            \
+         pud_t *__pud;                                   \
+-        __pud = pud_offset(pgd, address);               \
++        __pud = pud_offset(_PGD_P4D, address);          \
+         if ((__pud != NULL) &&                          \
+             !(pud_bad(*__pud) || pud_none(*__pud)))     \
+             __pmd = pmd_offset(__pud, address);         \
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/xorg-driver-video-nvidia-legacy-304xx.git/commitdiff/105dfaf5c45aa05445bd7f5d2a0aa0d966ce93e4



More information about the pld-cvs-commit mailing list