[nvidia-kmod] patch for 4.7rc kernel

Leigh Scott leigh123linux at rpmfusion.org
Fri Jul 8 15:02:30 CEST 2016


commit bba03e6f43e104e2cc9c9aca1d30ee6b99646dcb
Author: leigh123linux <leigh123linux at googlemail.com>
Date:   Fri Jul 8 14:02:25 2016 +0100

    patch for 4.7rc kernel

 nvidia-4.7_kernel.patch | 61 +++++++++++++++++++++++++++++++++++++++++++++++++
 nvidia-kmod.spec        |  7 +++++-
 2 files changed, 67 insertions(+), 1 deletion(-)
---
diff --git a/nvidia-4.7_kernel.patch b/nvidia-4.7_kernel.patch
new file mode 100644
index 0000000..11a53da
--- /dev/null
+++ b/nvidia-4.7_kernel.patch
@@ -0,0 +1,61 @@
+--- a/kernel/nvidia-uvm/uvm_linux.h
++++ b/kernel/nvidia-uvm/uvm_linux.h
+@@ -563,7 +563,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;
+
+--- a/kernel/nvidia-drm/nvidia-drm-fb.c
++++ b/kernel/nvidia-drm/nvidia-drm-fb.c
+@@ -24,6 +24,7 @@
+ 
+ #if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
+ 
++#include <linux/version.h>
+ #include "nvidia-drm-priv.h"
+ #include "nvidia-drm-ioctl.h"
+ #include "nvidia-drm-fb.h"
+@@ -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"
+@@ -408,7 +409,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)
+     {
+
diff --git a/nvidia-kmod.spec b/nvidia-kmod.spec
index a566629..c8858e5 100644
--- a/nvidia-kmod.spec
+++ b/nvidia-kmod.spec
@@ -9,7 +9,7 @@ Name:          nvidia-kmod
 Epoch:         1
 Version:       367.27
 # Taken over by kmodtool
-Release:       1%{?dist}
+Release:       2%{?dist}
 Summary:       NVIDIA display driver kernel module
 Group:         System Environment/Kernel
 License:       Redistributable, no modification permitted
@@ -18,6 +18,7 @@ URL:           http://www.nvidia.com/
 Source11:      nvidia-kmodtool-excludekernel-filterfile
 Patch0:        nv-linux-arm.patch
 Patch1:        nv-linux-arm2.patch
+Patch2:        nvidia-4.7_kernel.patch
 
 BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
@@ -45,6 +46,7 @@ tar --use-compress-program xz -xf %{_datadir}/%{name}-%{version}/%{name}-%{versi
 # patch loop
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 
 for kernel_version  in %{?kernel_versions} ; do
@@ -77,6 +79,9 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Fri Jul 08 2016 Leigh Scott <leigh123linux at googlemail.com> - 1:367.27-2
+- patch for 4.7rc kernel
+
 * Fri Jul 01 2016 Leigh Scott <leigh123linux at googlemail.com> - 1:367.27-1
 - Update to 367.27
 


More information about the rpmfusion-commits mailing list