- rel 3
[packages/xorg-driver-video-nvidia.git] / kernel-5.5.patch
CommitLineData
c185e63d
JR
1diff --git a/.manifest b/.manifest
2index a53265d..bc46234 100644
3--- a/.manifest
4+++ b/.manifest
5@@ -36,6 +36,7 @@ kernel/nvidia/nv-rsync.c 0644 KERNEL_MODULE_SRC INHERIT_PATH_DEPTH:1 MODULE:resm
6 kernel/nvidia/nv-msi.c 0644 KERNEL_MODULE_SRC INHERIT_PATH_DEPTH:1 MODULE:resman
7 kernel/conftest.sh 0644 KERNEL_MODULE_SRC INHERIT_PATH_DEPTH:1 MODULE:resman
8 kernel/common/inc/nv.h 0644 KERNEL_MODULE_SRC INHERIT_PATH_DEPTH:1 MODULE:resman
9+kernel/common/inc/nv-drm.h 0644 KERNEL_MODULE_SRC INHERIT_PATH_DEPTH:1 MODULE:resman
10 kernel/common/inc/nv-pci.h 0644 KERNEL_MODULE_SRC INHERIT_PATH_DEPTH:1 MODULE:resman
11 kernel/common/inc/nv-pgprot.h 0644 KERNEL_MODULE_SRC INHERIT_PATH_DEPTH:1 MODULE:resman
12 kernel/common/inc/nv-mm.h 0644 KERNEL_MODULE_SRC INHERIT_PATH_DEPTH:1 MODULE:resman
13diff --git a/kernel/common/inc/nv-drm.h b/kernel/common/inc/nv-drm.h
14new file mode 100644
15index 0000000..07e9f3c
16--- /dev/null
17+++ b/kernel/common/inc/nv-drm.h
18@@ -0,0 +1,36 @@
19+#ifndef _NV_DRM_H_
20+#define _NV_DRM_H_
21+
22+#include "conftest.h"
23+
24+#if defined(NV_DRM_DRMP_H_PRESENT)
25+#include <drm/drmP.h>
26+#else
27+#include <linux/agp_backend.h>
28+#include <linux/file.h>
29+#include <linux/init.h>
30+#include <linux/jiffies.h>
31+#include <linux/kernel.h>
32+#include <linux/mutex.h>
33+#include <linux/slab.h>
34+#include <linux/types.h>
35+#include <asm/pgalloc.h>
36+#include <linux/uaccess.h>
37+
38+#include <uapi/drm/drm.h>
39+#include <uapi/drm/drm_mode.h>
40+
41+#include <drm/drm_agpsupport.h>
42+#include <drm/drm_crtc.h>
43+#include <drm/drm_drv.h>
44+#include <drm/drm_prime.h>
45+#include <drm/drm_pci.h>
46+#include <drm/drm_ioctl.h>
47+#include <drm/drm_sysfs.h>
48+#include <drm/drm_vblank.h>
49+#include <drm/drm_device.h>
50+
51+#include <drm/drm_gem.h>
52+#endif
53+
54+#endif
55diff --git a/kernel/conftest.sh b/kernel/conftest.sh
56index c9c2db3..dd22bb0 100755
57--- a/kernel/conftest.sh
58+++ b/kernel/conftest.sh
59@@ -1150,6 +1150,9 @@ compile_test() {
60 CODE="
61 #if defined(NV_DRM_DRMP_H_PRESENT)
62 #include <drm/drmP.h>
63+ #else
64+ #include <drm/drm_drv.h>
65+ #include <drm/drm_prime.h>
66 #endif
67 #if !defined(CONFIG_DRM) && !defined(CONFIG_DRM_MODULE)
68 #error DRM not enabled
69@@ -1781,6 +1784,8 @@ compile_test() {
70 echo "$CONFTEST_PREAMBLE
71 #if defined(NV_DRM_DRMP_H_PRESENT)
72 #include <drm/drmP.h>
73+ #else
74+ #include <drm/drm_drv.h>
75 #endif
76 #include <drm/drm_atomic.h>
77 #if !defined(CONFIG_DRM) && !defined(CONFIG_DRM_MODULE)
78@@ -1909,7 +1914,11 @@ compile_test() {
79 # attached drivers") in v3.14 (2013-12-11)
80 #
81 CODE="
82+ #if defined(NV_DRM_DRMP_H_PRESENT)
83 #include <drm/drmP.h>
84+ #else
85+ #include <drm/drm_drv.h>
86+ #endif
87 int conftest_drm_driver_has_legacy_dev_list(void) {
88 return offsetof(struct drm_driver, legacy_dev_list);
89 }"
90@@ -1933,7 +1942,11 @@ compile_test() {
91 # 2017-07-23 e6fc3b68558e4c6d8d160b5daf2511b99afa8814
92 #
93 CODE="
94+ #if defined(NV_DRM_DRMP_H_PRESENT)
95 #include <drm/drmP.h>
96+ #else
97+ #include <drm/drm_crtc.h>
98+ #endif
99
100 int conftest_drm_crtc_init_with_planes_has_name_arg(void) {
101 return
102@@ -1949,7 +1962,11 @@ compile_test() {
103 compile_check_conftest "$CODE" "NV_DRM_CRTC_INIT_WITH_PLANES_HAS_NAME_ARG" "" "types"
104
105 CODE="
106+ #if defined(NV_DRM_DRMP_H_PRESENT)
107 #include <drm/drmP.h>
108+ #else
109+ #include <drm/drm_encoder.h>
110+ #endif
111
112 int conftest_drm_encoder_init_has_name_arg(void) {
113 return
114@@ -1964,7 +1981,11 @@ compile_test() {
115 compile_check_conftest "$CODE" "NV_DRM_ENCODER_INIT_HAS_NAME_ARG" "" "types"
116
117 echo "$CONFTEST_PREAMBLE
118+ #if defined(NV_DRM_DRMP_H_PRESENT)
119 #include <drm/drmP.h>
120+ #else
121+ #include <drm/drm_plane.h>
122+ #endif
123
124 int conftest_drm_universal_plane_init_has_format_modifiers_arg(void) {
125 return
126@@ -1991,7 +2012,11 @@ compile_test() {
127 echo "#undef NV_DRM_UNIVERSAL_PLANE_INIT_HAS_FORMAT_MODIFIERS_ARG" | append_conftest "types"
128
129 echo "$CONFTEST_PREAMBLE
130+ #if defined(NV_DRM_DRMP_H_PRESENT)
131 #include <drm/drmP.h>
132+ #else
133+ #include <drm/drm_plane.h>
134+ #endif
135
136 int conftest_drm_universal_plane_init_has_name_arg(void) {
137 return
138@@ -3084,7 +3109,9 @@ compile_test() {
139 # drm_framebuffer_{get,put}()") in v4.12 (2017-02-28).
140 #
141 CODE="
142+ #if defined(NV_DRM_DRMP_H_PRESENT)
143 #include <drm/drmP.h>
144+ #endif
145 #if defined(NV_DRM_DRM_FRAMEBUFFER_H_PRESENT)
146 #include <drm/drm_framebuffer.h>
147 #endif
148@@ -3103,7 +3130,9 @@ compile_test() {
149 # drm_gem_object_{get,put}()") in v4.12 (2017-02-28).
150 #
151 CODE="
152+ #if defined(NV_DRM_DRMP_H_PRESENT)
153 #include <drm/drmP.h>
154+ #endif
155 #if defined(NV_DRM_DRM_GEM_H_PRESENT)
156 #include <drm/drm_gem.h>
157 #endif
158@@ -3122,7 +3151,9 @@ compile_test() {
159 # functions") in v4.15 (2017-09-26).
160 #
161 CODE="
162+ #if defined(NV_DRM_DRMP_H_PRESENT)
163 #include <drm/drmP.h>
164+ #endif
165 #if defined(NV_DRM_DRM_DRV_H_PRESENT)
166 #include <drm/drm_drv.h>
167 #endif
168diff --git a/kernel/nvidia-drm/nvidia-drm-connector.c b/kernel/nvidia-drm/nvidia-drm-connector.c
169index 1553ebc..f851561 100644
170--- a/kernel/nvidia-drm/nvidia-drm-connector.c
171+++ b/kernel/nvidia-drm/nvidia-drm-connector.c
172@@ -20,6 +20,8 @@
173 * DEALINGS IN THE SOFTWARE.
174 */
175
176+#include <linux/version.h>
177+
178 #include "nvidia-drm-conftest.h" /* NV_DRM_ATOMIC_MODESET_AVAILABLE */
179
180 #if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
181@@ -71,7 +73,11 @@ static enum drm_connector_status __nv_drm_connector_detect_internal(
182 struct nv_drm_encoder *nv_detected_encoder = NULL;
183
184 struct NvKmsKapiDynamicDisplayParams *pDetectParams = NULL;
185+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 5, 0)
186 unsigned int i;
187+#else
188+ struct drm_encoder *encoder = NULL;
189+#endif
190
191 BUG_ON(!mutex_is_locked(&dev->mode_config.mutex));
192
193@@ -87,11 +93,16 @@ static enum drm_connector_status __nv_drm_connector_detect_internal(
194 goto done;
195 }
196
197+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 5, 0)
198 for (i = 0;
199 i < DRM_CONNECTOR_MAX_ENCODER && detected_encoder == NULL; i++) {
200 struct drm_encoder *encoder;
201+#else
202+ drm_connector_for_each_possible_encoder(connector, encoder) {
203+#endif
204 struct nv_drm_encoder *nv_encoder;
205
206+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 5, 0)
207 if (connector->encoder_ids[i] == 0) {
208 break;
209 }
210@@ -102,6 +113,7 @@ static enum drm_connector_status __nv_drm_connector_detect_internal(
211 BUG_ON(encoder != NULL);
212 continue;
213 }
214+#endif
215
216 /*
217 * DVI-I connectors can drive both digital and analog
218@@ -169,6 +181,8 @@ static enum drm_connector_status __nv_drm_connector_detect_internal(
219 }
220
221 detected_encoder = encoder;
222+
223+ break;
224 }
225 }
226
227diff --git a/kernel/nvidia-drm/nvidia-drm-connector.h b/kernel/nvidia-drm/nvidia-drm-connector.h
228index f74e22c..099390d 100644
229--- a/kernel/nvidia-drm/nvidia-drm-connector.h
230+++ b/kernel/nvidia-drm/nvidia-drm-connector.h
231@@ -27,7 +27,7 @@
232
233 #if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
234
235-#include <drm/drmP.h>
236+#include "nv-drm.h"
237
238 #include "nvtypes.h"
239 #include "nvkms-api-types.h"
240diff --git a/kernel/nvidia-drm/nvidia-drm-crtc.h b/kernel/nvidia-drm/nvidia-drm-crtc.h
241index 31ef3b5..5de3a51 100644
242--- a/kernel/nvidia-drm/nvidia-drm-crtc.h
243+++ b/kernel/nvidia-drm/nvidia-drm-crtc.h
244@@ -29,7 +29,7 @@
245
246 #include "nvidia-drm-helper.h"
247
248-#include <drm/drmP.h>
249+#include "nv-drm.h"
250 #include "nvtypes.h"
251 #include "nvkms-kapi.h"
252
253diff --git a/kernel/nvidia-drm/nvidia-drm-drv.c b/kernel/nvidia-drm/nvidia-drm-drv.c
254index a66d3cc..06bf859 100644
255--- a/kernel/nvidia-drm/nvidia-drm-drv.c
256+++ b/kernel/nvidia-drm/nvidia-drm-drv.c
257@@ -39,7 +39,7 @@
258
259 #include "nvidia-drm-ioctl.h"
260
261-#include <drm/drmP.h>
262+#include "nv-drm.h"
263
264 /*
265 * Commit fcd70cd36b9b ("drm: Split out drm_probe_helper.h")
266diff --git a/kernel/nvidia-drm/nvidia-drm-encoder.h b/kernel/nvidia-drm/nvidia-drm-encoder.h
267index bbaf986..af341a8 100644
268--- a/kernel/nvidia-drm/nvidia-drm-encoder.h
269+++ b/kernel/nvidia-drm/nvidia-drm-encoder.h
270@@ -32,7 +32,7 @@
271 #if defined(NV_DRM_DRM_ENCODER_H_PRESENT)
272 #include <drm/drm_encoder.h>
273 #else
274-#include <drm/drmP.h>
275+#include "nv-drm.h"
276 #endif
277
278 #include "nvkms-kapi.h"
279diff --git a/kernel/nvidia-drm/nvidia-drm-fb.h b/kernel/nvidia-drm/nvidia-drm-fb.h
280index 7f292ce..d13bc4c 100644
281--- a/kernel/nvidia-drm/nvidia-drm-fb.h
282+++ b/kernel/nvidia-drm/nvidia-drm-fb.h
283@@ -27,7 +27,7 @@
284
285 #if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
286
287-#include <drm/drmP.h>
288+#include "nv-drm.h"
289 #include "nvidia-drm-gem-nvkms-memory.h"
290 #include "nvkms-kapi.h"
291
292diff --git a/kernel/nvidia-drm/nvidia-drm-gem.h b/kernel/nvidia-drm/nvidia-drm-gem.h
293index b621969..326f810 100644
294--- a/kernel/nvidia-drm/nvidia-drm-gem.h
295+++ b/kernel/nvidia-drm/nvidia-drm-gem.h
296@@ -29,7 +29,7 @@
297
298 #include "nvidia-drm-priv.h"
299
300-#include <drm/drmP.h>
301+#include "nv-drm.h"
302 #include "nvkms-kapi.h"
303
304 #if defined(NV_DRM_DRIVER_HAS_GEM_PRIME_RES_OBJ)
305diff --git a/kernel/nvidia-drm/nvidia-drm-helper.c b/kernel/nvidia-drm/nvidia-drm-helper.c
306index da602ac..e5d6daa 100644
307--- a/kernel/nvidia-drm/nvidia-drm-helper.c
308+++ b/kernel/nvidia-drm/nvidia-drm-helper.c
309@@ -31,7 +31,7 @@
310
311 #if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
312
313-#include <drm/drmP.h>
314+#include "nv-drm.h"
315 #if defined(NV_DRM_DRM_ATOMIC_UAPI_H_PRESENT)
316 #include <drm/drm_atomic_uapi.h>
317 #endif
318diff --git a/kernel/nvidia-drm/nvidia-drm-helper.h b/kernel/nvidia-drm/nvidia-drm-helper.h
319index 8f050d8..71c4b90 100644
320--- a/kernel/nvidia-drm/nvidia-drm-helper.h
321+++ b/kernel/nvidia-drm/nvidia-drm-helper.h
322@@ -27,7 +27,7 @@
323
324 #if defined(NV_DRM_AVAILABLE)
325
326-#include <drm/drmP.h>
327+#include "nv-drm.h"
328
329 /*
330 * drm_dev_put() is added by commit 9a96f55034e41b4e002b767e9218d55f03bdff7d
331diff --git a/kernel/nvidia-drm/nvidia-drm-modeset.h b/kernel/nvidia-drm/nvidia-drm-modeset.h
332index 06659c5..e9d7b70 100644
333--- a/kernel/nvidia-drm/nvidia-drm-modeset.h
334+++ b/kernel/nvidia-drm/nvidia-drm-modeset.h
335@@ -27,7 +27,7 @@
336
337 #if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
338
339-#include <drm/drmP.h>
340+#include "nv-drm.h"
341
342 struct drm_atomic_state *nv_drm_atomic_state_alloc(struct drm_device *dev);
343 void nv_drm_atomic_state_clear(struct drm_atomic_state *state);
344diff --git a/kernel/nvidia-drm/nvidia-drm-os-interface.h b/kernel/nvidia-drm/nvidia-drm-os-interface.h
345index f43f851..7f4ff8b 100644
346--- a/kernel/nvidia-drm/nvidia-drm-os-interface.h
347+++ b/kernel/nvidia-drm/nvidia-drm-os-interface.h
348@@ -29,7 +29,7 @@
349
350 #if defined(NV_DRM_AVAILABLE)
351
352-#include <drm/drmP.h>
353+#include "nv-drm.h"
354
355 /* Set to true when the atomic modeset feature is enabled. */
356 extern bool nv_drm_modeset_module_param;
357diff --git a/kernel/nvidia-drm/nvidia-drm-prime-fence.h b/kernel/nvidia-drm/nvidia-drm-prime-fence.h
358index 20da923..f3cc2b4 100644
359--- a/kernel/nvidia-drm/nvidia-drm-prime-fence.h
360+++ b/kernel/nvidia-drm/nvidia-drm-prime-fence.h
361@@ -27,7 +27,7 @@
362
363 #if defined(NV_DRM_AVAILABLE)
364
365-#include <drm/drmP.h>
366+#include "nv-drm.h"
367
368 #if defined(NV_DRM_DRIVER_HAS_GEM_PRIME_RES_OBJ)
369
370diff --git a/kernel/nvidia-drm/nvidia-drm-priv.h b/kernel/nvidia-drm/nvidia-drm-priv.h
371index 9076835..77a95f3 100644
372--- a/kernel/nvidia-drm/nvidia-drm-priv.h
373+++ b/kernel/nvidia-drm/nvidia-drm-priv.h
374@@ -27,7 +27,7 @@
375
376 #if defined(NV_DRM_AVAILABLE)
377
378-#include <drm/drmP.h>
379+#include "nv-drm.h"
380
381 #if defined(NV_DRM_DRM_GEM_H_PRESENT)
382 #include <drm/drm_gem.h>
383diff --git a/kernel/nvidia-drm/nvidia-drm-utils.h b/kernel/nvidia-drm/nvidia-drm-utils.h
384index 6d24120..95190c4 100644
385--- a/kernel/nvidia-drm/nvidia-drm-utils.h
386+++ b/kernel/nvidia-drm/nvidia-drm-utils.h
387@@ -27,7 +27,7 @@
388
389 #if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
390
391-#include <drm/drmP.h>
392+#include "nv-drm.h"
393 #include "nvkms-kapi.h"
394
395 struct NvKmsKapiConnectorInfo*
This page took 0.245892 seconds and 4 git commands to generate.