MLK-21380 video: fbdev: mxsfb: fix resume timing for overlay fb
authorFancy Fang <chen.fang@nxp.com>
Fri, 12 Apr 2019 07:42:50 +0000 (15:42 +0800)
committerFancy Fang <chen.fang@nxp.com>
Fri, 19 Apr 2019 07:46:22 +0000 (15:46 +0800)
The overlay fb can only be enabled when the LCDIF is not in
running, otherwise overlay display may look like image shift.
So during the system resume procedure, the overlay fb should
be resumed before mxsfb unblank.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit f39662a3a38a2da082d55a006e634766cc85e347)

drivers/video/fbdev/mxsfb.c

index 55cb7d9..3403f73 100644 (file)
@@ -4,7 +4,7 @@
  * This code is based on:
  * Author: Vitaly Wool <vital@embeddedalley.com>
  *
- * Copyright 2017 NXP
+ * Copyright 2017-2019 NXP
  * Copyright 2008-2015 Freescale Semiconductor, Inc. All Rights Reserved.
  * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
  *
@@ -2148,6 +2148,9 @@ static void mxsfb_overlay_resume(struct mxsfb_info *fbi)
                clk_enable_disp_axi(fbi);
        }
 
+       /* Pull LCDIF out of reset */
+       writel(0xc0000000, fbi->base + LCDC_CTRL + REG_CLR);
+
        writel(saved_as_ctrl, fbi->base + LCDC_AS_CTRL);
        writel(saved_as_next_buf, fbi->base + LCDC_AS_NEXT_BUF);
 
@@ -2463,9 +2466,9 @@ static int mxsfb_resume(struct device *pdev)
        pinctrl_pm_select_default_state(pdev);
 
        console_lock();
+       mxsfb_overlay_resume(host);
        mxsfb_blank(host->restore_blank, fb_info);
        fb_set_suspend(fb_info, 0);
-       mxsfb_overlay_resume(host);
        console_unlock();
 
        return 0;