aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2016-09-05 11:00:57 -0400
committerAlex Deucher <alexander.deucher@amd.com>2016-09-14 15:10:30 -0400
commitc855e25090cdafffb87119028eb018030a46dd9e (patch)
tree237c294ebfb71d5971e60f15cda0c007dd46d30b /drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
parent71c76a086f04055e2da8d7d71c77e0b37ac310a2 (diff)
drm/amdgpu: bind GTT on demand
We don't really need the GTT table any more most of the time. So bind it only on demand. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Acked-by: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_object.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index 162411bd8145..5a6216c9c007 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -675,6 +675,11 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain,
675 dev_err(bo->adev->dev, "%p pin failed\n", bo); 675 dev_err(bo->adev->dev, "%p pin failed\n", bo);
676 goto error; 676 goto error;
677 } 677 }
678 r = amdgpu_ttm_bind(bo->tbo.ttm, &bo->tbo.mem);
679 if (unlikely(r)) {
680 dev_err(bo->adev->dev, "%p bind failed\n", bo);
681 goto error;
682 }
678 683
679 bo->pin_count = 1; 684 bo->pin_count = 1;
680 if (gpu_addr != NULL) 685 if (gpu_addr != NULL)
@@ -947,6 +952,8 @@ void amdgpu_bo_fence(struct amdgpu_bo *bo, struct fence *fence,
947u64 amdgpu_bo_gpu_offset(struct amdgpu_bo *bo) 952u64 amdgpu_bo_gpu_offset(struct amdgpu_bo *bo)
948{ 953{
949 WARN_ON_ONCE(bo->tbo.mem.mem_type == TTM_PL_SYSTEM); 954 WARN_ON_ONCE(bo->tbo.mem.mem_type == TTM_PL_SYSTEM);
955 WARN_ON_ONCE(bo->tbo.mem.mem_type == TTM_PL_TT &&
956 !amdgpu_ttm_is_bound(bo->tbo.ttm));
950 WARN_ON_ONCE(!ww_mutex_is_locked(&bo->tbo.resv->lock) && 957 WARN_ON_ONCE(!ww_mutex_is_locked(&bo->tbo.resv->lock) &&
951 !bo->pin_count); 958 !bo->pin_count);
952 959