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

Commit c930ee39 authored by Ujwal Patel's avatar Ujwal Patel
Browse files

msm: mdss: improve right blend pipe allocation during source split



Current implementation does not consider left_blend pipe's priority when
allocating right_blend pipe. Because of this, higher priority pipe may be
allocated for the right_blend and later be dropped. Prevent this by
skipping pipe's with higher priorities than left_blend.

Change-Id: I75dd846f171a27c087f29d58ee7850582434ebaf
Signed-off-by: default avatarUjwal Patel <ujwalp@codeaurora.org>
parent 7d835dde
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -767,7 +767,7 @@ int mdss_mdp_overlay_pipe_setup(struct msm_fb_data_type *mfd,

	if (left_blend_pipe) {
		if (pipe->priority <= left_blend_pipe->priority) {
			pr_debug("priority limitation. left:%d right%d\n",
			pr_err("priority limitation. left:%d right%d\n",
				left_blend_pipe->priority, pipe->priority);
			ret = -EPERM;
			goto exit_fail;
+11 −7
Original line number Diff line number Diff line
@@ -850,6 +850,17 @@ static struct mdss_mdp_pipe *mdss_mdp_pipe_init(struct mdss_mdp_mixer *mixer,
		break;
	}

	/* allocate lower priority right blend pipe */
	if (left_blend_pipe && (left_blend_pipe->type == type) && pipe_pool) {
		struct mdss_mdp_pipe *pool_head = pipe_pool + off;
		off += left_blend_pipe->priority - pool_head->priority + 1;
		if (off >= npipes) {
			pr_err("priority limitation. l_pipe:%d. no low priority %d pipe type available.\n",
				left_blend_pipe->num, type);
			return ERR_PTR(-EINVAL);
		}
	}

	for (i = off; i < npipes; i++) {
		pipe = pipe_pool + i;
		if (atomic_read(&pipe->kref.refcount) == 0) {
@@ -864,13 +875,6 @@ static struct mdss_mdp_pipe *mdss_mdp_pipe_init(struct mdss_mdp_mixer *mixer,
		goto cursor_done;
	}

	if (left_blend_pipe && pipe &&
	    pipe->priority <= left_blend_pipe->priority) {
		pr_debug("priority limitation. l_pipe:%d r_pipe:%d\n",
			left_blend_pipe->num, pipe->num);
		return ERR_PTR(-EINVAL);
	}

	if (pipe && mdss_mdp_pipe_fetch_halt(pipe)) {
		pr_err("%d failed because pipe is in bad state\n",
			pipe->num);