Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2ad62fc3 authored by Ujwal Patel's avatar Ujwal Patel
Browse files

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: default avatarUjwal Patel <ujwalp@codeaurora.org>
parent 60d75479
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -542,6 +542,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);

@@ -630,10 +638,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)
@@ -686,7 +694,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;
@@ -694,7 +702,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;