]> git.pld-linux.org Git - packages/xorg-driver-video-nvidia-legacy-340xx.git/commitdiff
- fix building with kernel 5.0
authorJan Rękorajski <baggins@pld-linux.org>
Sun, 10 Mar 2019 18:37:34 +0000 (19:37 +0100)
committerJan Rękorajski <baggins@pld-linux.org>
Sun, 10 Mar 2019 18:37:34 +0000 (19:37 +0100)
kernel-5.0.patch [new file with mode: 0644]
xorg-driver-video-nvidia-legacy-340xx.spec

diff --git a/kernel-5.0.patch b/kernel-5.0.patch
new file mode 100644 (file)
index 0000000..bd31dbe
--- /dev/null
@@ -0,0 +1,100 @@
+--- NVIDIA-Linux-x86_64-340.107-no-compat32/kernel/nv-drm.c~   2018-05-25 06:16:20.000000000 +0200
++++ NVIDIA-Linux-x86_64-340.107-no-compat32/kernel/nv-drm.c    2019-03-10 19:24:36.332454128 +0100
+@@ -252,7 +252,11 @@
+         goto done;
+     }
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)
+     drm_gem_object_unreference_unlocked(&nv_obj->base);
++#else
++    drm_gem_object_put_unlocked(&nv_obj->base);
++#endif
+     status = RM_OK;
+--- NVIDIA-Linux-x86_64-340.107-no-compat32/kernel/os-interface.c~     2018-05-25 06:16:20.000000000 +0200
++++ NVIDIA-Linux-x86_64-340.107-no-compat32/kernel/os-interface.c      2019-03-10 19:27:08.183087615 +0100
+@@ -13,6 +13,7 @@
+ #include "os-interface.h"
+ #include "nv-linux.h"
++#include <linux/ktime.h>
+ RM_STATUS NV_API_CALL os_disable_console_access(void)
+ {
+@@ -433,6 +433,21 @@
+ *   Name: osGetCurrentTime
+ *
+ *****************************************************************************/
++static inline void nv_gettimeofday(struct timeval *tv)
++{
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)
++    do_gettimeofday(tv);
++#else
++    struct timespec64 now;
++
++    ktime_get_real_ts64(&now);
++
++    *tv = (struct timeval) {
++        .tv_sec = now.tv_sec,
++        .tv_usec = now.tv_nsec/1000,
++    };
++#endif
++}
+ RM_STATUS NV_API_CALL os_get_current_time(
+     NvU32 *seconds,
+@@ -441,7 +456,7 @@
+ {
+     struct timeval tm;
+-    do_gettimeofday(&tm);
++    nv_gettimeofday(&tm);
+     *seconds = tm.tv_sec;
+     *useconds = tm.tv_usec;
+@@ -485,7 +491,7 @@
+ #ifdef NV_CHECK_DELAY_ACCURACY
+     struct timeval tm1, tm2;
+-    do_gettimeofday(&tm1);
++    nv_gettimeofday(&tm1);
+ #endif
+     if (in_irq() && (MicroSeconds > NV_MAX_ISR_DELAY_US))
+@@ -500,7 +506,7 @@
+         udelay(usec);
+ #ifdef NV_CHECK_DELAY_ACCURACY
+-    do_gettimeofday(&tm2);
++    nv_gettimeofday(&tm2);
+     nv_printf(NV_DBG_ERRORS, "NVRM: osDelayUs %d: 0x%x 0x%x\n",
+         MicroSeconds, tm2.tv_sec - tm1.tv_sec, tm2.tv_usec - tm1.tv_usec);
+ #endif
+@@ -528,7 +534,7 @@
+     struct timeval tm_start;
+ #endif
+-    do_gettimeofday(&tm_aux);
++    nv_gettimeofday(&tm_aux);
+ #ifdef NV_CHECK_DELAY_ACCURACY
+     tm_start = tm_aux;
+ #endif
+@@ -562,7 +568,7 @@
+         do
+         {
+             schedule_timeout(jiffies);
+-            do_gettimeofday(&tm_aux);
++            nv_gettimeofday(&tm_aux);
+             if (NV_TIMERCMP(&tm_aux, &tm_end, <))
+             {
+                 NV_TIMERSUB(&tm_end, &tm_aux, &tm_aux);
+@@ -584,7 +590,7 @@
+         udelay(MicroSeconds);
+     }
+ #ifdef NV_CHECK_DELAY_ACCURACY
+-    do_gettimeofday(&tm_aux);
++    nv_gettimeofday(&tm_aux);
+     timersub(&tm_aux, &tm_start, &tm_aux);
+     nv_printf(NV_DBG_ERRORS, "NVRM: osDelay %dmsec: %d.%06dsec\n",
+         MilliSeconds, tm_aux.tv_sec, tm_aux.tv_usec);
index d46f5af017ab9ef7f7d3504c2c0af26e83622b0a..cea6d474e87acfe634eb41d9398846c5e03feeb8 100644 (file)
@@ -49,6 +49,7 @@ Patch0:               X11-driver-nvidia-GL.patch
 Patch1:                X11-driver-nvidia-desktop.patch
 Patch2:                linux-4.0.patch
 Patch3:                kernel-4.4.169.patch
+Patch4:                kernel-5.0.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}*
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
 echo 'EXTRA_CFLAGS += -Wno-pointer-arith -Wno-sign-compare -Wno-unused' >> kernel/Makefile.kbuild
 
 %build
This page took 0.112527 seconds and 4 git commands to generate.