Skip to content

Commit e3d3fd1

Browse files
drm/ttm: cleanup the resource of ghost objects after locking them
Otherwise lockdep will complain about cleaning up the bulk_move. Signed-off-by: Christian König <[email protected]> Reviewed-by: Matthew Auld <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Fixes: d91c411 ("drm/ttm: update bulk move object of ghost BO")
1 parent d91c411 commit e3d3fd1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/gpu/drm/ttm/ttm_bo_util.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,11 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo,
236236
if (bo->type != ttm_bo_type_sg)
237237
fbo->base.base.resv = &fbo->base.base._resv;
238238

239+
dma_resv_init(&fbo->base.base._resv);
240+
fbo->base.base.dev = NULL;
241+
ret = dma_resv_trylock(&fbo->base.base._resv);
242+
WARN_ON(!ret);
243+
239244
if (fbo->base.resource) {
240245
ttm_resource_set_bo(fbo->base.resource, &fbo->base);
241246
bo->resource = NULL;
@@ -244,11 +249,6 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo,
244249
fbo->base.bulk_move = NULL;
245250
}
246251

247-
dma_resv_init(&fbo->base.base._resv);
248-
fbo->base.base.dev = NULL;
249-
ret = dma_resv_trylock(&fbo->base.base._resv);
250-
WARN_ON(!ret);
251-
252252
ret = dma_resv_reserve_fences(&fbo->base.base._resv, 1);
253253
if (ret) {
254254
kfree(fbo);

0 commit comments

Comments
 (0)