From 90f633305e24ae543f258f7aea3dd6015d0cd912 Mon Sep 17 00:00:00 2001 From: Siddhartha Agrawal Date: Fri, 15 Feb 2013 20:32:52 -0800 Subject: [PATCH] msm_fb: display: Send pixel data while sending on/off commands To avoid LCD off sequence violeation for some LCD vendors, we need to keep sending video data during off/sleep commands. This fixes issues seen while going to a suspend. Crs-Fixed: 445707 Change-Id: I0ba2704502e8959d0f82deea60481cd5b1f0be20 Signed-off-by: Siddhartha Agrawal --- drivers/video/msm/mdp.c | 21 ++++++++++++++++----- drivers/video/msm/mdp4.h | 6 ++++++ drivers/video/msm/mdp4_overlay_dsi_video.c | 22 +++++++++++++--------- 3 files changed, 35 insertions(+), 14 deletions(-) diff --git a/drivers/video/msm/mdp.c b/drivers/video/msm/mdp.c index ad9d021d11a9..2b4bc830fe83 100644 --- a/drivers/video/msm/mdp.c +++ b/drivers/video/msm/mdp.c @@ -2377,6 +2377,22 @@ static int mdp_on(struct platform_device *pdev) pr_debug("%s:+\n", __func__); + if (!(mfd->cont_splash_done)) { + if (mfd->panel.type == MIPI_VIDEO_PANEL) + mdp4_dsi_video_splash_done(); + + /* Clks are enabled in probe. + Disabling clocks now */ + mdp_clk_ctrl(0); + mfd->cont_splash_done = 1; + } + + mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_ON, FALSE); + + ret = panel_next_on(pdev); + mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_OFF, FALSE); + + if (mdp_rev >= MDP_REV_40) { mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_ON, FALSE); mdp_clk_ctrl(1); @@ -2405,11 +2421,6 @@ static int mdp_on(struct platform_device *pdev) atomic_set(&vsync_cntrl.suspend, 1); } - mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_ON, FALSE); - - ret = panel_next_on(pdev); - mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_OFF, FALSE); - mdp_histogram_ctrl_all(TRUE); if (ret == 0) diff --git a/drivers/video/msm/mdp4.h b/drivers/video/msm/mdp4.h index 3fe4cbb3e9f1..e92f59556861 100644 --- a/drivers/video/msm/mdp4.h +++ b/drivers/video/msm/mdp4.h @@ -783,6 +783,7 @@ int mdp4_dsi_cmd_on(struct platform_device *pdev); int mdp4_dsi_cmd_off(struct platform_device *pdev); int mdp4_dsi_video_off(struct platform_device *pdev); int mdp4_dsi_video_on(struct platform_device *pdev); +int mdp4_dsi_video_splash_done(void); void mdp4_primary_vsync_dsi_video(void); void mdp4_dsi_cmd_base_swap(int cndx, struct mdp4_overlay_pipe *pipe); void mdp4_dsi_cmd_wait4vsync(int cndx); @@ -851,6 +852,11 @@ static inline void mdp4_overlay_dsi_video_start(void) { /* empty */ } + +static int mdp4_dsi_video_splash_done(void) +{ +} + #ifdef CONFIG_FB_MSM_MDP40 static inline void mdp_dsi_cmd_overlay_suspend(struct msm_fb_data_type *mfd) { diff --git a/drivers/video/msm/mdp4_overlay_dsi_video.c b/drivers/video/msm/mdp4_overlay_dsi_video.c index c8102e20b273..cff788b88e47 100644 --- a/drivers/video/msm/mdp4_overlay_dsi_video.c +++ b/drivers/video/msm/mdp4_overlay_dsi_video.c @@ -500,6 +500,19 @@ static void mdp4_dsi_video_tg_off(struct vsycn_ctrl *vctrl) mdp4_dsi_video_wait4vsync(0); } +int mdp4_dsi_video_splash_done(void) +{ + struct vsycn_ctrl *vctrl; + int cndx = 0; + + vctrl = &vsync_ctrl_db[cndx]; + + mdp4_dsi_video_tg_off(vctrl); + mipi_dsi_controller_cfg(0); + + return 0; +} + int mdp4_dsi_video_on(struct platform_device *pdev) { int dsi_width; @@ -597,15 +610,6 @@ int mdp4_dsi_video_on(struct platform_device *pdev) atomic_set(&vctrl->suspend, 0); - if (!(mfd->cont_splash_done)) { - mfd->cont_splash_done = 1; - mdp4_dsi_video_tg_off(vctrl); - mipi_dsi_controller_cfg(0); - /* Clks are enabled in probe. - Disabling clocks now */ - mdp_clk_ctrl(0); - } - pipe->src_height = fbi->var.yres; pipe->src_width = fbi->var.xres; pipe->src_h = fbi->var.yres;