aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1619-Adaption-for-kfd-allocate-the-PTEs-before-mapping.patch
blob: dc3efc8b68918ad178ad6db665b9d9883690f74f (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
From 3014908abdde7540169aa6740eb079d3fdf49ce6 Mon Sep 17 00:00:00 2001
From: Yong Zhao <Yong.Zhao@amd.com>
Date: Tue, 21 Mar 2017 18:14:41 -0400
Subject: [PATCH 1619/4131] Adaption-for-kfd: allocate the PTEs before mapping

The adaption is needed due to change 6c56a655 in amdgpu

"drm/amdgpu: separate page table allocation from mapping"

Change-Id: I0a2d43ec25f438f8290fc0b847cc6d1dc91ff5aa
Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
index a8482ce..7f431e4 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
@@ -989,6 +989,14 @@ static int map_bo_to_gpuvm(struct amdgpu_device *adev,
 					kvm->process_info->eviction_fence,
 					NULL, NULL);
 
+	ret = amdgpu_vm_alloc_pts(adev, entry->bo_va->vm, entry->va,
+				  amdgpu_bo_size(bo));
+
+	if (ret) {
+		pr_err("Failed to allocate pts, err=%d\n", ret);
+		return ret;
+	}
+
 	/* Set virtual address for the allocation, allocate PTs,
 	 * if needed, and zero them.
 	 */
-- 
2.7.4