summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2022-09-07 11:56:22 +0200
committerChristian König <christian.koenig@amd.com>2022-09-08 09:50:21 +0200
commite3d3fd1cea22ada5a06284d7bbb6cd5794d8545a (patch)
tree7f52621a705ec66b3ef09bbfed3dc8eb1271e5d6
parentd91c411c744b55e860fbafc9a499f4f22d64c762 (diff)
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 <christian.koenig@amd.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220907100051.570641-1-christian.koenig@amd.com Fixes: d91c411c744b ("drm/ttm: update bulk move object of ghost BO")
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo_util.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
index 57a27847206f..911141d16e95 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
@@ -236,6 +236,11 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo,
if (bo->type != ttm_bo_type_sg)
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) {
ttm_resource_set_bo(fbo->base.resource, &fbo->base);
bo->resource = NULL;
@@ -244,11 +249,6 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo,
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);
if (ret) {
kfree(fbo);