drm/exynos/mixer: correct vsync configuration sequence
authorAndrzej Hajda <[email protected]>
Thu, 9 Jul 2015 06:25:40 +0000 (08:25 +0200)
committerInki Dae <[email protected]>
Tue, 11 Aug 2015 08:21:35 +0000 (17:21 +0900)
Specification advises to clear vsync indicator before configuring vsync.

Signed-off-by: Andrzej Hajda <[email protected]>
Reviewed-by: Joonyoung Shim <[email protected]>
Signed-off-by: Inki Dae <[email protected]>
drivers/gpu/drm/exynos/exynos_mixer.c

index 25f0aac01a894380d973e84edbb149a6b073c95e..923aa75143bf011e66a7fd8a43e912abb02e39bb 100644 (file)
@@ -906,8 +906,8 @@ static int mixer_enable_vblank(struct exynos_drm_crtc *crtc)
        }
 
        /* enable vsync interrupt */
-       mixer_reg_writemask(res, MXR_INT_EN, MXR_INT_EN_VSYNC,
-                       MXR_INT_EN_VSYNC);
+       mixer_reg_writemask(res, MXR_INT_STATUS, ~0, MXR_INT_CLEAR_VSYNC);
+       mixer_reg_writemask(res, MXR_INT_EN, ~0, MXR_INT_EN_VSYNC);
 
        return 0;
 }
@@ -918,6 +918,7 @@ static void mixer_disable_vblank(struct exynos_drm_crtc *crtc)
        struct mixer_resources *res = &mixer_ctx->mixer_res;
 
        /* disable vsync interrupt */
+       mixer_reg_writemask(res, MXR_INT_STATUS, ~0, MXR_INT_CLEAR_VSYNC);
        mixer_reg_writemask(res, MXR_INT_EN, 0, MXR_INT_EN_VSYNC);
 }
 
@@ -1046,6 +1047,8 @@ static void mixer_enable(struct exynos_drm_crtc *crtc)
 
        mixer_reg_writemask(res, MXR_STATUS, ~0, MXR_STATUS_SOFT_RESET);
 
+       if (ctx->int_en & MXR_INT_EN_VSYNC)
+               mixer_reg_writemask(res, MXR_INT_STATUS, ~0, MXR_INT_CLEAR_VSYNC);
        mixer_reg_write(res, MXR_INT_EN, ctx->int_en);
        mixer_win_reset(ctx);
 }