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

Commit 4644df66 authored by Kuogee Hsieh's avatar Kuogee Hsieh Committed by Stephen Boyd
Browse files

msm_fb: display: return fail if pipe still staged



Pipe is not un-staged from mixer when it is unset.
It expects a pan_display() to un-stage it out of mixer.
Return fail at overlay_set() if pipe was still stage
at mixer.

CRs-fixed: 399193, 393979
Change-Id: I562f6e133bb239b30f4f53669dbf1cc5ddf80d02
Signed-off-by: default avatarKuogee Hsieh <khsieh@codeaurora.org>
parent 61848f1d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -594,7 +594,7 @@ void mdp4_overlay_dmap_cfg(struct msm_fb_data_type *mfd, int lcdc);
void mdp4_overlay_dmap_xy(struct mdp4_overlay_pipe *pipe);
void mdp4_overlay_dmae_cfg(struct msm_fb_data_type *mfd, int atv);
void mdp4_overlay_dmae_xy(struct mdp4_overlay_pipe *pipe);
int mdp4_overlay_pipe_staged(int mixer);
int mdp4_overlay_pipe_staged(struct mdp4_overlay_pipe *pipe);
void mdp4_lcdc_primary_vsyn(void);
void mdp4_overlay0_done_lcdc(int cndx);
void mdp4_overlay0_done_mddi(int cndx);
+14 −26
Original line number Diff line number Diff line
@@ -1568,36 +1568,19 @@ void mdp4_overlayproc_cfg(struct mdp4_overlay_pipe *pipe)
		mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_OFF, FALSE);
}

int mdp4_overlay_pipe_staged(int mixer)
int mdp4_overlay_pipe_staged(struct mdp4_overlay_pipe *pipe)
{
	uint32 data, mask, i, off;
	int p1, p2;
	uint32 data, mask;
	int mixer;

	if (mixer == MDP4_MIXER2)
		off = 0x100F0;
	else
		off = 0x10100;
	mixer = pipe->mixer_num;
	data = ctrl->mixer_cfg[mixer];

	mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_ON, FALSE);
	data = inpdw(MDP_BASE + off);
	mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_OFF, FALSE);
	p1 = 0;
	p2 = 0;
	for (i = 0; i < 8; i++) {
		mask = data & 0x0f;
		if (mask) {
			if (mask <= 4)
				p1++;
			else
				p2++;
		}
		data >>= 4;
	}
	mask = 0x0f;
	mask <<= (4 * pipe->pipe_num);
	data &= mask;

	if (mixer)
		return p2;
	else
		return p1;
	return data;
}

int mdp4_mixer_info(int mixer_num, struct mdp_mixer_info *info)
@@ -2434,6 +2417,11 @@ static int mdp4_overlay_req2pipe(struct mdp_overlay *req, int mixer,
	 * zorder 2 == stage 2 == 4
	 */
	if (req->id == MSMFB_NEW_REQUEST) {  /* new request */
		if (mdp4_overlay_pipe_staged(pipe)) {
			pr_err("%s: ndx=%d still staged\n", __func__,
						pipe->pipe_ndx);
			return -EPERM;
		}
		pipe->pipe_used++;
		pipe->mixer_num = mixer;
		pr_debug("%s: zorder=%d pipe ndx=%d num=%d\n", __func__,