From ed4d4c32669769990ea8fcb47fa911eed58481df Mon Sep 17 00:00:00 2001 From: Grazvydas Ignotas Date: Sun, 24 Jul 2016 01:49:33 +0300 Subject: [PATCH] OMAPDSS: reload gamma table during context restore also flush posted write after irq enable --- drivers/video/omap2/dss/dispc.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index c86bd0653902..f1a09edd1fac 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c @@ -288,6 +288,7 @@ static void dispc_save_context(void) static void dispc_restore_context(void) { int i, j, ctx; + u32 val; 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 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)) @@ -405,6 +412,9 @@ static void dispc_restore_context(void) */ RR(IRQENABLE); + /* flush posted write */ + dispc_read_reg(DISPC_IRQENABLE); + DSSDBG("context restored\n"); } -- 2.39.2