drm/exynos: fix vsync interrupt clear rountine of mixer 38/42638/1 accepted/tizen/mobile/20150701.121014 accepted/tizen/tv/20150701.121409 accepted/tizen/wearable/20150701.122908 submit/tizen/20150701.072642
authorJoonyoung Shim <jy0922.shim@samsung.com>
Wed, 1 Jul 2015 04:14:57 +0000 (13:14 +0900)
committerJoonyoung Shim <jy0922.shim@samsung.com>
Wed, 1 Jul 2015 05:38:11 +0000 (14:38 +0900)
INT_EN_VSYNC bit is not used when we clear vsync interrupt but
INT_STATUS_VSYNC bit should be related.

Also, if we want to enable vsync interrupt, we should write 1 in
INT_CLEAR_VSYNC bit before we set INT_EN_VSYNC bit. It will clear prior
vsync interrupt. You can check it from exynos mixer user manual.

Change-Id: Ide955d5cb966e49883c51d8fab0eba51897bac7a
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
drivers/gpu/drm/exynos/exynos_mixer.c

index 8c55ec580f3609cf9c865a7ded087c750b8190e2..4def1460d18c38b77cfc2b36d06ff598fbcafc32 100644 (file)
@@ -765,15 +765,14 @@ static irqreturn_t mixer_irq_handler(int irq, void *arg)
                        atomic_set(&ctx->wait_vsync_event, 0);
                        wake_up(&ctx->wait_vsync_queue);
                }
-       }
 
 out:
-       /* clear interrupts */
-       if (~val & MXR_INT_EN_VSYNC) {
                /* vsync interrupt use different bit for read and clear */
-               val &= ~MXR_INT_EN_VSYNC;
+               val &= ~MXR_INT_STATUS_VSYNC;
                val |= MXR_INT_CLEAR_VSYNC;
        }
+
+       /* clear interrupts */
        mixer_reg_write(res, MXR_INT_STATUS, val);
 
        spin_unlock(&res->reg_slock);
@@ -931,6 +930,7 @@ static int mixer_enable_vblank(struct exynos_drm_crtc *crtc)
        }
 
        /* enable vsync interrupt */
+       mixer_reg_write(res, MXR_INT_STATUS, MXR_INT_CLEAR_VSYNC);
        mixer_reg_writemask(res, MXR_INT_EN, MXR_INT_EN_VSYNC,
                        MXR_INT_EN_VSYNC);