aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2018-02-20 13:42:40 -0500
committerAlex Deucher <alexander.deucher@amd.com>2018-03-14 15:38:28 -0400
commite3364dfc6a76e8d3432f3efd130f3dda6ddd698c (patch)
tree9199b13ff6c2c22c4e5b7b3f6748850b85e6e711 /drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c
parent82dee2418946737b5efa8d84e07ef921727018bc (diff)
drm/amdgpu: initial validate the prime BOs into the CPU domain
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> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c
index fb66b45548d3..44230165e181 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c
@@ -106,10 +106,12 @@ amdgpu_gem_prime_import_sg_table(struct drm_device *dev,
106 106
107 ww_mutex_lock(&resv->lock, NULL); 107 ww_mutex_lock(&resv->lock, NULL);
108 ret = amdgpu_bo_create(adev, attach->dmabuf->size, PAGE_SIZE, false, 108 ret = amdgpu_bo_create(adev, attach->dmabuf->size, PAGE_SIZE, false,
109 AMDGPU_GEM_DOMAIN_GTT, 0, sg, resv, &bo); 109 AMDGPU_GEM_DOMAIN_CPU, 0, sg, resv, &bo);
110 if (ret) 110 if (ret)
111 goto error; 111 goto error;
112 112
113 bo->allowed_domains = AMDGPU_GEM_DOMAIN_GTT;
114 bo->preferred_domains = AMDGPU_GEM_DOMAIN_GTT;
113 if (attach->dmabuf->ops != &amdgpu_dmabuf_ops) 115 if (attach->dmabuf->ops != &amdgpu_dmabuf_ops)
114 bo->prime_shared_count = 1; 116 bo->prime_shared_count = 1;
115 117