Skip to content

Commit

Permalink
drm/ttm: fix fence locking in ttm_buffer_object_transfer
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
  • Loading branch information
danvet authored and airlied committed Jan 8, 2013
1 parent c75be25 commit e8e8962
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/gpu/drm/ttm/ttm_bo_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit e8e8962

Please sign in to comment.