From: Nicolai Hähnle Date: Thu, 15 Dec 2016 16:04:51 +0000 (+0100) Subject: drm/amd/amdgpu: add amdgpu_bo_gpu_accessible helper function X-Git-Tag: v4.14-rc1~1422^2~31^2~59 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b99f31030a50f6bb0d1e5e67a966ec1b0f5942a8;p=platform%2Fkernel%2Flinux-rpi3.git drm/amd/amdgpu: add amdgpu_bo_gpu_accessible helper function Signed-off-by: Nicolai Hähnle Reviewed-by: Chunming Zhou Reviewed-by: Christian König Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h index 4306b2f..15a723a 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) return drm_vma_node_offset_addr(&bo->tbo.vma_node); } +/** + * amdgpu_bo_gpu_accessible - return whether the bo is currently in memory that + * is accessible to the GPU. + */ +static inline bool amdgpu_bo_gpu_accessible(struct amdgpu_bo *bo) +{ + return bo->tbo.mem.mem_type != TTM_PL_SYSTEM; +} + int amdgpu_bo_create(struct amdgpu_device *adev, unsigned long size, int byte_align, bool kernel, u32 domain, u64 flags,