diff --git a/drivers/video/msm/mdp4_overlay_dsi_cmd.c b/drivers/video/msm/mdp4_overlay_dsi_cmd.c index 733677d67bc5..38c7baf8baa1 100644 --- a/drivers/video/msm/mdp4_overlay_dsi_cmd.c +++ b/drivers/video/msm/mdp4_overlay_dsi_cmd.c @@ -305,10 +305,13 @@ int mdp4_dsi_cmd_pipe_commit(int cndx, int wait) if (vctrl->blt_free == 0) mdp4_free_writeback_buf(vctrl->mfd, mixer); } - mutex_unlock(&vctrl->update_lock); - if (mdp4_dsi_cmd_clk_check(vctrl) < 0) + if (mdp4_dsi_cmd_clk_check(vctrl) < 0) { + mdp4_dsi_cmd_pipe_clean(vp); + mutex_unlock(&vctrl->update_lock); return 0; + } + mutex_unlock(&vctrl->update_lock); /* free previous committed iommu back to pool */ mdp4_overlay_iommu_unmap_freelist(mixer); @@ -765,6 +768,7 @@ void mdp4_mipi_vsync_enable(struct msm_fb_data_type *mfd, tear_en = (1 << which); + mdp_clk_ctrl(1); if ((mfd->use_mdp_vsync) && (mfd->ibuf.vsync_enable) && (mfd->panel_info.lcd.vsync_enable)) { @@ -786,6 +790,7 @@ void mdp4_mipi_vsync_enable(struct msm_fb_data_type *mfd, data &= ~tear_en; MDP_OUTP(MDP_BASE + 0x20c, data); } + mdp_clk_ctrl(0); } void mdp4_dsi_cmd_base_swap(int cndx, struct mdp4_overlay_pipe *pipe) @@ -1149,9 +1154,7 @@ static int mdp4_dsi_cmd_clk_check(struct vsycn_ctrl *vctrl) int clk_set_on = 0; unsigned long flags; - mutex_lock(&vctrl->update_lock); if (atomic_read(&vctrl->suspend)) { - mutex_unlock(&vctrl->update_lock); pr_err("%s: suspended, no more pan display\n", __func__); return -EPERM; } @@ -1173,8 +1176,6 @@ static int mdp4_dsi_cmd_clk_check(struct vsycn_ctrl *vctrl) vsync_irq_enable(INTR_PRIMARY_RDPTR, MDP_PRIM_RDPTR_TERM); } - mutex_unlock(&vctrl->update_lock); - return 0; } @@ -1199,11 +1200,6 @@ void mdp4_dsi_cmd_overlay(struct msm_fb_data_type *mfd) 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);