aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1396-Change-reserve_bo_and_vms-prototype.patch
blob: de325eff3763f381443e73a219061de26325cbeb (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
From 80ab5fb876cfaf10d44e5b44206299dcf623eb38 Mon Sep 17 00:00:00 2001
From: Yong Zhao <yong.zhao@amd.com>
Date: Wed, 20 Apr 2016 16:59:14 -0400
Subject: [PATCH 1396/4131] Change reserve_bo_and_vms() prototype

Change-Id: I228662304df44043f5b9b766e899e32a92fdc5bd
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
index 8ee2cb3..791e494 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
@@ -447,11 +447,11 @@ struct bo_vm_reservation_context {
 	bool reserved;
 };
 
-static int reserve_bo_and_vms(struct amdgpu_bo *bo,
-			      struct list_head *bo_va_list,
+static int reserve_bo_and_vms(struct kgd_mem *mem,
 			      struct amdgpu_vm *vm, bool is_mapped,
 			      struct bo_vm_reservation_context *ctx)
 {
+	struct amdgpu_bo *bo = mem->data2.bo;
 	struct kfd_bo_va_list *entry;
 	unsigned i;
 	int ret;
@@ -469,7 +469,7 @@ static int reserve_bo_and_vms(struct amdgpu_bo *bo,
 	ctx->reserved = false;
 
 	ctx->n_vms = 0;
-	list_for_each_entry(entry, bo_va_list, bo_list) {
+	list_for_each_entry(entry, &mem->data2.bo_va_list, bo_list) {
 		if ((vm && vm != entry->bo_va->vm) ||
 		    entry->is_mapped != is_mapped)
 			continue;
@@ -485,7 +485,7 @@ static int reserve_bo_and_vms(struct amdgpu_bo *bo,
 	}
 
 	i = 0;
-	list_for_each_entry(entry, bo_va_list, bo_list) {
+	list_for_each_entry(entry, &mem->data2.bo_va_list, bo_list) {
 		if ((vm && vm != entry->bo_va->vm) ||
 		    entry->is_mapped != is_mapped)
 			continue;
@@ -848,8 +848,7 @@ int amdgpu_amdkfd_gpuvm_map_memory_to_gpu(
 	}
 
 	if (!mem->data2.evicted) {
-		ret = reserve_bo_and_vms(bo, &mem->data2.bo_va_list,
-					 vm, false, &ctx);
+		ret = reserve_bo_and_vms(mem, vm, false, &ctx);
 		if (unlikely(ret != 0))
 			goto bo_reserve_failed;
 
@@ -1492,8 +1491,7 @@ int amdgpu_amdkfd_gpuvm_restore_mem(struct kgd_mem *mem, struct mm_struct *mm)
 
 	domain = mem->data2.domain;
 
-	ret = reserve_bo_and_vms(mem->data2.bo,
-				 &mem->data2.bo_va_list, NULL, true, &ctx);
+	ret = reserve_bo_and_vms(mem, NULL, true, &ctx);
 	if (likely(ret == 0)) {
 		ret = update_user_pages(mem, mm, &ctx);
 		have_pages = !ret;
-- 
2.7.4