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

Commit 7ea8c54d authored by Saurabh Shah's avatar Saurabh Shah
Browse files

msm: mdss: add bandwidth check while performing frame level checks



Add frame level check inside overlay prepare API, for the bandwidth that
would be required by MDP to display the frame. If the bandwidth is over
the defined limits, then we need to fail the configuration to allow an
alternative composition configuration to happen instead.

Change-Id: I7721047589ce9239f1fb63c37ca5d97127c90f7e
Signed-off-by: default avatarAdrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: default avatarSaurabh Shah <saurshah@codeaurora.org>
parent 816351dd
Loading
Loading
Loading
Loading
+24 −1
Original line number Diff line number Diff line
@@ -2346,10 +2346,12 @@ static int __handle_overlay_prepare(struct msm_fb_data_type *mfd,
		struct mdp_overlay_list *ovlist,
		struct mdp_overlay *overlays)
{
	struct mdss_mdp_pipe *right_plist[MDSS_MDP_MAX_STAGE] = { 0 };
	struct mdss_mdp_pipe *left_plist[MDSS_MDP_MAX_STAGE] = { 0 };
	struct mdss_overlay_private *mdp5_data = mfd_to_mdp5_data(mfd);
	struct mdss_mdp_pipe *pipe;
	struct mdp_overlay *req;
	int ret = 0;
	int ret = 0, left_cnt = 0, right_cnt = 0;
	int i;
	u32 new_reqs = 0;

@@ -2378,7 +2380,28 @@ static int __handle_overlay_prepare(struct msm_fb_data_type *mfd,
		/* keep track of the new overlays to unset in case of errors */
		if (pipe->play_cnt == 0)
			new_reqs |= pipe->ndx;

		if (pipe->flags & MDSS_MDP_RIGHT_MIXER) {
			if (right_cnt >= MDSS_MDP_MAX_STAGE) {
				pr_err("too many pipes on right mixer\n");
				ret = -EINVAL;
				goto validate_exit;
			}
			right_plist[right_cnt] = pipe;
			right_cnt++;
		} else {
			if (left_cnt >= MDSS_MDP_MAX_STAGE) {
				pr_err("too many pipes on left mixer\n");
				ret = -EINVAL;
				goto validate_exit;
			}
			left_plist[left_cnt] = pipe;
			left_cnt++;
		}
	}

	ret = mdss_mdp_perf_bw_check(mdp5_data->ctl, left_plist, left_cnt,
			right_plist, right_cnt);

validate_exit:
	if (IS_ERR_VALUE(ret))