drm/amdgpu: add warning to amdgpu_bo_gpu_offset() v2
authorChristian König <christian.koenig@amd.com>
Tue, 15 Dec 2015 10:10:30 +0000 (11:10 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 8 Jan 2016 20:39:28 +0000 (15:39 -0500)
Check if there really is a valid offset for the BO.

v2: user WARN_ON_ONCE

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_object.h

index ea756e77b0232bcc131a90258b4ea454e1bc92e1..5107fb291bdbe9980a64e025bf1d88da4f1f046c 100644 (file)
@@ -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;
 }