diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index ab34190859a8..f1a55d1888cb 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | |||
| @@ -384,9 +384,15 @@ static int amdgpu_bo_move(struct ttm_buffer_object *bo, | |||
| 384 | struct ttm_mem_reg *new_mem) | 384 | struct ttm_mem_reg *new_mem) |
| 385 | { | 385 | { |
| 386 | struct amdgpu_device *adev; | 386 | struct amdgpu_device *adev; |
| 387 | struct amdgpu_bo *abo; | ||
| 387 | struct ttm_mem_reg *old_mem = &bo->mem; | 388 | struct ttm_mem_reg *old_mem = &bo->mem; |
| 388 | int r; | 389 | int r; |
| 389 | 390 | ||
| 391 | /* Can't move a pinned BO */ | ||
| 392 | abo = container_of(bo, struct amdgpu_bo, tbo); | ||
| 393 | if (WARN_ON_ONCE(abo->pin_count > 0)) | ||
| 394 | return -EINVAL; | ||
| 395 | |||
| 390 | adev = amdgpu_get_adev(bo->bdev); | 396 | adev = amdgpu_get_adev(bo->bdev); |
| 391 | if (old_mem->mem_type == TTM_PL_SYSTEM && bo->ttm == NULL) { | 397 | if (old_mem->mem_type == TTM_PL_SYSTEM && bo->ttm == NULL) { |
| 392 | amdgpu_move_null(bo, new_mem); | 398 | amdgpu_move_null(bo, new_mem); |
