From 7945a16e5966acc85512da296efee2e66741a077 Mon Sep 17 00:00:00 2001 From: Li Zhuangzhi Date: Mon, 28 May 2012 21:39:07 +0800 Subject: [PATCH] GFX-DISPLAY: Add mutex in __dpi_panel_power_off to pretect pipe disabled after DRM_WAIT_ON signaled BZ: 37139 Issue: On Lexington phones, press power button when playing video, sometimes sounds of video will still playing for a while. Solution: Add mutex in __dpi_panel_power_off to pretect pipe disabled after DRM_WAIT_ON signaled by last vblank event when playing video, otherwise the last vblank event will lost when pipe disabled before vblank interrupt coming sometimes, it will cause the media pausing action blocking for 3s. Change-Id: I2e55e3220619bdacd9cca83c67fbaac6be1dbaa6 Signed-off-by: Li Zhuangzhi Reviewed-on: http://android.intel.com:8080/51376 Reviewed-by: Xu, Randy Tested-by: Tong, BoX Reviewed-by: Ai, Ke Reviewed-by: buildbot Tested-by: buildbot --- drivers/staging/mrst/drv/mdfld_dsi_dpi.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/staging/mrst/drv/mdfld_dsi_dpi.c b/drivers/staging/mrst/drv/mdfld_dsi_dpi.c index 5a408cc..7434e00 100644 --- a/drivers/staging/mrst/drv/mdfld_dsi_dpi.c +++ b/drivers/staging/mrst/drv/mdfld_dsi_dpi.c @@ -1781,6 +1781,13 @@ static int __dpi_panel_power_off(struct mdfld_dsi_config *dsi_config, for (i = 0; i < 256; i++) ctx->palette[i] = REG_READ(regs->palette_reg + (i<<2)); + /* + * Couldn't disable the pipe until DRM_WAIT_ON signaled by last + * vblank event when playing video, otherwise the last vblank event + * will lost when pipe disabled before vblank interrupt coming sometimes. + */ + mutex_lock(&dev->mode_config.mutex); + /*Disable panel*/ val = ctx->dspcntr; val &= ~(PIPEACONF_COLOR_MATRIX_ENABLE | PIPEACONF_GAMMA); @@ -1793,6 +1800,8 @@ static int __dpi_panel_power_off(struct mdfld_dsi_config *dsi_config, ctx->pipeconf = val; REG_WRITE(regs->pipeconf_reg, (val & ~BIT31)); + mutex_unlock(&dev->mode_config.mutex); + /*wait for pipe disabling, pipe synchronization plus , only avaiable when timer generator is working*/ -- 2.7.4