MLK-22653-2 drm/imx: dpu: crtc: Do not send out bogus vblank event in ->atomic_disable()
authorLiu Ying <victor.liu@nxp.com>
Fri, 20 Sep 2019 09:42:05 +0000 (17:42 +0800)
committerLiu Ying <victor.liu@nxp.com>
Thu, 26 Sep 2019 01:44:15 +0000 (09:44 +0800)
When a full modeset is needed, the CRTC could be totally disabled or
enabled/re-enabled after the modeset.  If it's re-enabled, a vblank
event would be sent during the CRTC enablement procedure.  So, a bogus
event should be killed in the ->atomic_disable() callback.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
(cherry picked from commit cee2d80af5e38fb022973c023f548ff02a515882)

drivers/gpu/drm/imx/dpu/dpu-crtc.c

index b23c198..6fc081c 100644 (file)
@@ -315,7 +315,7 @@ static void dpu_crtc_atomic_disable(struct drm_crtc *crtc,
 
        WARN_ON(!crtc->state->event);
 
-       if (crtc->state->event) {
+       if (crtc->state->event && !crtc->state->active) {
                spin_lock_irq(&crtc->dev->event_lock);
                drm_crtc_send_vblank_event(crtc, crtc->state->event);
                spin_unlock_irq(&crtc->dev->event_lock);