From: Christian König Date: Thu, 13 Jul 2017 10:21:00 +0000 (+0200) Subject: drm/amdgpu: fix amdgpu_bo_gpu_accessible() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=9d63c03444ac92d6412fd72429478b81a8378de7;p=openwrt%2Fstaging%2Fblogic.git drm/amdgpu: fix amdgpu_bo_gpu_accessible() The test was relaxed a bit to much. Signed-off-by: Christian König Acked-by: Tom St Denis Reviewed-and-Tested-by: Roger He 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 382485115b06..833b172a2c2a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h @@ -120,7 +120,11 @@ static inline u64 amdgpu_bo_mmap_offset(struct amdgpu_bo *bo) */ static inline bool amdgpu_bo_gpu_accessible(struct amdgpu_bo *bo) { - return bo->tbo.mem.mem_type != TTM_PL_SYSTEM; + switch (bo->tbo.mem.mem_type) { + case TTM_PL_TT: return amdgpu_ttm_is_bound(bo->tbo.ttm); + case TTM_PL_VRAM: return true; + default: return false; + } } int amdgpu_bo_create(struct amdgpu_device *adev,