aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1573-drm-amdgpu-Don-t-clear-BO-during-memory-allocation.patch
blob: 17fadb6d2bdcfdbadfdb2258e7ec2d57a82b1bcc (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
From 6e9673f82a9e4556ff3b0e93da0ed4594a63c4ed Mon Sep 17 00:00:00 2001
From: Kent Russell <kent.russell@amd.com>
Date: Wed, 2 Nov 2016 16:09:59 -0400
Subject: [PATCH 1573/4131] drm/amdgpu: Don't clear BO during memory allocation

Using an offset doesn't work as larger memory allocations are split into
smaller chunks. For now, don't clear the BO. Use the fill_buffer
function in a future patch to address the issue properly

Change-Id: I80f6070097998d47db08b4719a78f289bbc44edd
Signed-off-by: Kent Russell <kent.russell@amd.com>

 Conflicts:
	drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 17 -----------------
 1 file changed, 17 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
index 27205a0..1899eba 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
@@ -643,22 +643,6 @@ static int __alloc_memory_of_gpu(struct kgd_dev *kgd, uint64_t va,
 	if (userptr)
 		bo->flags |= AMDGPU_AMDKFD_USERPTR_BO;
 
-	if (domain == AMDGPU_GEM_DOMAIN_VRAM) {
-		ret = amdgpu_bo_reserve(bo, true);
-		if (ret) {
-			pr_err("Failed to reserve bo. ret %d\n",
-					ret);
-			goto err_bo_clear;
-		}
-		ret = amdgpu_amdkfd_gpuvm_clear_bo(adev, vm, bo);
-		amdgpu_bo_unreserve(bo);
-		if (ret) {
-			pr_err("Failed to clear VRAM BO object. ret %d\n",
-					ret);
-			goto err_bo_clear;
-		}
-	}
-
 	if (userptr) {
 		ret = amdgpu_ttm_tt_set_userptr(bo->tbo.ttm, user_addr, 0);
 		if (ret) {
@@ -717,7 +701,6 @@ static int __alloc_memory_of_gpu(struct kgd_dev *kgd, uint64_t va,
 	if (userptr)
 		amdgpu_mn_unregister(bo);
 allocate_mem_set_userptr_failed:
-err_bo_clear:
 	amdgpu_bo_unref(&bo);
 err_bo_create:
 	kfree(*mem);
-- 
2.7.4