Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-08-03 14:21:47 +0200
committerTakashi Iwai <tiwai@suse.de>2018-08-03 14:22:15 +0200
commit9688748b29a2f7331f606355ba2d36aaa43d3228 (patch)
tree07b0685017b3add7909d91b4060856e95d3bdb93
parenta90dce60226604dd0c2caa1db73d124f7c83498a (diff)
drm/amdgpu: Remove VRAM from shared bo domains (bsc#1051510).
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_object.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index 845f65387a5f..366885025038 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -680,8 +680,12 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain,
return -EINVAL;
/* A shared bo cannot be migrated to VRAM */
- if (bo->prime_shared_count && (domain == AMDGPU_GEM_DOMAIN_VRAM))
- return -EINVAL;
+ if (bo->prime_shared_count) {
+ if (domain & AMDGPU_GEM_DOMAIN_GTT)
+ domain = AMDGPU_GEM_DOMAIN_GTT;
+ else
+ return -EINVAL;
+ }
if (bo->pin_count) {
uint32_t mem_type = bo->tbo.mem.mem_type;