]> git.pld-linux.org Git - packages/xorg-driver-video-nvidia-legacy-340xx.git/blob - kernel-5.0.patch
- fix building with kernel 5.0
[packages/xorg-driver-video-nvidia-legacy-340xx.git] / kernel-5.0.patch
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
3 @@ -252,7 +252,11 @@
4          goto done;
5      }
6  
7 +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)
8      drm_gem_object_unreference_unlocked(&nv_obj->base);
9 +#else
10 +    drm_gem_object_put_unlocked(&nv_obj->base);
11 +#endif
12  
13      status = RM_OK;
14  
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
17 @@ -13,6 +13,7 @@
18  
19  #include "os-interface.h"
20  #include "nv-linux.h"
21 +#include <linux/ktime.h>
22  
23  RM_STATUS NV_API_CALL os_disable_console_access(void)
24  {
25 @@ -433,6 +433,21 @@
26  *   Name: osGetCurrentTime
27  *
28  *****************************************************************************/
29 +static inline void nv_gettimeofday(struct timeval *tv)
30 +{
31 +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)
32 +    do_gettimeofday(tv);
33 +#else
34 +    struct timespec64 now;
35 +
36 +    ktime_get_real_ts64(&now);
37 +
38 +    *tv = (struct timeval) {
39 +        .tv_sec = now.tv_sec,
40 +        .tv_usec = now.tv_nsec/1000,
41 +    };
42 +#endif
43 +}
44  
45  RM_STATUS NV_API_CALL os_get_current_time(
46      NvU32 *seconds,
47 @@ -441,7 +456,7 @@
48  {
49      struct timeval tm;
50  
51 -    do_gettimeofday(&tm);
52 +    nv_gettimeofday(&tm);
53  
54      *seconds = tm.tv_sec;
55      *useconds = tm.tv_usec;
56 @@ -485,7 +491,7 @@
57  #ifdef NV_CHECK_DELAY_ACCURACY
58      struct timeval tm1, tm2;
59  
60 -    do_gettimeofday(&tm1);
61 +    nv_gettimeofday(&tm1);
62  #endif
63  
64      if (in_irq() && (MicroSeconds > NV_MAX_ISR_DELAY_US))
65 @@ -500,7 +506,7 @@
66          udelay(usec);
67  
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);
73  #endif
74 @@ -528,7 +534,7 @@
75      struct timeval tm_start;
76  #endif
77  
78 -    do_gettimeofday(&tm_aux);
79 +    nv_gettimeofday(&tm_aux);
80  #ifdef NV_CHECK_DELAY_ACCURACY
81      tm_start = tm_aux;
82  #endif
83 @@ -562,7 +568,7 @@
84          do
85          {
86              schedule_timeout(jiffies);
87 -            do_gettimeofday(&tm_aux);
88 +            nv_gettimeofday(&tm_aux);
89              if (NV_TIMERCMP(&tm_aux, &tm_end, <))
90              {
91                  NV_TIMERSUB(&tm_end, &tm_aux, &tm_aux);
92 @@ -584,7 +590,7 @@
93          udelay(MicroSeconds);
94      }
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);
This page took 0.037844 seconds and 3 git commands to generate.