diff options
author | Boris Brezillon <boris.brezillon@free-electrons.com> | 2017-06-16 10:30:33 +0200 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2017-06-21 10:27:04 -0700 |
commit | edeb729f7929d1372ab426a7f56fd0b337ba5751 (patch) | |
tree | 794a66edb057d472c1551adb36e1b965577ba7b3 /drivers/gpu/drm/vc4 | |
parent | 22a884cfe5a49b6fd63f10ff137906028b4cf923 (diff) | |
download | blackbird-op-linux-edeb729f7929d1372ab426a7f56fd0b337ba5751.tar.gz blackbird-op-linux-edeb729f7929d1372ab426a7f56fd0b337ba5751.zip |
drm/vc4: Send a VBLANK event when disabling a CRTC
VBLANK events are missed when the CRTC is being disabled because the
driver does not wait till the end of the frame before stopping the
HVS and PV blocks. In this case, we should explicitly issue a VBLANK
event if there's one waiting.
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: http://patchwork.freedesktop.org/patch/msgid/1497601833-24588-1-git-send-email-boris.brezillon@free-electrons.com
Diffstat (limited to 'drivers/gpu/drm/vc4')
-rw-r--r-- | drivers/gpu/drm/vc4/vc4_crtc.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c index e3f03efe719b..30a1df11e063 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c @@ -518,6 +518,19 @@ static void vc4_crtc_disable(struct drm_crtc *crtc) WARN_ON_ONCE((HVS_READ(SCALER_DISPSTATX(chan)) & (SCALER_DISPSTATX_FULL | SCALER_DISPSTATX_EMPTY)) != SCALER_DISPSTATX_EMPTY); + + /* + * Make sure we issue a vblank event after disabling the CRTC if + * someone was waiting it. + */ + if (crtc->state->event) { + unsigned long flags; + + spin_lock_irqsave(&dev->event_lock, flags); + drm_crtc_send_vblank_event(crtc, crtc->state->event); + crtc->state->event = NULL; + spin_unlock_irqrestore(&dev->event_lock, flags); + } } static void vc4_crtc_enable(struct drm_crtc *crtc) |