drm/exynos/decon5433: signal vblank only on odd fields
authorAndrzej Hajda <a.hajda@samsung.com>
Fri, 20 Jan 2017 06:52:24 +0000 (07:52 +0100)
committerInki Dae <inki.dae@samsung.com>
Tue, 7 Feb 2017 04:52:52 +0000 (13:52 +0900)
In case of interlace mode irq is generated for odd and even fields, but
vblank should be signaled only for the last emitted field.

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
include/video/exynos5433_decon.h

index b828480e81c580a52ac1d886aee35444b4716bff..0fd6f7a18364a69ba67cb000674593fc94041e19 100644 (file)
@@ -591,6 +591,13 @@ static irqreturn_t decon_irq_handler(int irq, void *dev_id)
 
        if (val) {
                writel(val, ctx->addr + DECON_VIDINTCON1);
+               if (ctx->out_type & IFTYPE_HDMI) {
+                       val = readl(ctx->addr + DECON_VIDOUTCON0);
+                       val &= VIDOUT_INTERLACE_EN_F | VIDOUT_INTERLACE_FIELD_F;
+                       if (val ==
+                           (VIDOUT_INTERLACE_EN_F | VIDOUT_INTERLACE_FIELD_F))
+                               return IRQ_HANDLED;
+               }
                drm_crtc_handle_vblank(&ctx->crtc->base);
        }
 
index b26511a0ddf87efb4114398a8d951b1fea7a100c..ef8e2a8ad0afc85da51bc3fca00a26fa3768ff16 100644 (file)
@@ -89,6 +89,7 @@
 #define VIDCON0_ENVID_F                        (1 << 0)
 
 /* VIDOUTCON0 */
+#define VIDOUT_INTERLACE_FIELD_F       (1 << 29)
 #define VIDOUT_INTERLACE_EN_F          (1 << 28)
 #define VIDOUT_LCD_ON                  (1 << 24)
 #define VIDOUT_IF_F_MASK               (0x3 << 20)