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

baggins baggins at pld-linux.org
Sun Jun 19 18:41:58 CEST 2016


commit 8a959aa545b54c90f38582e1b76a97ce0980bc26
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sun Jun 19 18:41:46 2016 +0200

    - fixed building with linux 4.6
    - rel 3

 linux-4.6.patch                            | 38 ++++++++++++++++++++++++++++++
 xorg-driver-video-nvidia-legacy-340xx.spec |  4 +++-
 2 files changed, 41 insertions(+), 1 deletion(-)
---
diff --git a/xorg-driver-video-nvidia-legacy-340xx.spec b/xorg-driver-video-nvidia-legacy-340xx.spec
index c14bb07..4e383fe 100644
--- a/xorg-driver-video-nvidia-legacy-340xx.spec
+++ b/xorg-driver-video-nvidia-legacy-340xx.spec
@@ -25,7 +25,7 @@ exit 1
 
 %define		no_install_post_check_so 1
 
-%define		rel	2
+%define		rel	3
 %define		pname	xorg-driver-video-nvidia-legacy-340xx
 Summary:	Linux Drivers for nVidia GeForce/Quadro Chips
 Summary(hu.UTF-8):	Linux meghajtók nVidia GeForce/Quadro chipekhez
@@ -48,6 +48,7 @@ Source5:	10-nvidia-modules.conf
 Patch0:		X11-driver-nvidia-GL.patch
 Patch1:		X11-driver-nvidia-desktop.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}}
@@ -250,6 +251,7 @@ rm -rf NVIDIA-Linux-x86*-%{version}*
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
 echo 'EXTRA_CFLAGS += -Wno-pointer-arith -Wno-sign-compare -Wno-unused' >> kernel/Makefile.kbuild
 
 %build
diff --git a/linux-4.6.patch b/linux-4.6.patch
new file mode 100644
index 0000000..365dd1a
--- /dev/null
+++ b/linux-4.6.patch
@@ -0,0 +1,38 @@
+--- NVIDIA-Linux-x86_64-340.96-no-compat32/kernel/os-mlock.c~	2015-11-09 06:44:53.000000000 +0100
++++ NVIDIA-Linux-x86_64-340.96-no-compat32/kernel/os-mlock.c	2016-06-19 18:41:01.530699309 +0200
+@@ -45,7 +45,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;
+@@ -58,7 +62,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;
+     }
+@@ -85,7 +93,11 @@
+     {
+         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-340xx.git/commitdiff/8a959aa545b54c90f38582e1b76a97ce0980bc26



More information about the pld-cvs-commit mailing list