aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.14.71/1766-drm-amdkfd-Fix-bo_va-structure-reference-since-it-ha.patch
blob: 454b945bad92d973d666bfbb24e3e1b24f046f6b (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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
From 988b9ea93fe5e8554673a8d711b45ced140f5791 Mon Sep 17 00:00:00 2001
From: "Le.Ma" <Le.Ma@amd.com>
Date: Wed, 23 Aug 2017 15:19:18 +0800
Subject: [PATCH 1766/4131] drm/amdkfd: Fix bo_va structure reference since it
 has been separated.

Change-Id: I90f6d67b14004f56113fb93659323633ec12f087
Signed-off-by: Le.Ma <Le.Ma@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
index 80b5197..b352e8e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
@@ -94,7 +94,7 @@ static bool check_if_add_bo_to_vm(struct amdgpu_vm *avm,
 	struct kfd_bo_va_list *entry;
 
 	list_for_each_entry(entry, &mem->bo_va_list, bo_list)
-		if (entry->bo_va->vm == avm)
+		if (entry->bo_va->base.vm == avm)
 			return false;
 
 	return true;
@@ -873,7 +873,7 @@ static int reserve_bo_and_cond_vms(struct kgd_mem *mem,
 	INIT_LIST_HEAD(&ctx->duplicates);
 
 	list_for_each_entry(entry, &mem->bo_va_list, bo_list) {
-		if ((vm && vm != entry->bo_va->vm) ||
+		if ((vm && vm != entry->bo_va->base.vm) ||
 			(entry->is_mapped != map_type
 			&& map_type != VA_DO_NOT_CARE))
 			continue;
@@ -897,12 +897,12 @@ static int reserve_bo_and_cond_vms(struct kgd_mem *mem,
 
 	i = 0;
 	list_for_each_entry(entry, &mem->bo_va_list, bo_list) {
-		if ((vm && vm != entry->bo_va->vm) ||
+		if ((vm && vm != entry->bo_va->base.vm) ||
 			(entry->is_mapped != map_type
 			&& map_type != VA_DO_NOT_CARE))
 			continue;
 
-		amdgpu_vm_get_pd_bo(entry->bo_va->vm, &ctx->list,
+		amdgpu_vm_get_pd_bo(entry->bo_va->base.vm, &ctx->list,
 				&ctx->vm_pd[i]);
 		i++;
 	}
@@ -947,7 +947,7 @@ static int unmap_bo_from_gpuvm(struct amdgpu_device *adev,
 				struct amdgpu_sync *sync)
 {
 	struct amdgpu_bo_va *bo_va = entry->bo_va;
-	struct amdgpu_vm *vm = bo_va->vm;
+	struct amdgpu_vm *vm = bo_va->base.vm;
 	struct amdkfd_vm *kvm = container_of(vm, struct amdkfd_vm, base);
 	struct amdgpu_bo *pd = vm->root.bo;
 
@@ -990,8 +990,8 @@ static int update_gpuvm_pte(struct amdgpu_device *adev,
 	struct amdgpu_bo *bo;
 
 	bo_va = entry->bo_va;
-	vm = bo_va->vm;
-	bo = bo_va->bo;
+	vm = bo_va->base.vm;
+	bo = bo_va->base.bo;
 
 	/* Update the page tables  */
 	ret = amdgpu_vm_bo_update(adev, bo_va, false);
@@ -1022,7 +1022,7 @@ static int map_bo_to_gpuvm(struct amdgpu_device *adev,
 
 	/* Set virtual address for the allocation */
 	ret = amdgpu_vm_bo_map(adev, entry->bo_va, entry->va, 0,
-			amdgpu_bo_size(entry->bo_va->bo), entry->pte_flags);
+			amdgpu_bo_size(entry->bo_va->base.bo), entry->pte_flags);
 	if (ret != 0) {
 		pr_err("Failed to map VA 0x%llx in vm. ret %d\n",
 				entry->va, ret);
@@ -1337,7 +1337,7 @@ int amdgpu_amdkfd_gpuvm_map_memory_to_gpu(
 	}
 
 	list_for_each_entry(entry, &mem->bo_va_list, bo_list) {
-		if (entry->bo_va->vm == vm && !entry->is_mapped) {
+		if (entry->bo_va->base.vm == vm && !entry->is_mapped) {
 			pr_debug("\t map VA 0x%llx - 0x%llx in entry %p\n",
 					entry->va, entry->va + bo_size,
 					entry);
@@ -1546,7 +1546,7 @@ static bool is_mem_on_local_device(struct kgd_dev *kgd,
 	struct kfd_bo_va_list *entry;
 
 	list_for_each_entry(entry, bo_va_list, bo_list) {
-		if (entry->kgd_dev == kgd && entry->bo_va->vm == vm)
+		if (entry->kgd_dev == kgd && entry->bo_va->base.vm == vm)
 			return true;
 	}
 
@@ -1597,7 +1597,7 @@ int amdgpu_amdkfd_gpuvm_unmap_memory_from_gpu(
 		vm);
 
 	list_for_each_entry(entry, &mem->bo_va_list, bo_list) {
-		if (entry->bo_va->vm == vm && entry->is_mapped) {
+		if (entry->bo_va->base.vm == vm && entry->is_mapped) {
 			pr_debug("\t unmap VA 0x%llx - 0x%llx from entry %p\n",
 					entry->va,
 					entry->va + bo_size,
-- 
2.7.4