Commit b73cd1e2 authored by Christian König's avatar Christian König

drm/ttm: stop destroying pinned ghost object

Daniel added a warning for this, but we were abusing that behavior here.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Fixes: 57fcd550 ("drm/ttm: Warn on pinning without holding a reference")
Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/series/84456/
parent 551620f2
...@@ -310,7 +310,7 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo, ...@@ -310,7 +310,7 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo,
kref_init(&fbo->base.kref); kref_init(&fbo->base.kref);
fbo->base.destroy = &ttm_transfered_destroy; fbo->base.destroy = &ttm_transfered_destroy;
fbo->base.acc_size = 0; fbo->base.acc_size = 0;
fbo->base.pin_count = 1; fbo->base.pin_count = 0;
if (bo->type != ttm_bo_type_sg) if (bo->type != ttm_bo_type_sg)
fbo->base.base.resv = &fbo->base.base._resv; fbo->base.base.resv = &fbo->base.base._resv;
...@@ -319,6 +319,8 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo, ...@@ -319,6 +319,8 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo,
ret = dma_resv_trylock(&fbo->base.base._resv); ret = dma_resv_trylock(&fbo->base.base._resv);
WARN_ON(!ret); WARN_ON(!ret);
ttm_bo_move_to_lru_tail_unlocked(&fbo->base);
*new_obj = &fbo->base; *new_obj = &fbo->base;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment