summarylogtreecommitdiffstats
path: root/160-nvidia-open-linux6.15-fix.patch
blob: bbf43ead6770437b73d442fcab58059aff873ecf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
--- a/kernel-open/nvidia-drm/nvidia-drm-gem-user-memory.c
+++ b/kernel-open/nvidia-drm/nvidia-drm-gem-user-memory.c
@@ -44,6 +44,13 @@
 #include <vm/vm_pageout.h>
 #endif
 
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
+#define nv_vm_flags_set(v, f) vm_flags_reset((v), (v)->vm_flags | (f))
+#define nv_vm_flags_clear(v, f) vm_flags_reset((v), (v)->vm_flags & ~(f))
+#endif
+
 static inline
 void __nv_drm_gem_user_memory_free(struct nv_drm_gem_object *nv_gem)
 {
--- a/kernel-open/nvidia-drm/nvidia-drm-gem.c
+++ b/kernel-open/nvidia-drm/nvidia-drm-gem.c
@@ -51,6 +51,13 @@
 
 #include "nv-mm.h"
 
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
+#define nv_vm_flags_set(v, f) vm_flags_reset((v), (v)->vm_flags | (f))
+#define nv_vm_flags_clear(v, f) vm_flags_reset((v), (v)->vm_flags & ~(f))
+#endif
+
 void nv_drm_gem_free(struct drm_gem_object *gem)
 {
     struct nv_drm_gem_object *nv_gem = to_nv_gem_object(gem);
--- a/kernel-open/nvidia-uvm/uvm.c
+++ b/kernel-open/nvidia-uvm/uvm.c
@@ -21,6 +21,8 @@
 
 *******************************************************************************/
 
+#include <linux/version.h>
+
 #include "uvm_api.h"
 #include "uvm_global.h"
 #include "uvm_gpu_replayable_faults.h"
@@ -42,6 +44,11 @@
 
 #define NVIDIA_UVM_DEVICE_NAME          "nvidia-uvm"
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
+#define nv_vm_flags_set(v, f) vm_flags_reset((v), (v)->vm_flags | (f))
+#define nv_vm_flags_clear(v, f) vm_flags_reset((v), (v)->vm_flags & ~(f))
+#endif
+
 static dev_t g_uvm_base_dev;
 static struct cdev g_uvm_cdev;
 static const struct file_operations uvm_fops;
--- a/kernel-open/nvidia/nv-mmap.c
+++ b/kernel-open/nvidia/nv-mmap.c
@@ -23,10 +23,17 @@
 
 #define  __NO_VERSION__
 
+#include <linux/version.h>
+
 #include "os-interface.h"
 #include "nv-linux.h"
 #include "nv_speculation_barrier.h"
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
+#define nv_vm_flags_set(v, f) vm_flags_reset((v), (v)->vm_flags | (f))
+#define nv_vm_flags_clear(v, f) vm_flags_reset((v), (v)->vm_flags & ~(f))
+#endif
+
 /*
  * The 'struct vm_operations' open() callback is called by the Linux
  * kernel when the parent VMA is split or copied, close() when the