Commit 9af20792 authored by Daniel Vetter's avatar Daniel Vetter Committed by Alex Deucher

drm/radeon: fix fence locking in the pageflip callback

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: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 2c385151
...@@ -378,8 +378,12 @@ static int radeon_crtc_page_flip(struct drm_crtc *crtc, ...@@ -378,8 +378,12 @@ static int radeon_crtc_page_flip(struct drm_crtc *crtc,
work->old_rbo = rbo; work->old_rbo = rbo;
obj = new_radeon_fb->obj; obj = new_radeon_fb->obj;
rbo = gem_to_radeon_bo(obj); rbo = gem_to_radeon_bo(obj);
spin_lock(&rbo->tbo.bdev->fence_lock);
if (rbo->tbo.sync_obj) if (rbo->tbo.sync_obj)
work->fence = radeon_fence_ref(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); INIT_WORK(&work->work, radeon_unpin_work_func);
/* We borrow the event spin lock for protecting unpin_work */ /* We borrow the event spin lock for protecting unpin_work */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment