aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
diff options
context:
space:
mode:
authorAndres Rodriguez <[email protected]>2017-09-16 01:05:19 +0000
committerAlex Deucher <[email protected]>2017-10-09 20:30:19 +0000
commitb82485fd384a56c27fae44e649552eca6334237a (patch)
treee76d630f2fe71fa5a435f7abb0e45f0ac005ba7e /drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
parentdrm/amdgpu: add VM support for huge pages v2 (diff)
downloadkernel-b82485fd384a56c27fae44e649552eca6334237a.tar.gz
kernel-b82485fd384a56c27fae44e649552eca6334237a.zip
drm/amdgpu: add helper to convert a ttm bo to amdgpu_bo
Reviewed-by: Christian König <[email protected]> Signed-off-by: Andres Rodriguez <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.h')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_object.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
index 39b6bf6fb051..c26ef53604af 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
@@ -94,6 +94,11 @@ struct amdgpu_bo {
};
};
+static inline struct amdgpu_bo *ttm_to_amdgpu_bo(struct ttm_buffer_object *tbo)
+{
+ return container_of(tbo, struct amdgpu_bo, tbo);
+}
+
/**
* amdgpu_mem_type_to_domain - return domain corresponding to mem_type
* @mem_type: ttm memory type