From 73ad29422967302571a1988b6411c4aab4785442 Mon Sep 17 00:00:00 2001 From: Rajkumar Subbiah Date: Fri, 17 Mar 2017 20:02:10 -0400 Subject: [PATCH] msm: mdss: Perform splash cleanup on slave control During continuous splash handoff on video mode panels, the cleanup is currently performed only on the master control. This causes occasional memory fault in dual control configurations. This change calls cleanup on both master and slave controls if applicable. Change-Id: If0bcad0686efd5f2aba0efa6992e1d348aca213f Signed-off-by: Rajkumar Subbiah --- drivers/video/fbdev/msm/mdss_mdp_intf_video.c | 71 +++++++++++++------ 1 file changed, 49 insertions(+), 22 deletions(-) diff --git a/drivers/video/fbdev/msm/mdss_mdp_intf_video.c b/drivers/video/fbdev/msm/mdss_mdp_intf_video.c index 97be2fd728c8..9b0985ef12e6 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_intf_video.c +++ b/drivers/video/fbdev/msm/mdss_mdp_intf_video.c @@ -1665,12 +1665,42 @@ static int mdss_mdp_video_display(struct mdss_mdp_ctl *ctl, void *arg) return 0; } +static int mdss_mdp_video_splash_handoff(struct mdss_mdp_ctl *ctl) +{ + int i, ret = 0; + u32 data, flush; + + ret = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_CONT_SPLASH_BEGIN, + NULL, CTL_INTF_EVENT_FLAG_DEFAULT); + + if (ret) { + pr_err("%s:ctl%d failed to handle 'CONT_SPLASH_BEGIN' event\n" + , __func__, ctl->num); + return ret; + } + + /* clear up mixer0 and mixer1 */ + flush = 0; + for (i = 0; i < 2; i++) { + data = mdss_mdp_ctl_read(ctl, + MDSS_MDP_REG_CTL_LAYER(i)); + if (data) { + mdss_mdp_ctl_write(ctl, + MDSS_MDP_REG_CTL_LAYER(i), + MDSS_MDP_LM_BORDER_COLOR); + flush |= (0x40 << i); + } + } + mdss_mdp_ctl_write(ctl, MDSS_MDP_REG_CTL_FLUSH, flush); + + return ret; +} + int mdss_mdp_video_reconfigure_splash_done(struct mdss_mdp_ctl *ctl, bool handoff) { struct mdss_panel_data *pdata; - int i, ret = 0, off; - u32 data, flush; + int ret = 0, off; struct mdss_mdp_video_ctx *ctx, *sctx = NULL; struct mdss_mdp_ctl *sctl; @@ -1704,29 +1734,20 @@ int mdss_mdp_video_reconfigure_splash_done(struct mdss_mdp_ctl *ctl, } if (!handoff) { - ret = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_CONT_SPLASH_BEGIN, - NULL, CTL_INTF_EVENT_FLAG_DEFAULT); - if (ret) { - pr_err("%s: Failed to handle 'CONT_SPLASH_BEGIN' event\n" - , __func__); - return ret; - } + ret = mdss_mdp_video_splash_handoff(ctl); - /* clear up mixer0 and mixer1 */ - flush = 0; - for (i = 0; i < 2; i++) { - data = mdss_mdp_ctl_read(ctl, - MDSS_MDP_REG_CTL_LAYER(i)); - if (data) { - mdss_mdp_ctl_write(ctl, - MDSS_MDP_REG_CTL_LAYER(i), - MDSS_MDP_LM_BORDER_COLOR); - flush |= (0x40 << i); - } - } - mdss_mdp_ctl_write(ctl, MDSS_MDP_REG_CTL_FLUSH, flush); + if (!ret && sctl) + ret = mdss_mdp_video_splash_handoff(sctl); + + if (ret) + return ret; mdp_video_write(ctx, MDSS_MDP_REG_INTF_TIMING_ENGINE_EN, 0); + + if (sctx) + mdp_video_write(sctx, + MDSS_MDP_REG_INTF_TIMING_ENGINE_EN, 0); + mdss_mdp_video_timegen_flush(ctl, sctx); /* wait for 1 VSYNC for the pipe to be unstaged */ @@ -1735,6 +1756,12 @@ int mdss_mdp_video_reconfigure_splash_done(struct mdss_mdp_ctl *ctl, ret = mdss_mdp_ctl_intf_event(ctl, MDSS_EVENT_CONT_SPLASH_FINISH, NULL, CTL_INTF_EVENT_FLAG_DEFAULT); + + if (!ret && sctl) + ret = mdss_mdp_ctl_intf_event(sctl, + MDSS_EVENT_CONT_SPLASH_FINISH, NULL, + CTL_INTF_EVENT_FLAG_DEFAULT); + } return ret;