diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2014-06-17 06:12:03 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2014-06-18 16:30:49 -0400 |
commit | ca721b79377360a891a7d47ed091a79442d5cc7e (patch) | |
tree | 2e6914d4fe70582320058d14f64de5372d0f5b57 | |
parent | f2263fc79655e155d84baf4d475cf02caaf2f8fc (diff) |
Revert "drm/radeon: remove drm_vblank_get|put from pflip handling"
This reverts commit 75f36d861957cb05b7889af24c8cd4a789398304.
drm_vblank_get() is necessary to ensure the DRM vblank counter value is
up to date in drm_send_vblank_event().
Seems to fix weston hangs waiting for page flips to complete.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_display.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index 4db26420f38a..ef3b4d12294c 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c | |||
@@ -358,6 +358,7 @@ void radeon_crtc_handle_flip(struct radeon_device *rdev, int crtc_id) | |||
358 | 358 | ||
359 | spin_unlock_irqrestore(&rdev->ddev->event_lock, flags); | 359 | spin_unlock_irqrestore(&rdev->ddev->event_lock, flags); |
360 | 360 | ||
361 | drm_vblank_put(rdev->ddev, radeon_crtc->crtc_id); | ||
361 | radeon_fence_unref(&work->fence); | 362 | radeon_fence_unref(&work->fence); |
362 | radeon_irq_kms_pflip_irq_get(rdev, work->crtc_id); | 363 | radeon_irq_kms_pflip_irq_get(rdev, work->crtc_id); |
363 | queue_work(radeon_crtc->flip_queue, &work->unpin_work); | 364 | queue_work(radeon_crtc->flip_queue, &work->unpin_work); |
@@ -460,6 +461,12 @@ static void radeon_flip_work_func(struct work_struct *__work) | |||
460 | base &= ~7; | 461 | base &= ~7; |
461 | } | 462 | } |
462 | 463 | ||
464 | r = drm_vblank_get(crtc->dev, radeon_crtc->crtc_id); | ||
465 | if (r) { | ||
466 | DRM_ERROR("failed to get vblank before flip\n"); | ||
467 | goto pflip_cleanup; | ||
468 | } | ||
469 | |||
463 | /* We borrow the event spin lock for protecting flip_work */ | 470 | /* We borrow the event spin lock for protecting flip_work */ |
464 | spin_lock_irqsave(&crtc->dev->event_lock, flags); | 471 | spin_lock_irqsave(&crtc->dev->event_lock, flags); |
465 | 472 | ||
@@ -474,6 +481,16 @@ static void radeon_flip_work_func(struct work_struct *__work) | |||
474 | 481 | ||
475 | return; | 482 | return; |
476 | 483 | ||
484 | pflip_cleanup: | ||
485 | if (unlikely(radeon_bo_reserve(work->new_rbo, false) != 0)) { | ||
486 | DRM_ERROR("failed to reserve new rbo in error path\n"); | ||
487 | goto cleanup; | ||
488 | } | ||
489 | if (unlikely(radeon_bo_unpin(work->new_rbo) != 0)) { | ||
490 | DRM_ERROR("failed to unpin new rbo in error path\n"); | ||
491 | } | ||
492 | radeon_bo_unreserve(work->new_rbo); | ||
493 | |||
477 | cleanup: | 494 | cleanup: |
478 | drm_gem_object_unreference_unlocked(&work->old_rbo->gem_base); | 495 | drm_gem_object_unreference_unlocked(&work->old_rbo->gem_base); |
479 | radeon_fence_unref(&work->fence); | 496 | radeon_fence_unref(&work->fence); |