diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_display.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_display.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index 5ed617056b9c..8fc362aa6a1a 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c | |||
@@ -66,7 +66,8 @@ static void avivo_crtc_load_lut(struct drm_crtc *crtc) | |||
66 | (radeon_crtc->lut_b[i] << 0)); | 66 | (radeon_crtc->lut_b[i] << 0)); |
67 | } | 67 | } |
68 | 68 | ||
69 | WREG32(AVIVO_D1GRPH_LUT_SEL + radeon_crtc->crtc_offset, radeon_crtc->crtc_id); | 69 | /* Only change bit 0 of LUT_SEL, other bits are set elsewhere */ |
70 | WREG32_P(AVIVO_D1GRPH_LUT_SEL + radeon_crtc->crtc_offset, radeon_crtc->crtc_id, ~1); | ||
70 | } | 71 | } |
71 | 72 | ||
72 | static void dce4_crtc_load_lut(struct drm_crtc *crtc) | 73 | static void dce4_crtc_load_lut(struct drm_crtc *crtc) |
@@ -357,8 +358,9 @@ void radeon_crtc_handle_flip(struct radeon_device *rdev, int crtc_id) | |||
357 | 358 | ||
358 | spin_unlock_irqrestore(&rdev->ddev->event_lock, flags); | 359 | spin_unlock_irqrestore(&rdev->ddev->event_lock, flags); |
359 | 360 | ||
361 | drm_vblank_put(rdev->ddev, radeon_crtc->crtc_id); | ||
360 | radeon_fence_unref(&work->fence); | 362 | radeon_fence_unref(&work->fence); |
361 | radeon_irq_kms_pflip_irq_get(rdev, work->crtc_id); | 363 | radeon_irq_kms_pflip_irq_put(rdev, work->crtc_id); |
362 | queue_work(radeon_crtc->flip_queue, &work->unpin_work); | 364 | queue_work(radeon_crtc->flip_queue, &work->unpin_work); |
363 | } | 365 | } |
364 | 366 | ||
@@ -459,6 +461,12 @@ static void radeon_flip_work_func(struct work_struct *__work) | |||
459 | base &= ~7; | 461 | base &= ~7; |
460 | } | 462 | } |
461 | 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 | |||
462 | /* We borrow the event spin lock for protecting flip_work */ | 470 | /* We borrow the event spin lock for protecting flip_work */ |
463 | spin_lock_irqsave(&crtc->dev->event_lock, flags); | 471 | spin_lock_irqsave(&crtc->dev->event_lock, flags); |
464 | 472 | ||
@@ -473,6 +481,16 @@ static void radeon_flip_work_func(struct work_struct *__work) | |||
473 | 481 | ||
474 | return; | 482 | return; |
475 | 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 | |||
476 | cleanup: | 494 | cleanup: |
477 | drm_gem_object_unreference_unlocked(&work->old_rbo->gem_base); | 495 | drm_gem_object_unreference_unlocked(&work->old_rbo->gem_base); |
478 | radeon_fence_unref(&work->fence); | 496 | radeon_fence_unref(&work->fence); |