OMAPDSS: reload gamma table during context restore
authorGrazvydas Ignotas <notasas@gmail.com>
Sat, 23 Jul 2016 22:49:33 +0000 (01:49 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Sat, 23 Jul 2016 22:49:33 +0000 (01:49 +0300)
also flush posted write after irq enable

drivers/video/omap2/dss/dispc.c

index c86bd06..f1a09ed 100644 (file)
@@ -288,6 +288,7 @@ static void dispc_save_context(void)
 static void dispc_restore_context(void)
 {
        int i, j, ctx;
 static void dispc_restore_context(void)
 {
        int i, j, ctx;
+       u32 val;
 
        DSSDBG("dispc_restore_context\n");
 
 
        DSSDBG("dispc_restore_context\n");
 
@@ -392,6 +393,12 @@ static void dispc_restore_context(void)
        if (dss_has_feature(FEAT_CORE_CLK_DIV))
                RR(DIVISOR);
 
        if (dss_has_feature(FEAT_CORE_CLK_DIV))
                RR(DIVISOR);
 
+       /* if gamma table is on, be sure to reload it */
+       val = dispc_read_reg(DISPC_CONFIG);
+       if (FLD_GET(val, 3, 3) &&
+           FLD_GET(val, 2, 1) == OMAP_DSS_LOAD_FRAME_ONLY)
+               dispc_set_loadmode(OMAP_DSS_LOAD_CLUT_ONCE_FRAME);
+
        /* enable last, because LCD & DIGIT enable are here */
        RR(CONTROL);
        if (dss_has_feature(FEAT_MGR_LCD2))
        /* enable last, because LCD & DIGIT enable are here */
        RR(CONTROL);
        if (dss_has_feature(FEAT_MGR_LCD2))
@@ -405,6 +412,9 @@ static void dispc_restore_context(void)
         */
        RR(IRQENABLE);
 
         */
        RR(IRQENABLE);
 
+       /* flush posted write */
+       dispc_read_reg(DISPC_IRQENABLE);
+
        DSSDBG("context restored\n");
 }
 
        DSSDBG("context restored\n");
 }