]> git.pld-linux.org Git - packages/xorg-driver-video-nvidia-legacy-390xx.git/blame - kernel-5.8.patch
- patch nvidia-uvm inly on x8886, module is not present on 32bit arch
[packages/xorg-driver-video-nvidia-legacy-390xx.git] / kernel-5.8.patch
CommitLineData
b0685433
JR
1--- NVIDIA-Linux-x86_64-390.138-no-compat32/kernel/common/inc/nv-linux.h~ 2020-05-14 14:29:21.000000000 +0200
2+++ NVIDIA-Linux-x86_64-390.138-no-compat32/kernel/common/inc/nv-linux.h 2020-08-16 21:04:10.709809366 +0200
3@@ -531,7 +531,11 @@
4
5 static inline void *nv_vmalloc(unsigned long size)
6 {
7+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)
8 void *ptr = __vmalloc(size, GFP_KERNEL, PAGE_KERNEL);
9+#else
10+ void *ptr = __vmalloc(size, GFP_KERNEL);
11+#endif
12 if (ptr)
13 NV_MEMDBG_ADD(ptr, size);
14 return ptr;
15--- NVIDIA-Linux-x86_64-390.138-no-compat32/kernel/nvidia/os-mlock.c~ 2020-05-14 14:29:21.000000000 +0200
16+++ NVIDIA-Linux-x86_64-390.138-no-compat32/kernel/nvidia/os-mlock.c 2020-08-16 21:07:49.051608021 +0200
17@@ -44,7 +44,11 @@
18 return rmStatus;
19 }
20
21+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)
22 down_read(&mm->mmap_sem);
23+#else
24+ mmap_read_lock(mm);
25+#endif
26
27 vma = find_vma(mm, (NvUPtr)address);
28 if ((vma == NULL) || ((vma->vm_flags & (VM_IO | VM_PFNMAP)) == 0))
29@@ -77,7 +81,11 @@
30 }
31
32 done:
33+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)
34 up_read(&mm->mmap_sem);
35+#else
36+ mmap_read_unlock(mm);
37+#endif
38
39 return rmStatus;
40 #else
41@@ -115,10 +123,18 @@
42 return rmStatus;
43 }
44
45+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)
46 down_read(&mm->mmap_sem);
47+#else
48+ mmap_read_lock(mm);
49+#endif
50 ret = NV_GET_USER_PAGES((unsigned long)address,
51 page_count, write, force, user_pages, NULL);
52+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)
53 up_read(&mm->mmap_sem);
54+#else
55+ mmap_read_unlock(mm);
56+#endif
57 pinned = ret;
58
59 if (ret < 0)
60--- NVIDIA-Linux-x86_64-390.138-no-compat32/kernel/nvidia-drm/nvidia-drm-linux.c~ 2020-05-14 14:29:25.000000000 +0200
61+++ NVIDIA-Linux-x86_64-390.138-no-compat32/kernel/nvidia-drm/nvidia-drm-linux.c 2020-08-16 21:10:16.179212969 +0200
62@@ -32,6 +32,7 @@
63 #if defined(NV_DRM_AVAILABLE)
64
65 #include <linux/vmalloc.h>
66+#include <linux/version.h>
67
68 #if defined(NV_DRM_DRMP_H_PRESENT)
69 #include <drm/drmP.h>
70@@ -103,11 +103,19 @@
71 return -ENOMEM;
72 }
73
74+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)
75 down_read(&mm->mmap_sem);
76+#else
77+ mmap_read_lock(mm);
78+#endif
79
80 pages_pinned = NV_GET_USER_PAGES(address, pages_count, write, force,
81 user_pages, NULL);
82+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)
83 up_read(&mm->mmap_sem);
84+#else
85+ mmap_read_unlock(mm);
86+#endif
87
88 if (pages_pinned < 0 || (unsigned)pages_pinned < pages_count) {
89 goto failed;
This page took 0.081529 seconds and 4 git commands to generate.