aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2016-12-15 11:04:51 -0500
committerAlex Deucher <alexander.deucher@amd.com>2017-01-27 11:13:17 -0500
commitb99f31030a50f6bb0d1e5e67a966ec1b0f5942a8 (patch)
tree57298d27f63ec79cecaf06a766b539031c4575ce /drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
parent661a7606c97b6e6a73f553b0a6b60f553d5afa77 (diff)
drm/amd/amdgpu: add amdgpu_bo_gpu_accessible helper function
Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Reviewed-by: Chunming Zhou <david1.zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.h')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_object.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
index 4306b2f2c8f0..15a723adca76 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
@@ -114,6 +114,15 @@ static inline u64 amdgpu_bo_mmap_offset(struct amdgpu_bo *bo)
114 return drm_vma_node_offset_addr(&bo->tbo.vma_node); 114 return drm_vma_node_offset_addr(&bo->tbo.vma_node);
115} 115}
116 116
117/**
118 * amdgpu_bo_gpu_accessible - return whether the bo is currently in memory that
119 * is accessible to the GPU.
120 */
121static inline bool amdgpu_bo_gpu_accessible(struct amdgpu_bo *bo)
122{
123 return bo->tbo.mem.mem_type != TTM_PL_SYSTEM;
124}
125
117int amdgpu_bo_create(struct amdgpu_device *adev, 126int amdgpu_bo_create(struct amdgpu_device *adev,
118 unsigned long size, int byte_align, 127 unsigned long size, int byte_align,
119 bool kernel, u32 domain, u64 flags, 128 bool kernel, u32 domain, u64 flags,