aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.14.71/3721-drm-amdgpu-initial-validate-the-prime-BOs-into-the-C.patch
blob: b70cc50546a71340eb8952439094ca2b6144864b (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
From 4cd6cb9871ef3e0f46ae163741b8112143828209 Mon Sep 17 00:00:00 2001
From: Christian Koenig <christian.koenig@amd.com>
Date: Tue, 20 Feb 2018 19:42:40 +0100
Subject: [PATCH 3721/4131] drm/amdgpu: initial validate the prime BOs into the
 CPU domain
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Just set the GTT domain as mandatory, so that the BO is validated into
it on first use. This allows us to setup the sg table later on.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Roger He <Hongbo.He@amd.com>

Conflicts:
      drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c

Change-Id: I57cd74dc56c8ca2c9748ad40ee2f07453318efc2
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c
index 3af671b..46e8898 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c
@@ -104,11 +104,12 @@ amdgpu_gem_prime_import_sg_table(struct drm_device *dev,
 
 	ww_mutex_lock(&resv->lock, NULL);
 	ret = amdgpu_bo_create(adev, attach->dmabuf->size, PAGE_SIZE, false,
-			       AMDGPU_GEM_DOMAIN_GTT, 0, sg, resv, &bo);
+				AMDGPU_GEM_DOMAIN_CPU, 0, sg, resv, &bo);
 	if (ret)
 		goto error;
-
-	bo->prime_shared_count = 1;
+	
+	bo->allowed_domains = AMDGPU_GEM_DOMAIN_GTT;
+	bo->preferred_domains = AMDGPU_GEM_DOMAIN_GTT;
 
 	ww_mutex_unlock(&resv->lock);
 	return &bo->gem_base;
-- 
2.7.4