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: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
This commit is contained in:
Kuogee Hsieh 2012-09-12 09:03:18 -07:00 committed by Stephen Boyd
parent 4eab59af57
commit 1dae7817be
2 changed files with 15 additions and 27 deletions

View file

@ -613,7 +613,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(struct mdp_dma_data *dma);

View file

@ -1500,36 +1500,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)
@ -2367,6 +2350,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__,