[nvidia-kmod] patch for 4.8rc kernel

Leigh Scott leigh123linux at rpmfusion.org
Wed Aug 10 09:39:44 CEST 2016


commit 7ce154e2cf5123e0d669337ceaa975935f7cf28b
Author: leigh123linux <leigh123linux at googlemail.com>
Date:   Wed Aug 10 08:39:37 2016 +0100

    patch for 4.8rc kernel

 nvidia-4.8_kernel.patch | 81 +++++++++++++++++++++++++++++++++++++++++++++++++
 nvidia-kmod.spec        |  8 +++--
 2 files changed, 87 insertions(+), 2 deletions(-)
---
diff --git a/nvidia-4.8_kernel.patch b/nvidia-4.8_kernel.patch
new file mode 100644
index 0000000..7abf2d1
--- /dev/null
+++ b/nvidia-4.8_kernel.patch
@@ -0,0 +1,81 @@
+--- a/kernel/nvidia-drm/nvidia-drm-drv.c
++++ b/kernel/nvidia-drm/nvidia-drm-drv.c
+@@ -22,6 +22,7 @@
+ 
+ #include "conftest.h" /* NV_DRM_AVAILABLE and NV_DRM_DRM_GEM_H_PRESENT */
+ 
++#include <linux/version.h>
+ #include "nvidia-drm-priv.h"
+ #include "nvidia-drm-drv.h"
+ #include "nvidia-drm-fb.h"
+@@ -36,7 +37,9 @@
+ #include "nvidia-drm-ioctl.h"
+ 
+ #include <drm/drmP.h>
+-
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++#include <drm/drm_auth.h>
++#endif
+ #include <drm/drm_crtc_helper.h>
+ 
+ #if defined(NV_DRM_DRM_GEM_H_PRESENT)
+@@ -419,7 +422,11 @@
+ 
+ static
+ void nvidia_drm_master_drop(struct drm_device *dev,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++                            struct drm_file *file_priv)
++#else
+                             struct drm_file *file_priv, bool from_release)
++#endif
+ {
+     struct nvidia_drm_device *nv_dev = dev->dev_private;
+     int ret;
+@@ -452,7 +459,11 @@
+     mutex_lock(&dev->master_mutex);
+ 
+     if (!file_priv->is_master ||
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++        !file_priv->master)
++#else
+         !file_priv->minor->master)
++#endif
+     {
+         goto done;
+     }
+@@ -473,7 +484,11 @@
+      * NVKMS modeset ownership, because nvidia_drm_master_set()'s call to
+      * grabOwnership() will fail.
+      */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++    drm_master_put(&file_priv->master);
++#else
+     drm_master_put(&file_priv->minor->master);
++#endif
+     file_priv->is_master = 0;
+ 
+     ret = 0;
+
+--- a/kernel/nvidia-drm/nvidia-drm-modeset.c
++++ b/kernel/nvidia-drm/nvidia-drm-modeset.c
+@@ -24,6 +24,7 @@
+ 
+ #if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
+ 
++#include <linux/version.h>
+ #include "nvidia-drm-priv.h"
+ #include "nvidia-drm-modeset.h"
+ #include "nvidia-drm-crtc.h"
+@@ -675,7 +676,11 @@
+         goto failed;
+     }
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
++    drm_atomic_helper_swap_state(state, true);
++#else
+     drm_atomic_helper_swap_state(dev, state);
++#endif
+ 
+     nvidia_drm_update_head_mode_config(state, requested_config);
+ 
+
diff --git a/nvidia-kmod.spec b/nvidia-kmod.spec
index f1fa5bd..7f1aa44 100644
--- a/nvidia-kmod.spec
+++ b/nvidia-kmod.spec
@@ -10,7 +10,7 @@ Name:          nvidia-kmod
 Epoch:         1
 Version:       367.35
 # 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
@@ -21,6 +21,7 @@ Patch0:        nv-linux-arm.patch
 Patch1:        nv-linux-arm2.patch
 Patch2:        nvidia-4.7_kernel-pt1.patch
 Patch3:        nvidia-4.7_kernel_pt2.patch
+Patch4:        nvidia-4.8_kernel.patch
 
 BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
@@ -52,7 +53,7 @@ tar --use-compress-program xz -xf %{_datadir}/%{name}-%{version}/%{name}-%{versi
 %patch2 -p1
 %endif
 %patch3 -p1
-
+%patch4 -p1
 
 for kernel_version  in %{?kernel_versions} ; do
     cp -a kernel _kmod_build_${kernel_version%%___*}
@@ -84,6 +85,9 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Wed Aug 10 2016 leigh scott <leigh123linux at googlemail.com> - 1:367.35-2
+- patch for 4.8rc kernel
+
 * Sun Jul 17 2016 Leigh Scott <leigh123linux at googlemail.com> - 1:367.35-1
 - Update to 367.35
 


More information about the rpmfusion-commits mailing list