diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c index 9735f4968b86..210e8d43bb23 100644 --- a/drivers/gpu/drm/radeon/radeon_gem.c +++ b/drivers/gpu/drm/radeon/radeon_gem.c @@ -88,7 +88,7 @@ static void radeon_gem_object_free(struct drm_gem_object *gobj) if (robj) { radeon_mn_unregister(robj); - ttm_bo_put(&robj->tbo); + radeon_bo_unref(&robj); } } diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c index d0e4b43d155c..450ff7daa46c 100644 --- a/drivers/gpu/drm/radeon/radeon_object.c +++ b/drivers/gpu/drm/radeon/radeon_object.c @@ -256,15 +256,18 @@ struct radeon_bo *radeon_bo_ref(struct radeon_bo *bo) if (bo == NULL) return NULL; - drm_gem_object_get(&bo->tbo.base); + ttm_bo_get(&bo->tbo); return bo; } void radeon_bo_unref(struct radeon_bo **bo) { + struct ttm_buffer_object *tbo; + if ((*bo) == NULL) return; - drm_gem_object_put(&(*bo)->tbo.base); + tbo = &((*bo)->tbo); + ttm_bo_put(tbo); *bo = NULL; }