[packages/xorg-driver-video-nvidia-legacy-304xx] - fix building with linux 4.6 - rel 3

baggins baggins at pld-linux.org
Sun Jun 19 18:38:17 CEST 2016


commit 4bf93903d149c7534be3128c0ac62b047a4b179c
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sun Jun 19 18:38:04 2016 +0200

    - fix building with linux 4.6
    - rel 3

 linux-4.6.patch                            | 50 ++++++++++++++++++++++++++++++
 xorg-driver-video-nvidia-legacy-304xx.spec |  6 ++--
 2 files changed, 54 insertions(+), 2 deletions(-)
---
diff --git a/xorg-driver-video-nvidia-legacy-304xx.spec b/xorg-driver-video-nvidia-legacy-304xx.spec
index 0c3f46d..bf0304a 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	2
+%define		rel	3
 %define		mname	nvidia-legacy-304xx
 %define		pname	xorg-driver-video-%{mname}
 Summary:	Linux Drivers for nVidia GeForce/Quadro Chips
@@ -47,7 +47,8 @@ Source4:	10-nvidia.conf
 Source5:	10-nvidia-modules.conf
 Patch0:		X11-driver-nvidia-GL.patch
 Patch1:		X11-driver-nvidia-desktop.patch
-Patch3:		linux-4.0.patch
+Patch2:		linux-4.0.patch
+Patch3:		linux-4.6.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}}
@@ -247,6 +248,7 @@ rm -rf NVIDIA-Linux-x86*-%{version}*
 %endif
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 %patch3 -p1
 
 %build
diff --git a/linux-4.6.patch b/linux-4.6.patch
new file mode 100644
index 0000000..632fa22
--- /dev/null
+++ b/linux-4.6.patch
@@ -0,0 +1,50 @@
+--- NVIDIA-Linux-x86_64-304.131-no-compat32/kernel/nv-mlock.c~	2015-11-09 06:43:39.000000000 +0100
++++ NVIDIA-Linux-x86_64-304.131-no-compat32/kernel/nv-mlock.c	2016-06-19 18:34:23.039063568 +0200
+@@ -49,7 +49,11 @@
+     }
+ 
+     down_read(&mm->mmap_sem);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0))
++    ret = get_user_pages((unsigned long)address,
++#else
+     ret = get_user_pages(current, mm, (unsigned long)address,
++#endif
+             page_count, write, force, user_pages, NULL);
+     up_read(&mm->mmap_sem);
+     pinned = ret;
+@@ -62,7 +66,11 @@
+     else if (pinned < page_count)
+     {
+         for (i = 0; i < pinned; i++)
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0))
++            put_page(user_pages[i]);
++#else
+             page_cache_release(user_pages[i]);
++#endif
+         os_free_mem(user_pages);
+         return RM_ERR_INVALID_ADDRESS;
+     }
+@@ -88,7 +88,11 @@
+             {
+                 pci_unmap_page(dev, pte_array[j],
+                         PAGE_SIZE, PCI_DMA_BIDIRECTIONAL);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0))
++                put_page(user_pages[j]);
++#else
+                 page_cache_release(user_pages[j]);
++#endif
+             }
+             os_free_mem(user_pages);
+             return RM_ERR_OPERATING_SYSTEM;
+@@ -122,7 +126,11 @@
+                 PAGE_SIZE, PCI_DMA_BIDIRECTIONAL);
+         if (write)
+             set_page_dirty_lock(user_pages[i]);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0))
++        put_page(user_pages[i]);
++#else
+         page_cache_release(user_pages[i]);
++#endif
+     }
+ 
+     os_free_mem(user_pages);
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list