diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-12-18 22:25:11 +0100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2013-01-08 18:35:31 +1000 |
commit | e8e89622ed361c46bf90ba4828e685a8b603f7e5 (patch) | |
tree | 76504439c1af179c0aa7377e45b38e5503dffd48 /drivers/gpu | |
parent | c75be2592c350035ce871624ebf549b4609aeeab (diff) | |
download | linux-e8e89622ed361c46bf90ba4828e685a8b603f7e5.tar.bz2 |
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>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo_util.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c index 9e9c5d2a5c74..d73d6e3e17b2 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_util.c +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c @@ -654,11 +654,13 @@ int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo, */ set_bit(TTM_BO_PRIV_FLAG_MOVING, &bo->priv_flags); + + /* ttm_buffer_object_transfer accesses bo->sync_obj */ + ret = ttm_buffer_object_transfer(bo, &ghost_obj); spin_unlock(&bdev->fence_lock); if (tmp_obj) driver->sync_obj_unref(&tmp_obj); - ret = ttm_buffer_object_transfer(bo, &ghost_obj); if (ret) return ret; |