aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.14.71/4236-drm-amdgpu-simplify-bo_va-list-when-vm-bo-update-v2.patch
blob: 272cf93a0db5207b29bf7f4a9c68f6db3ecd221e (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
From ab0c4b83f2ecf4a80e93356f2f4f730a5f8fbb29 Mon Sep 17 00:00:00 2001
From: Junwei Zhang <Jerry.Zhang@amd.com>
Date: Thu, 19 Apr 2018 13:17:26 +0800
Subject: [PATCH 4236/5725] drm/amdgpu: simplify bo_va list when vm bo update
 (v2)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

v2: fix compiling warning

Change-Id: I05145e726302b37e0519500ac1fd46bf03afbf75
Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>

Conflicts:
      drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 5543487..125860a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -1530,6 +1530,7 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,
 	uint64_t flags;
 	uint64_t vram_base_offset = adev->vm_manager.vram_base_offset;
 	struct amdgpu_device *bo_adev;
+	uint32_t mem_type;
 	int r;
 
 	if (clear || !bo_va->base.bo) {
@@ -1590,19 +1591,16 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev,
 	}
 
 	spin_lock(&vm->status_lock);
-	if (bo && bo->tbo.resv == vm->root.base.bo->tbo.resv) {
-		unsigned mem_type = bo->tbo.mem.mem_type;
+	list_del_init(&bo_va->base.vm_status);
 
-		/* If the BO is not in its preferred location add it back to
-		 * the evicted list so that it gets validated again on the
-		 * next command submission.
-		 */
-		list_del_init(&bo_va->base.vm_status);
-		if (!(bo->preferred_domains & amdgpu_mem_type_to_domain(mem_type)))
-			list_add_tail(&bo_va->base.vm_status, &vm->evicted);
-	} else {
-		list_del_init(&bo_va->base.vm_status);
-	}
+	/* If the BO is not in its preferred location add it back to
+	 * the evicted list so that it gets validated again on the
+	 * next command submission.
+	 */
+	mem_type = bo->tbo.mem.mem_type;
+	if (bo && bo->tbo.resv == vm->root.base.bo->tbo.resv &&
+	    !(bo->preferred_domains & amdgpu_mem_type_to_domain(mem_type)))
+		list_add_tail(&bo_va->base.vm_status, &vm->evicted);
 	spin_unlock(&vm->status_lock);
 
 	list_splice_init(&bo_va->invalids, &bo_va->valids);
-- 
2.7.4