drm/amdgpu: fix amdgpu_bo_gpu_accessible()
authorChristian König <christian.koenig@amd.com>
Thu, 13 Jul 2017 10:21:00 +0000 (12:21 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 14 Jul 2017 15:06:46 +0000 (11:06 -0400)
The test was relaxed a bit to much.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-and-Tested-by: Roger He <Hongbo.He@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_object.h

index 382485115b0641b059602d21fa92be33281ac8de..833b172a2c2a8b6cae6ca3b6dba3054ba35ba15b 100644 (file)
@@ -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,