|
@@ -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))
|
|
|
|
- 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) {
|
|
if (bo->pin_count) {
|
|
uint32_t mem_type = bo->tbo.mem.mem_type;
|
|
uint32_t mem_type = bo->tbo.mem.mem_type;
|