diff options
| author | Michel Dänzer <[email protected]> | 2016-03-28 03:53:02 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2016-03-28 15:55:38 +0000 |
| commit | 104ece975746d94b8276cd7f38d6b5c056d700b5 (patch) | |
| tree | 1d53b8183f2510bdd5b36f86d0955291e0a4719e /drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | |
| parent | drm/radeon: Don't move pinned BOs (diff) | |
| download | kernel-104ece975746d94b8276cd7f38d6b5c056d700b5.tar.gz kernel-104ece975746d94b8276cd7f38d6b5c056d700b5.zip | |
drm/amdgpu: Don't move pinned BOs
The purpose of pinning is to prevent a buffer from moving.
Reviewed-by: Christian König <[email protected]>
Tested-by: Rex Zhu <[email protected]>
Signed-off-by: Michel Dänzer <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index 151a2d42c639..56d1458393cc 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c @@ -608,6 +608,10 @@ int amdgpu_bo_fault_reserve_notify(struct ttm_buffer_object *bo) if ((offset + size) <= adev->mc.visible_vram_size) return 0; + /* Can't move a pinned BO to visible VRAM */ + if (abo->pin_count > 0) + return -EINVAL; + /* hurrah the memory is not visible ! */ amdgpu_ttm_placement_from_domain(abo, AMDGPU_GEM_DOMAIN_VRAM); lpfn = adev->mc.visible_vram_size >> PAGE_SHIFT; |
