aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2017-08-25 03:14:43 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-08-31 13:46:35 -0400
commite1eb899b45781b9bb77e6d7772d6e67bb0bc1a18 (patch)
treea9ae3cb189187feffa80d868d5caa31bb2a78795 /drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c
parent73fb16e7ebee12953de32a7a2552e0cf2bf74ebf (diff)
drm/amdgpu: add IOCTL interface for per VM BOs v3
Add the IOCTL interface so that applications can allocate per VM BOs. Still WIP since not all corner cases are tested yet, but this reduces average CS overhead for 10K BOs from 21ms down to 48us. v2: add some extra checks, remove the WIP tag v3: rename new flag to AMDGPU_GEM_CREATE_VM_ALWAYS_VALID Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Felix Kuehling <Felix.Kuehling@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.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c
index 5b3f92891f89..7e0826469b5e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c
@@ -136,7 +136,8 @@ struct dma_buf *amdgpu_gem_prime_export(struct drm_device *dev,
136{ 136{
137 struct amdgpu_bo *bo = gem_to_amdgpu_bo(gobj); 137 struct amdgpu_bo *bo = gem_to_amdgpu_bo(gobj);
138 138
139 if (amdgpu_ttm_tt_get_usermm(bo->tbo.ttm)) 139 if (amdgpu_ttm_tt_get_usermm(bo->tbo.ttm) ||
140 bo->flags & AMDGPU_GEM_CREATE_VM_ALWAYS_VALID)
140 return ERR_PTR(-EPERM); 141 return ERR_PTR(-EPERM);
141 142
142 return drm_gem_prime_export(dev, gobj, flags); 143 return drm_gem_prime_export(dev, gobj, flags);