diff options
| author | Adrian Salido-Moreno <adrianm@codeaurora.org> | 2015-04-23 18:36:17 -0700 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-23 20:40:51 -0700 |
| commit | 65a9c296806c42cdbebcf20185a8628acf48e5f9 (patch) | |
| tree | 8ca594bad2ba8df4ec18a9834168b09fc9ceb994 | |
| parent | ea86d8e5a5d561a6db9b534d70b60e79a935ca74 (diff) | |
msm: mdss: ctl: fix mixer allocation logic
Current mixer allocation logic does initialization only if the mixer is
part of the mixer pool, however code has additional path for alternative
mixer which is not being initialized. Also don't need to reallocate the
mixer if it's already allocated in case of split display.
Change-Id: I1dbbbb86096c4825d214755d9cc7bf81b2abbbc8
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_fb.c | 2 | ||||
| -rw-r--r-- | drivers/video/fbdev/msm/mdss_mdp_ctl.c | 32 |
2 files changed, 19 insertions, 15 deletions
diff --git a/drivers/video/fbdev/msm/mdss_fb.c b/drivers/video/fbdev/msm/mdss_fb.c index f07ba01d5d56..2cc566981a20 100644 --- a/drivers/video/fbdev/msm/mdss_fb.c +++ b/drivers/video/fbdev/msm/mdss_fb.c @@ -405,7 +405,7 @@ static void mdss_fb_get_split(struct msm_fb_data_type *mfd) mdss_fb_parse_dt_split(mfd); if ((mfd->split_mode == MDP_SPLIT_MODE_NONE) && - (mfd->split_fb_left || mfd->split_fb_right)) + (mfd->split_fb_left && mfd->split_fb_right)) mfd->split_mode = MDP_DUAL_LM_SINGLE_DISPLAY; pr_debug("split framebuffer left=%d right=%d mode=%d\n", diff --git a/drivers/video/fbdev/msm/mdss_mdp_ctl.c b/drivers/video/fbdev/msm/mdss_mdp_ctl.c index 74038e522b47..4b49b14af517 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_ctl.c +++ b/drivers/video/fbdev/msm/mdss_mdp_ctl.c @@ -1949,19 +1949,21 @@ struct mdss_mdp_mixer *mdss_mdp_mixer_alloc( for (i = 0; i < nmixers; i++) { mixer = mixer_pool + i; - if (mixer->ref_cnt == 0) { - mixer->ref_cnt++; - mixer->params_changed++; - mixer->ctl = ctl; - pr_debug("alloc mixer num %d for ctl=%d\n", - mixer->num, ctl->num); + if (mixer->ref_cnt == 0) break; - } mixer = NULL; } if (!mixer && alt_mixer && (alt_mixer->ref_cnt == 0)) mixer = alt_mixer; + + if (mixer) { + mixer->ref_cnt++; + mixer->params_changed++; + mixer->ctl = ctl; + pr_debug("alloc mixer num %d for ctl=%d\n", + mixer->num, ctl->num); + } mutex_unlock(&mdss_mdp_ctl_lock); return mixer; @@ -2407,8 +2409,7 @@ int mdss_mdp_ctl_setup(struct mdss_mdp_ctl *ctl) max_mixer_width = ctl->mdata->max_mixer_width; - split_fb = (ctl->mfd->split_fb_left && - ctl->mfd->split_fb_right && + split_fb = (ctl->mfd->split_mode == MDP_DUAL_LM_SINGLE_DISPLAY && (ctl->mfd->split_fb_left <= max_mixer_width) && (ctl->mfd->split_fb_right <= max_mixer_width)) ? 1 : 0; pr_debug("max=%d xres=%d left=%d right=%d\n", max_mixer_width, @@ -2697,12 +2698,15 @@ int mdss_mdp_ctl_split_display_setup(struct mdss_mdp_ctl *ctl, sctl->roi = (struct mdss_rect){0, 0, sctl->width, sctl->height}; - ctl->mixer_left = mdss_mdp_mixer_alloc(ctl, MDSS_MDP_MIXER_TYPE_INTF, - false, 0); if (!ctl->mixer_left) { - pr_err("unable to allocate layer mixer\n"); - mdss_mdp_ctl_destroy(sctl); - return -ENOMEM; + ctl->mixer_left = mdss_mdp_mixer_alloc(ctl, + MDSS_MDP_MIXER_TYPE_INTF, + false, 0); + if (!ctl->mixer_left) { + pr_err("unable to allocate layer mixer\n"); + mdss_mdp_ctl_destroy(sctl); + return -ENOMEM; + } } mixer = mdss_mdp_mixer_alloc(sctl, MDSS_MDP_MIXER_TYPE_INTF, false, 0); |
