diff options
author | Samuel Li <Samuel.Li@amd.com> | 2018-04-18 16:26:18 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-05-15 14:43:43 -0400 |
commit | 9b3f217faf48603c91d4ca44a18e6ff74c3c1c0c (patch) | |
tree | 16a67de3810baa11771ebc04c146bf1801efee8b /drivers/gpu/drm | |
parent | 1d2361e5a6c60d7b142d19555c3e6240ffe93731 (diff) |
drm/amdgpu: Remove VRAM from shared bo domains.
This fixes an issue introduced by change "allow framebuffer in GART
memory as well" which could lead to a shared buffer ending up
pinned in vram. Use GTT if it is included in the domain, otherwise
return an error.
Signed-off-by: Samuel Li <Samuel.Li@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 8 |
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 feece0a491a3..1985c08413c6 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | |||
@@ -694,8 +694,12 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain, | |||
694 | return -EINVAL; | 694 | return -EINVAL; |
695 | 695 | ||
696 | /* A shared bo cannot be migrated to VRAM */ | 696 | /* A shared bo cannot be migrated to VRAM */ |
697 | if (bo->prime_shared_count && (domain == AMDGPU_GEM_DOMAIN_VRAM)) | 697 | if (bo->prime_shared_count) { |
698 | return -EINVAL; | 698 | if (domain & AMDGPU_GEM_DOMAIN_GTT) |
699 | domain = AMDGPU_GEM_DOMAIN_GTT; | ||
700 | else | ||
701 | return -EINVAL; | ||
702 | } | ||
699 | 703 | ||
700 | if (bo->pin_count) { | 704 | if (bo->pin_count) { |
701 | uint32_t mem_type = bo->tbo.mem.mem_type; | 705 | uint32_t mem_type = bo->tbo.mem.mem_type; |