From 6f75e5ed632f559c8913cc189cf9d07b0457741d Mon Sep 17 00:00:00 2001 From: Ujwal Patel Date: Wed, 4 Jun 2014 14:51:32 -0700 Subject: [PATCH] msm: mdss: fix under-runs during suspend resume When device goes into suspend, MDP driver will put pipeline into border color only without staging any pipes. Similar pipeline is setup while resuming the device. When MDP pipeline is in border color only, minimum MDP clock requirement is based on mixer width. Currently MDP clock calculations are skipped if number of layers staged are 0. This set MDP to minimum clock rate and device under-runs. Fix this by allowing MDP clock rate calculations even when number of staged layers are 0. Change-Id: I1c00e00b0b4ac76866a7863293bf29d2bc6a423d Signed-off-by: Ujwal Patel --- drivers/video/fbdev/msm/mdss_mdp_ctl.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/video/fbdev/msm/mdss_mdp_ctl.c b/drivers/video/fbdev/msm/mdss_mdp_ctl.c index 480b735ad95f..938578ec39c4 100644 --- a/drivers/video/fbdev/msm/mdss_mdp_ctl.c +++ b/drivers/video/fbdev/msm/mdss_mdp_ctl.c @@ -552,6 +552,14 @@ static void mdss_mdp_perf_calc_mixer(struct mdss_mdp_mixer *mixer, fps * mixer->width * mixer->height * 3; } + /* + * In case of border color, we still need enough mdp clock + * to avoid under-run. Clock requirement for border color is + * based on mixer width. + */ + if (num_pipes == 0) + goto exit; + memset(bw_overlap, 0, sizeof(u64) * MAX_PIPES_PER_LM); memset(v_region, 0, sizeof(u32) * MAX_PIPES_PER_LM * 2); @@ -640,10 +648,10 @@ static void mdss_mdp_perf_calc_mixer(struct mdss_mdp_mixer *mixer, if (max_clk_rate > perf->mdp_clk_rate) perf->mdp_clk_rate = max_clk_rate; +exit: pr_debug("final mixer=%d video=%d clk_rate=%u bw=%llu prefill=%d\n", mixer->num, mixer->ctl->is_video_mode, perf->mdp_clk_rate, perf->bw_overlap, perf->prefill_bytes); - } static u32 mdss_mdp_get_vbp_factor(struct mdss_mdp_ctl *ctl) @@ -696,7 +704,7 @@ static void __mdss_mdp_perf_calc_ctl_helper(struct mdss_mdp_ctl *ctl, memset(perf, 0, sizeof(*perf)); - if (left_cnt && ctl->mixer_left) { + if (ctl->mixer_left) { mdss_mdp_perf_calc_mixer(ctl->mixer_left, &tmp, left_plist, left_cnt); perf->bw_overlap += tmp.bw_overlap; @@ -704,7 +712,7 @@ static void __mdss_mdp_perf_calc_ctl_helper(struct mdss_mdp_ctl *ctl, perf->mdp_clk_rate = tmp.mdp_clk_rate; } - if (right_cnt && ctl->mixer_right) { + if (ctl->mixer_right) { mdss_mdp_perf_calc_mixer(ctl->mixer_right, &tmp, right_plist, right_cnt); perf->bw_overlap += tmp.bw_overlap;