Skip to content

Commit

Permalink
drm/radeon: fix fence locking in the pageflip callback
Browse files Browse the repository at this point in the history
We need to hold bdev->fence_lock while grabbing a reference to
the fence, to prevent concurrent clearing/changing of the
ttm_bo->sync_obj field.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Daniel Vetter authored and Alex Deucher committed Dec 14, 2012
1 parent 2c38515 commit 9af2079
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/gpu/drm/radeon/radeon_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,12 @@ static int radeon_crtc_page_flip(struct drm_crtc *crtc,
work->old_rbo = rbo;
obj = new_radeon_fb->obj;
rbo = gem_to_radeon_bo(obj);

spin_lock(&rbo->tbo.bdev->fence_lock);
if (rbo->tbo.sync_obj)
work->fence = radeon_fence_ref(rbo->tbo.sync_obj);
spin_unlock(&rbo->tbo.bdev->fence_lock);

INIT_WORK(&work->work, radeon_unpin_work_func);

/* We borrow the event spin lock for protecting unpin_work */
Expand Down

0 comments on commit 9af2079

Please sign in to comment.