msm_fb: display: turn mdp clock on at pipe_commit

mdp clock is controlled by frame work. There has
possibility that mdp clock had been turned off while
frame update still happen. In this case update
thread may stuck at wait4vsync since there has no
mdp clcok to trigger vsync interrupt. This patch
will enable mdp clock at pipe commit when mdp clock
is tunred off so that frame update can be completed.

Change-Id: I2d31b9a4b6f0cb9dd36516a80931988e23e8a545
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
This commit is contained in:
Kuogee Hsieh 2013-01-21 17:49:20 -08:00 committed by Stephen Boyd
parent 562c2a2857
commit bb4349c7ad

View file

@ -251,6 +251,7 @@ void mdp4_dsi_cmd_pipe_queue(int cndx, struct mdp4_overlay_pipe *pipe)
}
static void mdp4_dsi_cmd_blt_ov_update(struct mdp4_overlay_pipe *pipe);
static int mdp4_dsi_cmd_clk_check(struct vsycn_ctrl *vctrl);
int mdp4_dsi_cmd_pipe_commit(int cndx, int wait)
{
@ -291,6 +292,9 @@ int mdp4_dsi_cmd_pipe_commit(int cndx, int wait)
}
mutex_unlock(&vctrl->update_lock);
if (mdp4_dsi_cmd_clk_check(vctrl) < 0)
return 0;
/* free previous committed iommu back to pool */
mdp4_overlay_iommu_unmap_freelist(mixer);
@ -1135,35 +1139,16 @@ void mdp_dsi_cmd_overlay_suspend(struct msm_fb_data_type *mfd)
}
}
void mdp4_dsi_cmd_overlay(struct msm_fb_data_type *mfd)
static int mdp4_dsi_cmd_clk_check(struct vsycn_ctrl *vctrl)
{
int cndx = 0;
struct vsycn_ctrl *vctrl;
struct mdp4_overlay_pipe *pipe;
unsigned long flags;
int clk_set_on = 0;
mutex_lock(&mfd->dma->ov_mutex);
vctrl = &vsync_ctrl_db[cndx];
if (!mfd->panel_power_on) {
mutex_unlock(&mfd->dma->ov_mutex);
return;
}
pipe = vctrl->base_pipe;
if (pipe == NULL) {
pr_err("%s: NO base pipe\n", __func__);
mutex_unlock(&mfd->dma->ov_mutex);
return;
}
unsigned long flags;
mutex_lock(&vctrl->update_lock);
if (atomic_read(&vctrl->suspend)) {
mutex_unlock(&vctrl->update_lock);
mutex_unlock(&mfd->dma->ov_mutex);
pr_err("%s: suspended, no more pan display\n", __func__);
return;
return -EPERM;
}
spin_lock_irqsave(&vctrl->spin_lock, flags);
@ -1185,6 +1170,35 @@ void mdp4_dsi_cmd_overlay(struct msm_fb_data_type *mfd)
mutex_unlock(&vctrl->update_lock);
return 0;
}
void mdp4_dsi_cmd_overlay(struct msm_fb_data_type *mfd)
{
int cndx = 0;
struct vsycn_ctrl *vctrl;
struct mdp4_overlay_pipe *pipe;
mutex_lock(&mfd->dma->ov_mutex);
vctrl = &vsync_ctrl_db[cndx];
if (!mfd->panel_power_on) {
mutex_unlock(&mfd->dma->ov_mutex);
return;
}
pipe = vctrl->base_pipe;
if (pipe == NULL) {
pr_err("%s: NO base pipe\n", __func__);
mutex_unlock(&mfd->dma->ov_mutex);
return;
}
if (mdp4_dsi_cmd_clk_check(vctrl) < 0) {
mutex_unlock(&mfd->dma->ov_mutex);
return;
}
if (pipe->mixer_stage == MDP4_MIXER_STAGE_BASE) {
mdp4_mipi_vsync_enable(mfd, pipe, 0);
mdp4_overlay_setup_pipe_addr(mfd, pipe);