diff options
| author | Carl Vanderlip <carlv@codeaurora.org> | 2013-10-18 17:48:03 -0700 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 20:23:24 -0700 |
| commit | 917ec54136574552ee12b3ee28fced321cbde8ac (patch) | |
| tree | adeb48cab80e4ba8d3979ab505c7975cf3582ada /drivers/video/fbdev | |
| parent | 3a5af245d73ecb7d69c6dfe8260644cb522ae4e3 (diff) | |
msm: mdss: Move evaluation of Assertive Display state machine
Move the Assertive Display (AD) state machine to a location where it is
evaluated once per frame instead of current location where it is evaluated
once per frame per DSPP. This change is beneficial in the support of dual
pipe cases of AD.
Change-Id: I2c6e17b92505c4cce13caeca0568f85d3c3337fa
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
Diffstat (limited to 'drivers/video/fbdev')
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_mdp_pp.c | 54 |
1 files changed, 41 insertions, 13 deletions
diff --git a/drivers/video/fbdev/msm/mdss_mdp_pp.c b/drivers/video/fbdev/msm/mdss_mdp_pp.c index d932fdb89fa8..52d74162d989 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_pp.c +++ b/drivers/video/fbdev/msm/mdss_mdp_pp.c @@ -221,6 +221,7 @@ static u32 igc_limited[IGC_LUT_ENTRIES] = { #define PP_AD_STS_DIRTY_CFG 0x4 #define PP_AD_STS_DIRTY_DATA 0x8 #define PP_AD_STS_DIRTY_VSYNC 0x10 +#define PP_AD_STS_DIRTY_ENABLE 0x20 #define PP_AD_STS_IS_DIRTY(sts) (((sts) & PP_AD_STS_DIRTY_INIT) ||\ ((sts) & PP_AD_STS_DIRTY_CFG)) @@ -1425,12 +1426,9 @@ static int pp_dspp_setup(u32 disp_num, struct mdss_mdp_mixer *mixer) mixer_cnt = mdss_mdp_get_ctl_mixers(disp_num, mixer_id); if (dspp_num < mdata->nad_cfgs && (mixer_cnt != 2)) { - ret = mdss_mdp_ad_setup(ctl->mfd); ad = &mdata->ad_cfgs[disp_num]; ad_flags = ad->reg_sts; ad_hw = &mdata->ad_off[dspp_num]; - if (ret < 0) - pr_warn("ad_setup(dspp%d) returns %d", dspp_num, ret); } else { ad_flags = 0; } @@ -1440,9 +1438,8 @@ static int pp_dspp_setup(u32 disp_num, struct mdss_mdp_mixer *mixer) goto flush_exit; /* nothing to update */ - if ((!flags) && (!(opmode)) && (ret <= 0) && (!ad_flags)) + if ((!flags) && (!(opmode)) && (!ad_flags)) goto dspp_exit; - ret = 0; pp_sts = &mdss_pp_res->pp_disp_sts[disp_num]; @@ -1547,13 +1544,36 @@ error: int mdss_mdp_pp_setup_locked(struct mdss_mdp_ctl *ctl) { struct mdss_data_type *mdata = ctl->mdata; + int ret = 0; + u32 mixer_cnt; + u32 mixer_id[MDSS_MDP_INTF_MAX_LAYERMIXER]; u32 disp_num; + int i; + bool valid_mixers = true; if ((!ctl->mfd) || (!mdss_pp_res)) return -EINVAL; /* treat fb_num the same as block logical id*/ disp_num = ctl->mfd->index; + mixer_cnt = mdss_mdp_get_ctl_mixers(disp_num, mixer_id); + if (!mixer_cnt) { + valid_mixers = false; + ret = -EINVAL; + pr_warn("Configuring post processing without mixers, err = %d", + ret); + goto exit; + } + for (i = 0; i < mixer_cnt && valid_mixers; i++) { + if (mixer_id[i] > mdata->nad_cfgs) + valid_mixers = false; + } + if (valid_mixers && (mixer_cnt != 2)) { + ret = mdss_mdp_ad_setup(ctl->mfd); + if (ret < 0) + pr_warn("ad_setup(disp%d) returns %d", disp_num, ret); + } + mutex_lock(&mdss_pp_mutex); if (ctl->mixer_left) { pp_mixer_setup(disp_num, ctl->mixer_left); @@ -1570,8 +1590,8 @@ int mdss_mdp_pp_setup_locked(struct mdss_mdp_ctl *ctl) mdata->ad_cfgs[disp_num].reg_sts = 0; } mutex_unlock(&mdss_pp_mutex); - - return 0; +exit: + return ret; } /* @@ -3868,12 +3888,19 @@ static int mdss_mdp_ad_setup(struct msm_fb_data_type *mfd) u32 bypass = MDSS_PP_AD_BYPASS_DEF, bl; ret = mdss_mdp_get_ad(mfd, &ad); - if (ret) - return ret; + if (ret) { + ret = -EINVAL; + pr_debug("failed to get ad_info, err = %d", ret); + goto exit; + } if (mfd->panel_info->type == WRITEBACK_PANEL) { bl_mfd = mdss_get_mfd_from_index(0); - if (!bl_mfd) - return ret; + if (!bl_mfd) { + ret = -EINVAL; + pr_warn("failed to get primary FB bl handle, err = %d", + ret); + goto exit; + } } else { bl_mfd = mfd; } @@ -3947,7 +3974,7 @@ static int mdss_mdp_ad_setup(struct msm_fb_data_type *mfd) if ((ad->sts & PP_STS_ENABLE) && PP_AD_STATE_IS_READY(ad->state)) { bypass = 0; - ret = 1; + ad->reg_sts |= PP_AD_STS_DIRTY_ENABLE; ad->state |= PP_AD_STATE_RUN; mutex_lock(&bl_mfd->bl_lock); if (bl_mfd != mfd) @@ -3958,7 +3985,7 @@ static int mdss_mdp_ad_setup(struct msm_fb_data_type *mfd) } else { if (ad->state & PP_AD_STATE_RUN) { - ret = 1; + ad->reg_sts = PP_AD_STS_DIRTY_ENABLE; /* Clear state and regs when going to off state*/ ad->sts = 0; ad->sts |= PP_AD_STS_DIRTY_VSYNC; @@ -4011,6 +4038,7 @@ static int mdss_mdp_ad_setup(struct msm_fb_data_type *mfd) ad->state); } mutex_unlock(&ad->lock); +exit: return ret; } |
