]> git.pld-linux.org Git - packages/xorg-driver-video-nvidia.git/blob - linux-3.13.patch
477ac1369e0a37c45f11d6cf30592bf64127d900
[packages/xorg-driver-video-nvidia.git] / linux-3.13.patch
1 diff -rupN NVIDIA-Linux-x86_64-331.38.orig/kernel/nv-acpi.c NVIDIA-Linux-x86_64-331.38/kernel/nv-acpi.c
2 --- NVIDIA-Linux-x86_64-331.38.orig/kernel/nv-acpi.c    2014-01-25 09:39:47.126966926 +0100
3 +++ NVIDIA-Linux-x86_64-331.38/kernel/nv-acpi.c 2014-01-26 09:59:45.853427603 +0100
4 @@ -303,7 +303,10 @@ static int nv_acpi_remove(struct acpi_de
5  
6      if (pNvAcpiObject->notify_handler_installed)
7      {
8 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
9 + /* beginning with 3.13, acpi_remove_notify_handler() waits for events to finish */
10          NV_ACPI_OS_WAIT_EVENTS_COMPLETE();
11 +#endif
12  
13          // remove event notifier
14          status = acpi_remove_notify_handler(device->handle, ACPI_DEVICE_NOTIFY, nv_acpi_event);
15 @@ -1076,10 +1079,17 @@ RM_STATUS NV_API_CALL nv_acpi_dsm_method
16      NvU8 argument3[4]; /* For all DSM sub functions, input size is 4 */
17      NvU32 data_size;
18      acpi_handle dev_handle  = NULL;
19 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
20  #ifdef DEVICE_ACPI_HANDLE
21      nv_linux_state_t *nvl = NV_GET_NVL_FROM_NV_STATE(nv); 
22      dev_handle = DEVICE_ACPI_HANDLE(&nvl->dev->dev);
23  #endif
24 +#else
25 +#ifdef ACPI_HANDLE
26 +    nv_linux_state_t *nvl = NV_GET_NVL_FROM_NV_STATE(nv); 
27 +    dev_handle = ACPI_HANDLE(&nvl->dev->dev);
28 +#endif
29 +#endif
30  
31      if (!dev_handle)
32          return RM_ERR_NOT_SUPPORTED;
33 @@ -1179,12 +1189,21 @@ RM_STATUS NV_API_CALL nv_acpi_ddc_method
34      NvU32 i;
35      acpi_handle dev_handle  = NULL;
36      acpi_handle lcd_dev_handle  = NULL;
37 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
38  #ifdef DEVICE_ACPI_HANDLE
39      nv_linux_state_t *nvl = NV_GET_NVL_FROM_NV_STATE(nv); 
40      dev_handle = DEVICE_ACPI_HANDLE(&nvl->dev->dev);
41  #else
42          return RM_ERR_NOT_SUPPORTED;
43  #endif
44 +#else
45 +#ifdef ACPI_HANDLE
46 +    nv_linux_state_t *nvl = NV_GET_NVL_FROM_NV_STATE(nv); 
47 +    dev_handle = ACPI_HANDLE(&nvl->dev->dev);
48 +#else
49 +        return RM_ERR_NOT_SUPPORTED;
50 +#endif
51 +#endif
52      if (!dev_handle)
53          return RM_ERR_INVALID_ARGUMENT;
54  
55 @@ -1294,12 +1313,21 @@ RM_STATUS NV_API_CALL nv_acpi_rom_method
56      struct acpi_object_list input = { 2, rom_arg };
57      acpi_handle dev_handle  = NULL;
58      uint32_t offset, length;
59 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
60  #ifdef DEVICE_ACPI_HANDLE
61      nv_linux_state_t *nvl = NV_GET_NVL_FROM_NV_STATE(nv); 
62 -    dev_handle = DEVICE_ACPI_HANDLE(&nvl->dev->dev);
63 +    dev_handle = ACPI_DEVICE_HANDLE(&nvl->dev->dev);
64  #else
65      return RM_ERR_NOT_SUPPORTED;
66  #endif
67 +#else
68 +#ifdef ACPI_HANDLE
69 +    nv_linux_state_t *nvl = NV_GET_NVL_FROM_NV_STATE(nv); 
70 +    dev_handle = ACPI_HANDLE(&nvl->dev->dev);
71 +#else
72 +    return RM_ERR_NOT_SUPPORTED;
73 +#endif
74 +#endif
75  
76      if (!dev_handle)
77          return RM_ERR_INVALID_ARGUMENT;
78 @@ -1364,12 +1392,21 @@ RM_STATUS NV_API_CALL nv_acpi_dod_method
79      union acpi_object *dod;
80      acpi_handle dev_handle = NULL;
81      NvU32 i, count = (*pSize / sizeof(NvU32));
82 +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
83  #ifdef DEVICE_ACPI_HANDLE
84      nv_linux_state_t *nvl = NV_GET_NVL_FROM_NV_STATE(nv);
85      dev_handle = DEVICE_ACPI_HANDLE(&nvl->dev->dev);
86  #else
87      return RM_ERR_NOT_SUPPORTED;
88  #endif
89 +#else
90 +#ifdef ACPI_HANDLE
91 +    nv_linux_state_t *nvl = NV_GET_NVL_FROM_NV_STATE(nv);
92 +    dev_handle = ACPI_HANDLE(&nvl->dev->dev);
93 +#else
94 +    return RM_ERR_NOT_SUPPORTED;
95 +#endif
96 +#endif
97  
98      if (!dev_handle)
99          return RM_ERR_INVALID_ARGUMENT;
100 diff -rupN NVIDIA-Linux-x86_64-331.38.orig/kernel/uvm/nvidia_uvm_linux.h NVIDIA-Linux-x86_64-331.38/kernel/uvm/nvidia_uvm_linux.h
101 --- NVIDIA-Linux-x86_64-331.38.orig/kernel/uvm/nvidia_uvm_linux.h       2014-01-25 09:39:47.172966925 +0100
102 +++ NVIDIA-Linux-x86_64-331.38/kernel/uvm/nvidia_uvm_linux.h    2014-01-25 09:46:40.572999245 +0100
103 @@ -405,11 +405,17 @@ typedef void irqreturn_t;
104  // not require the RCU's read lock on current->cred.
105  //
106  //
107 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)
108 +#define NV_KUID_TO_UID(value) (__kuid_val(value))
109 +#else
110 +#define NV_KUID_TO_UID(value) (value)
111 +#endif
112 +
113  #if defined(NV_TASK_STRUCT_HAS_CRED)
114  #define NV_CURRENT_EUID() \
115 -    (((typeof(*current->cred) __force __kernel *)current->cred)->euid)
116 +        NV_KUID_TO_UID(((typeof(*current->cred) __force __kernel *)current->cred)->euid)
117  #else
118 -#define NV_CURRENT_EUID() (current->euid)
119 +#define NV_CURRENT_EUID() NV_KUID_TO_UID(current->euid)
120  #endif
121  
122  #define NV_ATOMIC_SET(data,val)         atomic_set(&(data), (val))
This page took 0.024314 seconds and 2 git commands to generate.