[packages/xorg-driver-video-nvidia] kernel 4.7 compatibility patch

atler atler at pld-linux.org
Tue Aug 2 22:25:14 CEST 2016


commit f6380d29acc23b66aa1b5b4af2ce3d50c702c5b7
Author: Jan Palus <atler at pld-linux.org>
Date:   Tue Aug 2 22:24:27 2016 +0200

    kernel 4.7 compatibility patch
    
    - rel 2

 linux-4.7.patch               | 60 +++++++++++++++++++++++++++++++++++++++++++
 xorg-driver-video-nvidia.spec |  4 ++-
 2 files changed, 63 insertions(+), 1 deletion(-)
---
diff --git a/xorg-driver-video-nvidia.spec b/xorg-driver-video-nvidia.spec
index e64ddf5..f6f6de2 100644
--- a/xorg-driver-video-nvidia.spec
+++ b/xorg-driver-video-nvidia.spec
@@ -25,7 +25,7 @@ exit 1
 
 %define		no_install_post_check_so 1
 
-%define		rel	1
+%define		rel	2
 %define		pname	xorg-driver-video-nvidia
 Summary:	Linux Drivers for nVidia GeForce/Quadro Chips
 Summary(hu.UTF-8):	Linux meghajtók nVidia GeForce/Quadro chipekhez
@@ -47,6 +47,7 @@ Source4:	10-nvidia.conf
 Source5:	10-nvidia-modules.conf
 Patch0:		X11-driver-nvidia-GL.patch
 Patch1:		X11-driver-nvidia-desktop.patch
+Patch2:		linux-4.7.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}}
@@ -251,6 +252,7 @@ rm -rf NVIDIA-Linux-x86*-%{version}*
 %endif
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 echo 'EXTRA_CFLAGS += -Wno-pointer-arith -Wno-sign-compare -Wno-unused' >> kernel/Makefile.kbuild
 
 %build
diff --git a/linux-4.7.patch b/linux-4.7.patch
new file mode 100644
index 0000000..0dc12c8
--- /dev/null
+++ b/linux-4.7.patch
@@ -0,0 +1,60 @@
+--- a/kernel/nvidia-drm/nvidia-drm-fb.c
++++ b/kernel/nvidia-drm/nvidia-drm-fb.c
+@@ -20,6 +20,7 @@
+  * DEALINGS IN THE SOFTWARE.
+  */
+ 
++#include <linux/version.h>
+ #include "conftest.h" /* NV_DRM_ATOMIC_MODESET_AVAILABLE */
+ 
+ #if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
+@@ -114,7 +115,11 @@
+      * We don't support any planar format, pick up first buffer only.
+      */
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
++    gem = drm_gem_object_lookup(file, cmd->handles[0]);
++#else
+     gem = drm_gem_object_lookup(dev, file, cmd->handles[0]);
++#endif
+ 
+     if (gem == NULL)
+     {
+--- a/kernel/nvidia-drm/nvidia-drm-gem.c
++++ b/kernel/nvidia-drm/nvidia-drm-gem.c
+@@ -24,6 +24,7 @@
+ 
+ #if defined(NV_DRM_AVAILABLE)
+ 
++#include <linux/version.h>
+ #include "nvidia-drm-priv.h"
+ #include "nvidia-drm-ioctl.h"
+ #include "nvidia-drm-gem.h"
+@@ -405,7 +406,11 @@
+ 
+     mutex_lock(&dev->struct_mutex);
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
++    gem = drm_gem_object_lookup(file, handle);
++#else
+     gem = drm_gem_object_lookup(dev, file, handle);
++#endif
+ 
+     if (gem == NULL)
+     {
+
+--- a/kernel/nvidia-uvm/uvm_linux.h
++++ b/kernel/nvidia-uvm/uvm_linux.h
+@@ -547,7 +547,11 @@
+     INIT_RADIX_TREE(tree, GFP_NOWAIT);
+ }
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
++static bool radix_tree_is_empty(struct radix_tree_root *tree)
++#else
+ static bool radix_tree_empty(struct radix_tree_root *tree)
++#endif
+ {
+     void *dummy;
+     return radix_tree_gang_lookup(tree, &dummy, 0, 1) == 0;
+
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/xorg-driver-video-nvidia.git/commitdiff/f6380d29acc23b66aa1b5b4af2ce3d50c702c5b7



More information about the pld-cvs-commit mailing list