diff options
author | Andres Rodriguez <andresx7@gmail.com> | 2017-09-15 21:05:19 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-10-09 16:30:19 -0400 |
commit | b82485fd384a56c27fae44e649552eca6334237a (patch) | |
tree | e76d630f2fe71fa5a435f7abb0e45f0ac005ba7e /drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | |
parent | 9fc8fc709b356c85034cbcb3b84c9d8b77865f52 (diff) |
drm/amdgpu: add helper to convert a ttm bo to amdgpu_bo
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Andres Rodriguez <andresx7@gmail.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.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index 6982baeccd14..8b4ed8a98a18 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | |||
@@ -40,9 +40,7 @@ | |||
40 | static void amdgpu_ttm_bo_destroy(struct ttm_buffer_object *tbo) | 40 | static void amdgpu_ttm_bo_destroy(struct ttm_buffer_object *tbo) |
41 | { | 41 | { |
42 | struct amdgpu_device *adev = amdgpu_ttm_adev(tbo->bdev); | 42 | struct amdgpu_device *adev = amdgpu_ttm_adev(tbo->bdev); |
43 | struct amdgpu_bo *bo; | 43 | struct amdgpu_bo *bo = ttm_to_amdgpu_bo(tbo); |
44 | |||
45 | bo = container_of(tbo, struct amdgpu_bo, tbo); | ||
46 | 44 | ||
47 | amdgpu_bo_kunmap(bo); | 45 | amdgpu_bo_kunmap(bo); |
48 | 46 | ||
@@ -884,7 +882,7 @@ void amdgpu_bo_move_notify(struct ttm_buffer_object *bo, | |||
884 | if (!amdgpu_ttm_bo_is_amdgpu_bo(bo)) | 882 | if (!amdgpu_ttm_bo_is_amdgpu_bo(bo)) |
885 | return; | 883 | return; |
886 | 884 | ||
887 | abo = container_of(bo, struct amdgpu_bo, tbo); | 885 | abo = ttm_to_amdgpu_bo(bo); |
888 | amdgpu_vm_bo_invalidate(adev, abo, evict); | 886 | amdgpu_vm_bo_invalidate(adev, abo, evict); |
889 | 887 | ||
890 | amdgpu_bo_kunmap(abo); | 888 | amdgpu_bo_kunmap(abo); |
@@ -911,7 +909,7 @@ int amdgpu_bo_fault_reserve_notify(struct ttm_buffer_object *bo) | |||
911 | if (!amdgpu_ttm_bo_is_amdgpu_bo(bo)) | 909 | if (!amdgpu_ttm_bo_is_amdgpu_bo(bo)) |
912 | return 0; | 910 | return 0; |
913 | 911 | ||
914 | abo = container_of(bo, struct amdgpu_bo, tbo); | 912 | abo = ttm_to_amdgpu_bo(bo); |
915 | 913 | ||
916 | /* Remember that this BO was accessed by the CPU */ | 914 | /* Remember that this BO was accessed by the CPU */ |
917 | abo->flags |= AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED; | 915 | abo->flags |= AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED; |