From: Christian König Date: Tue, 15 Dec 2015 10:10:30 +0000 (+0100) Subject: drm/amdgpu: add warning to amdgpu_bo_gpu_offset() v2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=191caba6cc4c95ba282304a10a2a9cba85450317;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm/amdgpu: add warning to amdgpu_bo_gpu_offset() v2 Check if there really is a valid offset for the BO. v2: user WARN_ON_ONCE Signed-off-by: Christian König Reviewed-by: Michel Dänzer Reviewed-by: Alex Deucher (v1) 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 ea756e77b023..5107fb291bdb 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h @@ -96,6 +96,7 @@ static inline void amdgpu_bo_unreserve(struct amdgpu_bo *bo) */ static inline u64 amdgpu_bo_gpu_offset(struct amdgpu_bo *bo) { + WARN_ON_ONCE(bo->tbo.mem.mem_type == TTM_PL_SYSTEM); return bo->tbo.offset; }