diff options
| author | Carl Vanderlip <carlv@codeaurora.org> | 2013-01-17 13:06:03 -0800 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 20:14:14 -0700 |
| commit | af4dffd8ae6b780fe2daecc146e9d20f41716cc1 (patch) | |
| tree | 217a55eaf0c0427c478cb4804c9d1909693c6db6 /drivers | |
| parent | 31e69f5e6d8f8877d091b6d0db28cda5bc75bf0c (diff) | |
video: msm: Restore Post Processing configuration on resume
Restore the configuration of each post processing feature on resume.
Previously only enabled/disabled state was being restored causing some
features to become misconfigured during suspend resume case.
Change-Id: Icbd6584a85b4464931bff4498c0a218948b15822
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_mdp.h | 12 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_mdp_ctl.c | 2 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_mdp_pp.c | 89 |
3 files changed, 91 insertions, 12 deletions
diff --git a/drivers/video/fbdev/msm/mdss_mdp.h b/drivers/video/fbdev/msm/mdss_mdp.h index 40cca2286f78..3ae79af756b9 100644 --- a/drivers/video/fbdev/msm/mdss_mdp.h +++ b/drivers/video/fbdev/msm/mdss_mdp.h @@ -308,10 +308,14 @@ int mdss_mdp_csc_setup(u32 block, u32 blk_idx, u32 tbl_idx, u32 csc_type); int mdss_mdp_csc_setup_data(u32 block, u32 blk_idx, u32 tbl_idx, struct mdp_csc_cfg *data); -int mdss_mdp_pipe_pp_setup(struct mdss_mdp_pipe *pipe, u32 *op); +int mdss_mdp_pp_init(struct device *dev); +void mdss_mdp_pp_term(struct device *dev); +int mdss_mdp_pp_resume(u32 mixer_num); int mdss_mdp_pp_setup(struct mdss_mdp_ctl *ctl); -int mdss_mdp_pcc_config(struct mdp_pcc_cfg_data *cfg_ptr, u32 *copyback); +int mdss_mdp_pipe_pp_setup(struct mdss_mdp_pipe *pipe, u32 *op); +int mdss_mdp_pa_config(struct mdp_pa_cfg_data *config, u32 *copyback); +int mdss_mdp_pcc_config(struct mdp_pcc_cfg_data *cfg_ptr, u32 *copyback); int mdss_mdp_igc_lut_config(struct mdp_igc_lut_data *config, u32 *copyback); int mdss_mdp_argc_config(struct mdp_pgc_lut_data *config, u32 *copyback); int mdss_mdp_hist_lut_config(struct mdp_hist_lut_data *config, u32 *copyback); @@ -347,9 +351,5 @@ u32 mdss_get_panel_framerate(struct msm_fb_data_type *mfd); int mdss_mdp_wb_kickoff(struct mdss_mdp_ctl *ctl); int mdss_mdp_wb_ioctl_handler(struct msm_fb_data_type *mfd, u32 cmd, void *arg); -int mdss_mdp_pp_init(struct device *dev); -void mdss_mdp_pp_term(struct device *dev); -int mdss_mdp_pa_config(struct mdp_pa_cfg_data *config, u32 *copyback); - int mdss_mdp_get_ctl_mixers(u32 fb_num, u32 *mixer_id); #endif /* MDSS_MDP_H */ diff --git a/drivers/video/fbdev/msm/mdss_mdp_ctl.c b/drivers/video/fbdev/msm/mdss_mdp_ctl.c index 6030cbcc5166..f4e43a40f570 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_ctl.c +++ b/drivers/video/fbdev/msm/mdss_mdp_ctl.c @@ -624,6 +624,7 @@ int mdss_mdp_ctl_on(struct msm_fb_data_type *mfd) pr_debug("ctl_num=%d\n", ctl->num); mixer = ctl->mixer_left; + mdss_mdp_pp_resume(mixer->num); mixer->params_changed++; temp = MDSS_MDP_REG_READ(MDSS_MDP_REG_DISP_INTF_SEL); @@ -642,6 +643,7 @@ int mdss_mdp_ctl_on(struct msm_fb_data_type *mfd) if (ctl->mixer_right) { mixer = ctl->mixer_right; + mdss_mdp_pp_resume(mixer->num); mixer->params_changed++; outsize = (mixer->height << 16) | mixer->width; off = MDSS_MDP_REG_LM_OFFSET(mixer->num); diff --git a/drivers/video/fbdev/msm/mdss_mdp_pp.c b/drivers/video/fbdev/msm/mdss_mdp_pp.c index 242be6035270..56c7f119df49 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_pp.c +++ b/drivers/video/fbdev/msm/mdss_mdp_pp.c @@ -295,7 +295,7 @@ int mdss_mdp_csc_setup(u32 block, u32 blk_idx, u32 tbl_idx, u32 csc_type) } static void pp_gamut_config(struct mdp_gamut_cfg_data *gamut_cfg, - u32 base, u32 *gamut_sts) + u32 base, struct pp_sts_type *pp_sts) { u32 offset; int i, j; @@ -320,13 +320,13 @@ static void pp_gamut_config(struct mdp_gamut_cfg_data *gamut_cfg, offset += 4; } if (gamut_cfg->gamut_first) - *gamut_sts |= PP_STS_GAMUT_FIRST; + pp_sts->gamut_sts |= PP_STS_GAMUT_FIRST; } if (gamut_cfg->flags & MDP_PP_OPS_DISABLE) - *gamut_sts &= ~PP_STS_ENABLE; + pp_sts->gamut_sts &= ~PP_STS_ENABLE; else if (gamut_cfg->flags & MDP_PP_OPS_ENABLE) - *gamut_sts |= PP_STS_ENABLE; + pp_sts->gamut_sts |= PP_STS_ENABLE; } static void pp_pa_config(unsigned long flags, u32 base, @@ -634,8 +634,8 @@ static int pp_dspp_setup(u32 disp_num, struct mdss_mdp_ctl *ctl, if (pp_sts->dither_sts & PP_STS_ENABLE) opmode |= (1 << 8); /* DITHER_EN */ if (flags & PP_FLAGS_DIRTY_GAMUT) - pp_gamut_config(&mdss_pp_res->gamut_disp_cfg[disp_num], - base, &pp_sts->gamut_sts); + pp_gamut_config(&mdss_pp_res->gamut_disp_cfg[disp_num], base, + pp_sts); if (pp_sts->gamut_sts & PP_STS_ENABLE) { opmode |= (1 << 23); /* GAMUT_EN */ if (pp_sts->gamut_sts & PP_STS_GAMUT_FIRST) @@ -687,6 +687,83 @@ int mdss_mdp_pp_setup(struct mdss_mdp_ctl *ctl) return 0; } +/* + * Set dirty and write bits on features that were enabled so they will be + * reconfigured + */ +int mdss_mdp_pp_resume(u32 mixer_num) +{ + u32 flags = 0; + struct pp_sts_type pp_sts; + + if (mixer_num >= MDSS_MDP_MAX_DSPP) { + pr_warn("invalid mixer_num"); + return -EINVAL; + } + + pp_sts = mdss_pp_res->pp_dspp_sts[mixer_num]; + + if (pp_sts.pa_sts & PP_STS_ENABLE) { + flags |= PP_FLAGS_DIRTY_PA; + if (!(mdss_pp_res->pa_disp_cfg[mixer_num].flags + & MDP_PP_OPS_DISABLE)) + mdss_pp_res->pa_disp_cfg[mixer_num].flags |= + MDP_PP_OPS_WRITE; + } + if (pp_sts.pcc_sts & PP_STS_ENABLE) { + flags |= PP_FLAGS_DIRTY_PCC; + if (!(mdss_pp_res->pcc_disp_cfg[mixer_num].ops + & MDP_PP_OPS_DISABLE)) + mdss_pp_res->pcc_disp_cfg[mixer_num].ops |= + MDP_PP_OPS_WRITE; + } + if (pp_sts.igc_sts & PP_STS_ENABLE) { + flags |= PP_FLAGS_DIRTY_IGC; + if (!(mdss_pp_res->igc_disp_cfg[mixer_num].ops + & MDP_PP_OPS_DISABLE)) + mdss_pp_res->igc_disp_cfg[mixer_num].ops |= + MDP_PP_OPS_WRITE; + } + if (pp_sts.argc_sts & PP_STS_ENABLE) { + flags |= PP_FLAGS_DIRTY_ARGC; + if (!(mdss_pp_res->argc_disp_cfg[mixer_num].flags + & MDP_PP_OPS_DISABLE)) + mdss_pp_res->argc_disp_cfg[mixer_num].flags |= + MDP_PP_OPS_WRITE; + } + if (pp_sts.enhist_sts & PP_STS_ENABLE) { + flags |= PP_FLAGS_DIRTY_ENHIST; + if (!(mdss_pp_res->enhist_disp_cfg[mixer_num].ops + & MDP_PP_OPS_DISABLE)) + mdss_pp_res->enhist_disp_cfg[mixer_num].ops |= + MDP_PP_OPS_WRITE; + } + if (pp_sts.dither_sts & PP_STS_ENABLE) { + flags |= PP_FLAGS_DIRTY_DITHER; + if (!(mdss_pp_res->dither_disp_cfg[mixer_num].flags + & MDP_PP_OPS_DISABLE)) + mdss_pp_res->dither_disp_cfg[mixer_num].flags |= + MDP_PP_OPS_WRITE; + } + if (pp_sts.gamut_sts & PP_STS_ENABLE) { + flags |= PP_FLAGS_DIRTY_GAMUT; + if (!(mdss_pp_res->gamut_disp_cfg[mixer_num].flags + & MDP_PP_OPS_DISABLE)) + mdss_pp_res->gamut_disp_cfg[mixer_num].flags |= + MDP_PP_OPS_WRITE; + } + if (pp_sts.pgc_sts & PP_STS_ENABLE) { + flags |= PP_FLAGS_DIRTY_PGC; + if (!(mdss_pp_res->pgc_disp_cfg[mixer_num].flags + & MDP_PP_OPS_DISABLE)) + mdss_pp_res->pgc_disp_cfg[mixer_num].flags |= + MDP_PP_OPS_WRITE; + } + + mdss_pp_res->pp_disp_flags[mixer_num] = flags; + return 0; +} + int mdss_mdp_pp_init(struct device *dev) { int ret = 0; |
