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>
This commit is contained in:
@@ -694,8 +694,12 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain,
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
/* A shared bo cannot be migrated to VRAM */
|
/* A shared bo cannot be migrated to VRAM */
|
||||||
if (bo->prime_shared_count && (domain == AMDGPU_GEM_DOMAIN_VRAM))
|
if (bo->prime_shared_count) {
|
||||||
return -EINVAL;
|
if (domain & AMDGPU_GEM_DOMAIN_GTT)
|
||||||
|
domain = AMDGPU_GEM_DOMAIN_GTT;
|
||||||
|
else
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
if (bo->pin_count) {
|
if (bo->pin_count) {
|
||||||
uint32_t mem_type = bo->tbo.mem.mem_type;
|
uint32_t mem_type = bo->tbo.mem.mem_type;
|
||||||
|
|||||||
Reference in New Issue
Block a user