commit 798a475680b4e7f717ffa0cacdfc7f6d44bfc6f1
Author: leigh123linux <leigh123linux(a)googlemail.com>
Date: Mon Jan 16 20:19:45 2017 +0000
patch to fix loading module on 4.9 kernel
4.9.0_kernel.patch | 14 ++++++++++++++
nvidia-304xx-kmod.spec | 7 ++++++-
2 files changed, 20 insertions(+), 1 deletion(-)
---
diff --git a/4.9.0_kernel.patch b/4.9.0_kernel.patch
new file mode 100644
index 0000000..fd8081f
--- /dev/null
+++ b/4.9.0_kernel.patch
@@ -0,0 +1,14 @@
+--- a/kernel/nv-drm.c 2016-12-15 12:41:26.000000000 +0100
++++ b/kernel/nv-drm.c 2016-12-15 12:58:48.000000000 +0100
+@@ -71,7 +71,11 @@ static const struct file_operations nv_d
+ };
+
+ static struct drm_driver nv_drm_driver = {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
++ .driver_features = DRIVER_LEGACY,
++#else
+ .driver_features = 0,
++#endif
+ .load = nv_drm_load,
+ .unload = nv_drm_unload,
+ .fops = &nv_drm_fops,
diff --git a/nvidia-304xx-kmod.spec b/nvidia-304xx-kmod.spec
index 3696b57..30325d4 100644
--- a/nvidia-304xx-kmod.spec
+++ b/nvidia-304xx-kmod.spec
@@ -9,7 +9,7 @@
Name: nvidia-304xx-kmod
Version: 304.134
# 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
@@ -22,6 +22,7 @@ Source0: nvidia-kmod-data-%{version}.tar.xz
Source11: nvidia-304xx-kmodtool-excludekernel-filterfile
#
https://anonscm.debian.org/viewvc/pkg-nvidia/packages/nvidia-graphics-dri...
Patch0: disable-mtrr.patch
+Patch1: 4.9.0_kernel.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -49,6 +50,7 @@ for arch in x86 x64
do
pushd nvidiapkg-${arch}
%patch0 -p0
+%patch1 -p1
popd
done
@@ -82,6 +84,9 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Mon Jan 16 2017 Leigh Scott <leigh123linux(a)googlemail.com> - 304.134-2
+- patch to fix loading module on 4.9 kernel
+
* Wed Dec 14 2016 leigh scott <leigh123linux(a)googlemail.com> - 304.134-1
- Update to 304.134