summarylogtreecommitdiffstats
path: root/0005-fix_drm_vma_node_verify_access.patch
blob: 8c1d49bfe31f20fb81625bf2c4ea529c3a28a860 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--- a/amd/amdgpu/amdgpu_ttm.c	2017-01-23 03:01:42.000000000 +0100
+++ b/amd/amdgpu/amdgpu_ttm.c	2017-02-06 13:49:25.767120946 +0100
@@ -251,11 +251,19 @@
 
 static int amdgpu_verify_access(struct ttm_buffer_object *bo, struct file *filp)
 {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+	struct drm_file *file_priv;
+#endif
 	struct amdgpu_bo *abo = container_of(bo, struct amdgpu_bo, tbo);
 
 	if (amdgpu_ttm_tt_get_usermm(bo->ttm))
 		return -EPERM;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+	file_priv = filp->private_data;
+	return drm_vma_node_verify_access(&abo->gem_base.vma_node, file_priv);
+#else
 	return drm_vma_node_verify_access(&abo->gem_base.vma_node, filp);
+#endif
 }
 
 static void amdgpu_move_null(struct ttm_buffer_object *bo,