From: Fancy Fang Date: Fri, 12 Apr 2019 07:42:50 +0000 (+0800) Subject: MLK-21380 video: fbdev: mxsfb: fix resume timing for overlay fb X-Git-Tag: rel_imx_4.19.35_1.1.0~714 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=526042ffcf252b2296a0f617cddba9aef24fdf1e;p=linux.git MLK-21380 video: fbdev: mxsfb: fix resume timing for overlay fb 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 (cherry picked from commit f39662a3a38a2da082d55a006e634766cc85e347) --- diff --git a/drivers/video/fbdev/mxsfb.c b/drivers/video/fbdev/mxsfb.c index 55cb7d94bb84..3403f730cfe9 100644 --- a/drivers/video/fbdev/mxsfb.c +++ b/drivers/video/fbdev/mxsfb.c @@ -4,7 +4,7 @@ * This code is based on: * Author: Vitaly Wool * - * 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;