summaryrefslogtreecommitdiff
path: root/sys-kernel/nvidia-drivers-dkms/files/390.87-vmf_insert_pfn.patch
blob: 63052b57c1dfbde902aa41332da6075c5c8e2b57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
diff -Nur a/kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c b/kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c
--- a/kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c	2018-08-22 01:55:29.000000000 +0100
+++ b/kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c	2019-02-10 03:22:49.318034507 +0000
@@ -29,6 +29,7 @@
 
 #include "nv-mm.h"
 
+#include <linux/version.h>
 static void __nv_drm_gem_nvkms_memory_free(struct nv_drm_gem_object *nv_gem)
 {
     struct nv_drm_device *nv_dev = nv_gem->nv_dev;
@@ -237,7 +238,11 @@
 
     page_offset = vmf->pgoff - drm_vma_node_start(&gem->vma_node);
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0)
+    ret = vmf_insert_pfn(vma, address, pfn + page_offset);
+#else
     ret = vm_insert_pfn(vma, address, pfn + page_offset);
+#endif
 
     switch (ret) {
         case 0: