diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-12-11 17:42:24 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2012-12-14 10:45:23 -0500 |
commit | 9af20792124850369e764965690b99b20623dfc4 (patch) | |
tree | f8cea8c80e4ae11b414d9e0f529ade0c51201e6f /drivers/gpu | |
parent | 2c385151ed6db8ded2faa3328f0377e6c5fa1e89 (diff) |
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: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_display.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index bfa2a6015727..310c0e5254ba 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c | |||
@@ -378,8 +378,12 @@ static int radeon_crtc_page_flip(struct drm_crtc *crtc, | |||
378 | work->old_rbo = rbo; | 378 | work->old_rbo = rbo; |
379 | obj = new_radeon_fb->obj; | 379 | obj = new_radeon_fb->obj; |
380 | rbo = gem_to_radeon_bo(obj); | 380 | rbo = gem_to_radeon_bo(obj); |
381 | |||
382 | spin_lock(&rbo->tbo.bdev->fence_lock); | ||
381 | if (rbo->tbo.sync_obj) | 383 | if (rbo->tbo.sync_obj) |
382 | work->fence = radeon_fence_ref(rbo->tbo.sync_obj); | 384 | work->fence = radeon_fence_ref(rbo->tbo.sync_obj); |
385 | spin_unlock(&rbo->tbo.bdev->fence_lock); | ||
386 | |||
383 | INIT_WORK(&work->work, radeon_unpin_work_func); | 387 | INIT_WORK(&work->work, radeon_unpin_work_func); |
384 | 388 | ||
385 | /* We borrow the event spin lock for protecting unpin_work */ | 389 | /* We borrow the event spin lock for protecting unpin_work */ |