1 --- NVIDIA-Linux-x86_64-340.107-no-compat32/kernel/nv-drm.c~ 2018-05-25 06:16:20.000000000 +0200
2 +++ NVIDIA-Linux-x86_64-340.107-no-compat32/kernel/nv-drm.c 2019-03-10 19:24:36.332454128 +0100
7 +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)
8 drm_gem_object_unreference_unlocked(&nv_obj->base);
10 + drm_gem_object_put_unlocked(&nv_obj->base);
15 --- NVIDIA-Linux-x86_64-340.107-no-compat32/kernel/os-interface.c~ 2018-05-25 06:16:20.000000000 +0200
16 +++ NVIDIA-Linux-x86_64-340.107-no-compat32/kernel/os-interface.c 2019-03-10 19:27:08.183087615 +0100
19 #include "os-interface.h"
21 +#include <linux/ktime.h>
23 RM_STATUS NV_API_CALL os_disable_console_access(void)
26 * Name: osGetCurrentTime
28 *****************************************************************************/
29 +static inline void nv_gettimeofday(struct timeval *tv)
31 +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)
32 + do_gettimeofday(tv);
34 + struct timespec64 now;
36 + ktime_get_real_ts64(&now);
38 + *tv = (struct timeval) {
39 + .tv_sec = now.tv_sec,
40 + .tv_usec = now.tv_nsec/1000,
45 RM_STATUS NV_API_CALL os_get_current_time(
51 - do_gettimeofday(&tm);
52 + nv_gettimeofday(&tm);
55 *useconds = tm.tv_usec;
57 #ifdef NV_CHECK_DELAY_ACCURACY
58 struct timeval tm1, tm2;
60 - do_gettimeofday(&tm1);
61 + nv_gettimeofday(&tm1);
64 if (in_irq() && (MicroSeconds > NV_MAX_ISR_DELAY_US))
68 #ifdef NV_CHECK_DELAY_ACCURACY
69 - do_gettimeofday(&tm2);
70 + nv_gettimeofday(&tm2);
71 nv_printf(NV_DBG_ERRORS, "NVRM: osDelayUs %d: 0x%x 0x%x\n",
72 MicroSeconds, tm2.tv_sec - tm1.tv_sec, tm2.tv_usec - tm1.tv_usec);
75 struct timeval tm_start;
78 - do_gettimeofday(&tm_aux);
79 + nv_gettimeofday(&tm_aux);
80 #ifdef NV_CHECK_DELAY_ACCURACY
86 schedule_timeout(jiffies);
87 - do_gettimeofday(&tm_aux);
88 + nv_gettimeofday(&tm_aux);
89 if (NV_TIMERCMP(&tm_aux, &tm_end, <))
91 NV_TIMERSUB(&tm_end, &tm_aux, &tm_aux);
95 #ifdef NV_CHECK_DELAY_ACCURACY
96 - do_gettimeofday(&tm_aux);
97 + nv_gettimeofday(&tm_aux);
98 timersub(&tm_aux, &tm_start, &tm_aux);
99 nv_printf(NV_DBG_ERRORS, "NVRM: osDelay %dmsec: %d.%06dsec\n",
100 MilliSeconds, tm_aux.tv_sec, tm_aux.tv_usec);