1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00

drm/radeon: use GEM references instead of TTMs

Instead of a TTM reference grab a GEM reference whenever necessary.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Christian König 2024-07-11 15:25:06 +02:00 committed by Alex Deucher
parent dee44a7cb5
commit fd69ef0502
2 changed files with 3 additions and 6 deletions

View file

@ -88,7 +88,7 @@ static void radeon_gem_object_free(struct drm_gem_object *gobj)
if (robj) { if (robj) {
radeon_mn_unregister(robj); radeon_mn_unregister(robj);
radeon_bo_unref(&robj); ttm_bo_put(&robj->tbo);
} }
} }

View file

@ -256,18 +256,15 @@ struct radeon_bo *radeon_bo_ref(struct radeon_bo *bo)
if (bo == NULL) if (bo == NULL)
return NULL; return NULL;
ttm_bo_get(&bo->tbo); drm_gem_object_get(&bo->tbo.base);
return bo; return bo;
} }
void radeon_bo_unref(struct radeon_bo **bo) void radeon_bo_unref(struct radeon_bo **bo)
{ {
struct ttm_buffer_object *tbo;
if ((*bo) == NULL) if ((*bo) == NULL)
return; return;
tbo = &((*bo)->tbo); drm_gem_object_put(&(*bo)->tbo.base);
ttm_bo_put(tbo);
*bo = NULL; *bo = NULL;
} }