diff --git a/drivers/video/msm/mdp.c b/drivers/video/msm/mdp.c index 06ef1d1fd103..e88259c61969 100644 --- a/drivers/video/msm/mdp.c +++ b/drivers/video/msm/mdp.c @@ -2,7 +2,7 @@ * * MSM MDP Interface (used by framebuffer core) * - * Copyright (c) 2007-2012, Code Aurora Forum. All rights reserved. + * Copyright (c) 2007-2013, The Linux Foundation. All rights reserved. * Copyright (C) 2007 Google Incorporated * * This software is licensed under the terms of the GNU General Public @@ -951,12 +951,10 @@ int _mdp_histogram_ctrl(boolean en, struct mdp_hist_mgmt *mgmt) int ret = 0; mutex_lock(&mgmt->mdp_hist_mutex); - if (mgmt->mdp_is_hist_start == TRUE) { - if (en) - ret = mdp_histogram_enable(mgmt); - else - ret = mdp_histogram_disable(mgmt); - } + if (mgmt->mdp_is_hist_start && !mgmt->mdp_is_hist_data && en) + ret = mdp_histogram_enable(mgmt); + else if (mgmt->mdp_is_hist_data && !en) + ret = mdp_histogram_disable(mgmt); mutex_unlock(&mgmt->mdp_hist_mutex); if (en == false) @@ -1054,7 +1052,6 @@ int mdp_histogram_stop(struct fb_info *info, uint32_t block) mgmt->mdp_is_hist_start = FALSE; if (!mfd->panel_power_on) { - mgmt->mdp_is_hist_data = FALSE; if (mgmt->hist != NULL) { mgmt->hist = NULL; complete(&mgmt->mdp_hist_comp); diff --git a/drivers/video/msm/mdp_dma_dsi_video.c b/drivers/video/msm/mdp_dma_dsi_video.c index cfbff9a51830..89657d9de11f 100644 --- a/drivers/video/msm/mdp_dma_dsi_video.c +++ b/drivers/video/msm/mdp_dma_dsi_video.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved. +/* + * Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -241,7 +242,7 @@ int mdp_dsi_video_on(struct platform_device *pdev) /*Turning on DMA_P block*/ mdp_pipe_ctrl(MDP_DMA2_BLOCK, MDP_BLOCK_POWER_ON, FALSE); } - + mdp_histogram_ctrl_all(TRUE); /* MDP cmd block disable */ mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_OFF, FALSE); @@ -251,6 +252,7 @@ int mdp_dsi_video_on(struct platform_device *pdev) int mdp_dsi_video_off(struct platform_device *pdev) { int ret = 0; + mdp_histogram_ctrl_all(FALSE); /* MDP cmd block enable */ mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_ON, FALSE); MDP_OUTP(MDP_BASE + DSI_VIDEO_BASE, 0); diff --git a/drivers/video/msm/mdp_dma_lcdc.c b/drivers/video/msm/mdp_dma_lcdc.c index c51a99adc064..668ce5303859 100644 --- a/drivers/video/msm/mdp_dma_lcdc.c +++ b/drivers/video/msm/mdp_dma_lcdc.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2008-2009, 2012 Code Aurora Forum. All rights reserved. +/* + * Copyright (c) 2008-2009, 2012-2013 The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -308,9 +309,11 @@ int mdp_lcdc_on(struct platform_device *pdev) MDP_OUTP(MDP_BASE + timer_base, 1); mdp_pipe_ctrl(block, MDP_BLOCK_POWER_ON, FALSE); } + mdp_histogram_ctrl_all(TRUE); /* MDP cmd block disable */ mdp_pipe_ctrl(MDP_CMD_BLOCK, MDP_BLOCK_POWER_OFF, FALSE); + return ret; } @@ -329,6 +332,7 @@ int mdp_lcdc_off(struct platform_device *pdev) timer_base = DTV_BASE; } #endif + mdp_histogram_ctrl_all(FALSE); down(&mfd->dma->mutex); /* MDP cmd block enable */