-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnvidia-fix-linux-5.10.patch
51 lines (44 loc) · 2.02 KB
/
nvidia-fix-linux-5.10.patch
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
diff --git a/NVIDIA-Linux-x86_64-450.80.02/kernel/common/inc/nv-linux.h b/NVIDIA-Linux-x86_64-450.80.02/kernel/common/inc/nv-linux.h
index fb6597a..e2519b5 100644
--- a/NVIDIA-Linux-x86_64-450.80.02/kernel/common/inc/nv-linux.h
+++ b/NVIDIA-Linux-x86_64-450.80.02/kernel/common/inc/nv-linux.h
@@ -11,6 +11,7 @@
#ifndef _NV_LINUX_H_
#define _NV_LINUX_H_
+#include <linux/version.h>
#include "nvstatus.h"
#include "nv-misc.h"
#include "nv.h"
@@ -166,6 +167,11 @@ static inline uid_t __kuid_val(uid_t uid)
#include <linux/pagemap.h>
#include <linux/dma-mapping.h>
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0))
+// dma-mapping.h has been split on commit 0a0f0d8be76dcd4390ff538e7060fda34db79717,,
+// so this needs to be incldued now for the build to work
+#include <linux/dma-map-ops.h>
+#endif
#if defined(CONFIG_SWIOTLB) && defined(NVCPU_AARCH64)
#include <linux/swiotlb.h>
diff --git a/NVIDIA-Linux-x86_64-450.80.02/kernel/nvidia-drm/nvidia-drm-gem-user-memory.c b/NVIDIA-Linux-x86_64-450.80.02/kernel/nvidia-drm/nvidia-drm-gem-user-memory.c
index 737d84c..082fc11 100644
--- a/NVIDIA-Linux-x86_64-450.80.02/kernel/nvidia-drm/nvidia-drm-gem-user-memory.c
+++ b/NVIDIA-Linux-x86_64-450.80.02/kernel/nvidia-drm/nvidia-drm-gem-user-memory.c
@@ -20,6 +20,7 @@
* DEALINGS IN THE SOFTWARE.
*/
+#include <linux/version.h>
#include "nvidia-drm-conftest.h"
#if defined(NV_DRM_AVAILABLE)
@@ -60,8 +61,14 @@ static struct sg_table *__nv_drm_gem_user_memory_prime_get_sg_table(
{
struct nv_drm_gem_user_memory *nv_user_memory = to_nv_user_memory(nv_gem);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0))
+ // New parameter to drm_prime_pages_to_sg (commit 707d561f77b5e2a6f90c9786bee44ee7a8dedc7e)
+ return drm_prime_pages_to_sg(nv_gem->nv_dev->dev, nv_user_memory->pages,
+ nv_user_memory->pages_count);
+#else
return drm_prime_pages_to_sg(nv_user_memory->pages,
nv_user_memory->pages_count);
+#endif
}
static void *__nv_drm_gem_user_memory_prime_vmap(