diff options
author | Christian König <christian.koenig@amd.com> | 2014-05-27 16:49:21 +0200 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2014-06-02 10:25:12 -0400 |
commit | 1a0e79184132c5dc0e03a4047eacecc52c24deae (patch) | |
tree | 38211a82699c5a0c38c5b14a29d95bfebba14be4 /drivers/gpu/drm/radeon/radeon_display.c | |
parent | 157fa14dc4065ce7536473e643c95385d87bd580 (diff) |
drm/radeon: separate vblank and pflip crtc handling
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_display.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_display.c | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index c52c18246ed..88e3cbe11da 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c @@ -276,7 +276,7 @@ static void radeon_unpin_work_func(struct work_struct *__work) kfree(work); } -void radeon_crtc_handle_flip(struct radeon_device *rdev, int crtc_id) +void radeon_crtc_handle_vblank(struct radeon_device *rdev, int crtc_id) { struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id]; struct radeon_unpin_work *work; @@ -302,7 +302,6 @@ void radeon_crtc_handle_flip(struct radeon_device *rdev, int crtc_id) * completion routine. */ update_pending = 0; - radeon_crtc->deferred_flip_completion = 0; } /* Has the pageflip already completed in crtc, or is it certain @@ -330,10 +329,40 @@ void radeon_crtc_handle_flip(struct radeon_device *rdev, int crtc_id) radeon_crtc->deferred_flip_completion = 1; spin_unlock_irqrestore(&rdev->ddev->event_lock, flags); return; + } else { + spin_unlock_irqrestore(&rdev->ddev->event_lock, flags); + radeon_crtc_handle_flip(rdev, crtc_id); + } +} + +/** + * radeon_crtc_handle_flip - page flip completed + * + * @rdev: radeon device pointer + * @crtc_id: crtc number this event is for + * + * Called when we are sure that a page flip for this crtc is completed. + */ +void radeon_crtc_handle_flip(struct radeon_device *rdev, int crtc_id) +{ + struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id]; + struct radeon_unpin_work *work; + unsigned long flags; + + /* this can happen at init */ + if (radeon_crtc == NULL) + return; + + spin_lock_irqsave(&rdev->ddev->event_lock, flags); + work = radeon_crtc->unpin_work; + if (work == NULL) { + spin_unlock_irqrestore(&rdev->ddev->event_lock, flags); + return; } /* Pageflip (will be) certainly completed in this vblank. Clean up. */ radeon_crtc->unpin_work = NULL; + radeon_crtc->deferred_flip_completion = 0; /* wakeup userspace */ if (work->event) |