Skip to content

Commit e8e8962

Browse files
danvetairlied
authored andcommitted
drm/ttm: fix fence locking in ttm_buffer_object_transfer
Noticed while reviewing the fence locking in the radeon pageflip handler. v2: Instead of grabbing the bdev->fence_lock in object_transfer just move the single callsite of that function a few lines, so that it is protected by the fence_lock. Suggested by Jerome Glisse. v3: Fix typo in commit message. Reviewed-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Dave Airlie <airlied@redhat.com>
1 parent c75be25 commit e8e8962

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/gpu/drm/ttm/ttm_bo_util.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,11 +654,13 @@ int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo,
654654
*/
655655

656656
set_bit(TTM_BO_PRIV_FLAG_MOVING, &bo->priv_flags);
657+
658+
/* ttm_buffer_object_transfer accesses bo->sync_obj */
659+
ret = ttm_buffer_object_transfer(bo, &ghost_obj);
657660
spin_unlock(&bdev->fence_lock);
658661
if (tmp_obj)
659662
driver->sync_obj_unref(&tmp_obj);
660663

661-
ret = ttm_buffer_object_transfer(bo, &ghost_obj);
662664
if (ret)
663665
return ret;
664666

0 commit comments

Comments
 (0)