drm/amdgpu: fix amdgpu_bo_gpu_accessible()

Submitted by He, Roger on July 13, 2017, 12:19 p.m.

Details

Message ID MWHPR1201MB0127A83A43B42D7CF2CE703AFDAC0@MWHPR1201MB0127.namprd12.prod.outlook.com
State New
Headers show
Series "drm/amdgpu: fix amdgpu_bo_gpu_accessible()" ( rev: 2 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

He, Roger July 13, 2017, 12:19 p.m.
Reviewed-and-Tested-by: Roger He <Hongbo.He@amd.com>

Thanks
Roger(Hongbo.He)
-----Original Message-----
From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf Of Christian K?nig

Sent: Thursday, July 13, 2017 6:23 PM
To: amd-gfx@lists.freedesktop.org
Cc: Huang, Ray <Ray.Huang@amd.com>
Subject: [PATCH] drm/amdgpu: fix amdgpu_bo_gpu_accessible()

From: Christian König <christian.koenig@amd.com>


The test was relaxed a bit to much.

Signed-off-by: Christian König <christian.koenig@amd.com>

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)


_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
index 3824851..833b172 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,
--
2.7.4

Comments

Seems to fix the regression I noticed on Carrizo.  Can add my Acked-By 
if you haven't pushed it already.

Cheers,
Tom

On 13/07/17 08:19 AM, He, Roger wrote:
> Reviewed-and-Tested-by: Roger He <Hongbo.He@amd.com>
> 
> Thanks
> Roger(Hongbo.He)
> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf Of Christian K?nig
> Sent: Thursday, July 13, 2017 6:23 PM
> To: amd-gfx@lists.freedesktop.org
> Cc: Huang, Ray <Ray.Huang@amd.com>
> Subject: [PATCH] drm/amdgpu: fix amdgpu_bo_gpu_accessible()
> 
> From: Christian König <christian.koenig@amd.com>
> 
> The test was relaxed a bit to much.
> 
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
> index 3824851..833b172 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,
> --
> 2.7.4
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
>