[PATCH 3/8] drm/loongson: use GEM references instead of TTMs

Daniel Vetter daniel.vetter at ffwll.ch
Thu Jul 25 12:03:36 UTC 2024


On Tue, Jul 23, 2024 at 02:17:45PM +0200, Christian König wrote:
> Instead of a TTM reference grab a GEM reference whenever necessary.
> 
> Signed-off-by: Christian König <christian.koenig at amd.com>
> Cc: Sui Jingfeng <suijingfeng at loongson.cn>

Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>

> ---
>  drivers/gpu/drm/loongson/lsdc_ttm.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/loongson/lsdc_ttm.c b/drivers/gpu/drm/loongson/lsdc_ttm.c
> index 465f622ac05d..2e42c6970c9f 100644
> --- a/drivers/gpu/drm/loongson/lsdc_ttm.c
> +++ b/drivers/gpu/drm/loongson/lsdc_ttm.c
> @@ -341,16 +341,12 @@ void lsdc_bo_unpin(struct lsdc_bo *lbo)
>  
>  void lsdc_bo_ref(struct lsdc_bo *lbo)
>  {
> -	struct ttm_buffer_object *tbo = &lbo->tbo;
> -
> -	ttm_bo_get(tbo);
> +	drm_gem_object_get(&lbo->tbo.base);
>  }
>  
>  void lsdc_bo_unref(struct lsdc_bo *lbo)
>  {
> -	struct ttm_buffer_object *tbo = &lbo->tbo;
> -
> -	ttm_bo_put(tbo);
> +	drm_gem_object_put(&lbo->tbo.base);
>  }
>  
>  int lsdc_bo_kmap(struct lsdc_bo *lbo)
> -- 
> 2.34.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the dri-devel mailing list