msm: display: vsync usage in turning off dsi video

Add timeout to waiting for vsync so that it can come out
when vsync interrupt is not working.
Need not wait for vsync after timing engine is off.

Change-Id: Ib989e435405613d891024ba15144723730454e34
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
This commit is contained in:
Naseer Ahmed 2013-05-13 13:56:23 -04:00
parent 4da0857ac5
commit 0f16f59916

View file

@ -336,6 +336,7 @@ void mdp4_dsi_video_wait4vsync(int cndx)
struct vsycn_ctrl *vctrl;
struct mdp4_overlay_pipe *pipe;
unsigned long flags;
int ret;
if (cndx >= MAX_CONTROLLER) {
pr_err("%s: out or range: cndx=%d\n", __func__, cndx);
@ -356,8 +357,12 @@ void mdp4_dsi_video_wait4vsync(int cndx)
vctrl->wait_vsync_cnt++;
spin_unlock_irqrestore(&vctrl->spin_lock, flags);
/* double the timeout in vsync time stamp generation */
ret = wait_for_completion_interruptible_timeout(&vctrl->vsync_comp,
msecs_to_jiffies(VSYNC_PERIOD * 8));
if (ret <= 0)
pr_err("%s timeout ret=%d", __func__, ret);
wait_for_completion(&vctrl->vsync_comp);
mdp4_video_vsync_irq_ctrl(cndx, 0);
mdp4_stat.wait4vsync0++;
}
@ -524,7 +529,8 @@ static void mdp4_dsi_video_tg_off(struct vsycn_ctrl *vctrl)
MDP_OUTP(MDP_BASE + DSI_VIDEO_BASE, 0); /* turn off timing generator */
spin_unlock_irqrestore(&vctrl->spin_lock, flags);
mdp4_dsi_video_wait4vsync(0);
/* some delay after turning off the tg */
msleep(20);
}
int mdp4_dsi_video_splash_done(void)