drm/exynos/decon5433: update shadow registers iff there are active windows
authorAndrzej Hajda <a.hajda@samsung.com>
Tue, 9 Aug 2016 08:44:25 +0000 (10:44 +0200)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 14 Dec 2016 04:52:22 +0000 (13:52 +0900)
Improper usage of DECON_UPDATE register leads to subtle errors.
If it set in decon_commit when there are no active windows it results
in slow registry updates - all subsequent shadow registry updates takes more
than full vblank. On the other side if it is not set when there are
active windows it results in garbage on the screen after suspend/resume of
FB console.

The patch hopefully fixes it.

Change-Id: I3cbd68f9af5748f74c5a878de34b6b531aa26074
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
drivers/gpu/drm/exynos/exynos5433_drm_decon.c

index 0d6c368..e3cc259 100644 (file)
@@ -176,9 +176,11 @@ static void decon_wait_for_update(struct decon_context *ctx)
 static void decon_commit(struct exynos_drm_crtc *crtc)
 {
        struct decon_context *ctx = crtc->ctx;
+       struct exynos5433_decon_driver_data *drv_data = ctx->drv_data;
        struct drm_display_mode *mode = &crtc->base.mode;
        bool interlaced = false;
        u32 val;
+       int win;
 
        if (ctx->suspended)
                return;
@@ -254,7 +256,14 @@ static void decon_commit(struct exynos_drm_crtc *crtc)
        }
        /* enable output and display signal */
        decon_set_bits(ctx, DECON_VIDCON0, VIDCON0_ENVID | VIDCON0_ENVID_F, ~0);
-       decon_update(ctx);
+
+       /* update iff there are active windows */
+       for (win = drv_data->first_win; win < WINDOWS_NR; win++) {
+               if (ctx->planes[win].enabled) {
+                       decon_update(ctx);
+                       break;
+               }
+       }
 }
 
 #define BIT_VAL(x, e, s)       (((x) & ((1 << ((e) - (s) + 1)) - 1)) << (s))