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

drm/ttm: cleanup the resource of ghost objects after locking them

Otherwise lockdep will complain about cleaning up the bulk_move.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarMatthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220907100051.570641-1-christian.koenig@amd.com
Fixes: d91c411c ("drm/ttm: update bulk move object of ghost BO")
parent d91c411c
...@@ -236,6 +236,11 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo, ...@@ -236,6 +236,11 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo,
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;
dma_resv_init(&fbo->base.base._resv);
fbo->base.base.dev = NULL;
ret = dma_resv_trylock(&fbo->base.base._resv);
WARN_ON(!ret);
if (fbo->base.resource) { if (fbo->base.resource) {
ttm_resource_set_bo(fbo->base.resource, &fbo->base); ttm_resource_set_bo(fbo->base.resource, &fbo->base);
bo->resource = NULL; bo->resource = NULL;
...@@ -244,11 +249,6 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo, ...@@ -244,11 +249,6 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo,
fbo->base.bulk_move = NULL; fbo->base.bulk_move = NULL;
} }
dma_resv_init(&fbo->base.base._resv);
fbo->base.base.dev = NULL;
ret = dma_resv_trylock(&fbo->base.base._resv);
WARN_ON(!ret);
ret = dma_resv_reserve_fences(&fbo->base.base._resv, 1); ret = dma_resv_reserve_fences(&fbo->base.base._resv, 1);
if (ret) { if (ret) {
kfree(fbo); kfree(fbo);
......
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