From 3d92f40f27b940907f2b29f5ac08394942cfb066 Mon Sep 17 00:00:00 2001 From: Kuogee Hsieh Date: Wed, 6 Feb 2013 09:46:19 -0800 Subject: [PATCH] msm_fb: display: remove extra mdp4_dsi_cmd_clk_check() Since mdp4_dsi_cmd_clk_check() is called inside of mdp4_dsi_cmd_pipe_commit() also, mdp4_dsi_cmd_clk_check() is called two times from pan display route. This patch remove mdp4_dsi_cmd_clk_check() from mdp4_dsi_cmd_overlay() to avoid mdp4_dsi_cmd_clk_check() called twice from pan display route. CRs-fixed: 449809 Change-Id: Idbeb968e6af73abac2bb8c800a8c55015ea6a0bf Signed-off-by: Kuogee Hsieh --- drivers/video/msm/mdp4_overlay_dsi_cmd.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) 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);