[packages/xorg-driver-video-nvidia-legacy-304xx] - build fix for kernel 4.15 from Debian - rel 3
baggins
baggins at pld-linux.org
Tue Jan 30 01:38:44 CET 2018
commit 106a8a79b9c203a6a73de3d813c63957b95eb99a
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Tue Jan 30 01:38:24 2018 +0100
- build fix for kernel 4.15 from Debian
- rel 3
kernel-4.15.patch | 60 ++++++++++++++++++++++++++++++
xorg-driver-video-nvidia-legacy-304xx.spec | 4 +-
2 files changed, 63 insertions(+), 1 deletion(-)
---
diff --git a/xorg-driver-video-nvidia-legacy-304xx.spec b/xorg-driver-video-nvidia-legacy-304xx.spec
index b3bbee1..90f379e 100644
--- a/xorg-driver-video-nvidia-legacy-304xx.spec
+++ b/xorg-driver-video-nvidia-legacy-304xx.spec
@@ -25,7 +25,7 @@ exit 1
%define no_install_post_check_so 1
-%define rel 2
+%define rel 3
%define mname nvidia-legacy-304xx
%define pname xorg-driver-video-%{mname}
Summary: Linux Drivers for nVidia GeForce/Quadro Chips
@@ -50,6 +50,7 @@ Patch1: X11-driver-nvidia-desktop.patch
Patch2: linux-4.0.patch
Patch3: linux-4.12.patch
Patch4: kernel-4.14.patch
+Patch5: kernel-4.15.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}}
@@ -252,6 +253,7 @@ rm -rf NVIDIA-Linux-x86*-%{version}*
%patch2 -p1
%patch3 -p0
%patch4 -p1
+%patch5 -p1
%build
%{?with_kernel:%{expand:%build_kernel_packages}}
diff --git a/kernel-4.15.patch b/kernel-4.15.patch
new file mode 100644
index 0000000..e195bed
--- /dev/null
+++ b/kernel-4.15.patch
@@ -0,0 +1,60 @@
+Author: Luca Boccassi <bluca at debian.org>
+Description: Fix timer API calls for kernel >= 4.15
+ From kernel 4.15 and newer (commit 7eeb6b893bd28c) the init_timer APIs have
+ been retired and replaced by new timer_list APIs.
+--- a/kernel/nv.c
++++ b/kernel/nv.c
+@@ -17,6 +17,8 @@
+ #include "rmil.h"
+ #include "nv-pat.h"
+
++#include <linux/version.h>
++
+ #if defined(MODULE_LICENSE)
+ MODULE_LICENSE("NVIDIA");
+ #endif
+@@ -301,7 +303,11 @@
+ #else
+ irqreturn_t nv_kern_isr(int, void *);
+ #endif
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+ void nv_kern_rc_timer(unsigned long);
++#else
++void nv_kern_rc_timer(struct timer_list *);
++#endif
+ #if defined(NV_PM_SUPPORT_OLD_STYLE_APM)
+ static int nv_kern_apm_event(struct pm_dev *, pm_request_t, void *);
+ #endif
+@@ -2075,10 +2081,18 @@
+ }
+
+ void nv_kern_rc_timer(
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+ unsigned long data
++#else
++ struct timer_list *t_list
++#endif
+ )
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+ nv_linux_state_t *nvl = (nv_linux_state_t *) data;
++#else
++ nv_linux_state_t *nvl = from_timer(nvl, t_list, rc_timer);
++#endif
+ nv_state_t *nv = NV_STATE_PTR(nvl);
+
+ NV_CHECK_PCI_CONFIG_SPACE(nvl->timer_sp, nv, TRUE, TRUE, FALSE);
+@@ -3029,9 +3043,13 @@
+ return -1;
+
+ nv_printf(NV_DBG_INFO, "NVRM: initializing rc timer\n");
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+ init_timer(&nvl->rc_timer);
+ nvl->rc_timer.function = nv_kern_rc_timer;
+ nvl->rc_timer.data = (unsigned long) nv;
++#else
++ timer_setup(&nvl->rc_timer, nv_kern_rc_timer, 0);
++#endif
+ nv->rc_timer_enabled = 1;
+ mod_timer(&nvl->rc_timer, jiffies + HZ); /* set our timeout for 1 second */
+ nv_printf(NV_DBG_INFO, "NVRM: rc timer initialized\n");
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/xorg-driver-video-nvidia-legacy-304xx.git/commitdiff/106a8a79b9c203a6a73de3d813c63957b95eb99a
More information about the pld-cvs-commit
mailing list