drm/exynos/decon5433: handle vblank in vblank interrupt
authorAndrzej Hajda <a.hajda@samsung.com>
Fri, 29 Apr 2016 13:42:47 +0000 (15:42 +0200)
committerInki Dae <daeinki@gmail.com>
Tue, 10 May 2016 14:11:39 +0000 (23:11 +0900)
vblank should be signaled to userspace after reading framebuffers not before,
signaling it in TE interrupt looks wrong. TE triggers reading framebuffers
so it is the worst moment. Tearing is not observable because hardware prevents
it, but there are frequently skipped vblank events.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
drivers/gpu/drm/exynos/exynos5433_drm_decon.c

index 4ab5bfc236477ccea9b9a9f10c417935c96ec76b..cb6519b49f23064cbf346464dfb1857e1f81d101 100644 (file)
@@ -439,8 +439,6 @@ static void decon_te_irq_handler(struct exynos_drm_crtc *crtc)
 
        if (test_and_clear_bit(BIT_WIN_UPDATED, &ctx->flags))
                decon_set_bits(ctx, DECON_TRIGCON, TRIGCON_SWTRIGCMD, ~0);
-
-       drm_crtc_handle_vblank(&ctx->crtc->base);
 }
 
 static void decon_clear_channels(struct exynos_drm_crtc *crtc)
@@ -573,6 +571,7 @@ static irqreturn_t decon_irq_handler(int irq, void *dev_id)
 
                /* clear */
                writel(val, ctx->addr + DECON_VIDINTCON1);
+               drm_crtc_handle_vblank(&ctx->crtc->base);
        }
 
 out: