msm_fb: display: add mutex during lcdc off
There has possibility that suspend operation and screen update happen simultaneously. There mutex at lcdc_off is necessary to serialize both lcdc off and pan display. CRs-fixed: 302527 Signed-off-by: Khsieh <khsieh@codeaurora.org>
This commit is contained in:
committed by
Bryan Huntsman
parent
7a7e46f6c1
commit
054dc107f9
@@ -425,6 +425,12 @@ static void mdp4_overlay_dsi_video_wait4event(struct msm_fb_data_type *mfd,
|
||||
int intr_done)
|
||||
{
|
||||
unsigned long flag;
|
||||
unsigned int data;
|
||||
|
||||
data = inpdw(MDP_BASE + DSI_VIDEO_BASE);
|
||||
data &= 0x01;
|
||||
if (data == 0) /* timing generator disabled */
|
||||
return;
|
||||
|
||||
spin_lock_irqsave(&mdp_spin_lock, flag);
|
||||
INIT_COMPLETION(dsi_video_comp);
|
||||
@@ -557,7 +563,8 @@ static void mdp4_dsi_video_do_blt(struct msm_fb_data_type *mfd, int enable)
|
||||
* timing generator
|
||||
*/
|
||||
data = inpdw(MDP_BASE + DSI_VIDEO_BASE);
|
||||
if (data) { /* timing generatore enabled */
|
||||
data &= 0x01;
|
||||
if (data) { /* timing generator enabled */
|
||||
mdp4_overlay_dsi_video_wait4event(mfd, INTR_DMA_P_DONE);
|
||||
MDP_OUTP(MDP_BASE + DSI_VIDEO_BASE, 0);
|
||||
msleep(20); /* make sure last frame is finished */
|
||||
@@ -566,7 +573,7 @@ static void mdp4_dsi_video_do_blt(struct msm_fb_data_type *mfd, int enable)
|
||||
mdp4_overlayproc_cfg(dsi_pipe);
|
||||
mdp4_overlay_dmap_xy(dsi_pipe);
|
||||
|
||||
if (data) { /* timing generatore enabled */
|
||||
if (data) { /* timing generator enabled */
|
||||
MDP_OUTP(MDP_BASE + DSI_VIDEO_BASE, 1);
|
||||
mdp4_overlay_dsi_video_wait4event(mfd, INTR_DMA_P_DONE);
|
||||
mdp4_overlay_dsi_video_wait4event(mfd, INTR_DMA_P_DONE);
|
||||
|
||||
@@ -253,6 +253,11 @@ int mdp_lcdc_on(struct platform_device *pdev)
|
||||
int mdp_lcdc_off(struct platform_device *pdev)
|
||||
{
|
||||
int ret = 0;
|
||||
struct msm_fb_data_type *mfd;
|
||||
|
||||
mfd = (struct msm_fb_data_type *)platform_get_drvdata(pdev);
|
||||
|
||||
mutex_lock(&mfd->dma->ov_mutex);
|
||||
|
||||
/* MDP cmd block enable */
|
||||
mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_ON, FALSE);
|
||||
@@ -264,6 +269,8 @@ int mdp_lcdc_off(struct platform_device *pdev)
|
||||
mdp_histogram_ctrl(FALSE);
|
||||
ret = panel_next_off(pdev);
|
||||
|
||||
mutex_unlock(&mfd->dma->ov_mutex);
|
||||
|
||||
/* delay to make sure the last frame finishes */
|
||||
msleep(16);
|
||||
|
||||
@@ -338,6 +345,12 @@ static void mdp4_overlay_lcdc_wait4event(struct msm_fb_data_type *mfd,
|
||||
int intr_done)
|
||||
{
|
||||
unsigned long flag;
|
||||
unsigned int data;
|
||||
|
||||
data = inpdw(MDP_BASE + LCDC_BASE);
|
||||
data &= 0x01;
|
||||
if (data == 0) /* timing generator disabled */
|
||||
return;
|
||||
|
||||
spin_lock_irqsave(&mdp_spin_lock, flag);
|
||||
INIT_COMPLETION(lcdc_comp);
|
||||
|
||||
Reference in New Issue
Block a user