commit f932998da85b26041f891c30cd3f3e961a4374f8
Author: leigh123linux <leigh123linux(a)googlemail.com>
Date: Sat Dec 17 10:05:02 2016 +0000
patch to fix loading module on 4.9 kernel
4.9.0_kernel.patch | 14 ++++++++++++++
nvidia-340xx-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..dc80b97
--- /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
+@@ -115,7 +115,11 @@
+ };
+
+ static struct drm_driver nv_drm_driver = {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
++ .driver_features = DRIVER_GEM | DRIVER_PRIME | DRIVER_LEGACY,
++#else
+ .driver_features = DRIVER_GEM | DRIVER_PRIME,
++#endif
+ .load = nv_drm_load,
+ .unload = nv_drm_unload,
+ .fops = &nv_drm_fops,
diff --git a/nvidia-340xx-kmod.spec b/nvidia-340xx-kmod.spec
index 978b901..3e462b4 100644
--- a/nvidia-340xx-kmod.spec
+++ b/nvidia-340xx-kmod.spec
@@ -10,7 +10,7 @@ Name: nvidia-340xx-kmod
Epoch: 1
Version: 340.101
# 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: 4.9.0_kernel.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -46,6 +47,7 @@ kmodtool --target %{_target_cpu} --repo rpmfusion --kmodname %{name}
--filterf
tar --use-compress-program xz -xf
%{_datadir}/%{name}-%{version}/%{name}-%{version}-%{_target_cpu}.tar.xz
# patch loop
%patch0 -p1
+%patch1 -p1
for kernel_version in %{?kernel_versions} ; do
cp -a kernel _kmod_build_${kernel_version%%___*}
@@ -93,6 +95,9 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Sat Dec 17 2016 leigh scott <leigh123linux(a)googlemail.com> - 1:340.101-2
+- patch to fix loading module on 4.9 kernel
+
* Wed Dec 14 2016 leigh scott <leigh123linux(a)googlemail.com> - 1:340.101-1
- Update to 340.101