From e1e791dcf5dc5d14c76fbc8b577eed9dc7f5d074 Mon Sep 17 00:00:00 2001 From: Kuogee Hsieh Date: Fri, 11 Jan 2013 10:26:01 -0800 Subject: [PATCH] msm_fb: display: add satge commit without pipes queued This patch allow satge commit without pipes queued to allow a pipe to be un-staged from mixer immediately after overlay_unset. Change-Id: I03abb907c66cce3d0559743d3bb1eb26a88dc78a Signed-off-by: Kuogee Hsieh Signed-off-by: Siddhartha Agrawal --- drivers/video/msm/mdp4_overlay_dsi_cmd.c | 11 ++++++----- drivers/video/msm/mdp4_overlay_dsi_video.c | 11 ++++++----- drivers/video/msm/mdp4_overlay_dtv.c | 9 +++++---- drivers/video/msm/mdp4_overlay_lcdc.c | 11 ++++++----- drivers/video/msm/mdp4_overlay_writeback.c | 9 +++++---- 5 files changed, 28 insertions(+), 23 deletions(-) diff --git a/drivers/video/msm/mdp4_overlay_dsi_cmd.c b/drivers/video/msm/mdp4_overlay_dsi_cmd.c index 8a5ae18e0a9..cde5c9735a4 100644 --- a/drivers/video/msm/mdp4_overlay_dsi_cmd.c +++ b/drivers/video/msm/mdp4_overlay_dsi_cmd.c @@ -1,4 +1,4 @@ -/* 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 @@ -275,10 +275,11 @@ int mdp4_dsi_cmd_pipe_commit(int cndx, int wait) mdp_update_pm(vctrl->mfd, vctrl->vsync_time); - if (vp->update_cnt == 0) { - mutex_unlock(&vctrl->update_lock); - return cnt; - } + /* + * allow stage_commit without pipes queued + * (vp->update_cnt == 0) to unstage pipes after + * overlay_unset + */ vctrl->update_ndx++; vctrl->update_ndx &= 0x01; diff --git a/drivers/video/msm/mdp4_overlay_dsi_video.c b/drivers/video/msm/mdp4_overlay_dsi_video.c index f31dd984812..6239cce43a8 100644 --- a/drivers/video/msm/mdp4_overlay_dsi_video.c +++ b/drivers/video/msm/mdp4_overlay_dsi_video.c @@ -170,10 +170,11 @@ int mdp4_dsi_video_pipe_commit(int cndx, int wait) mdp_update_pm(vctrl->mfd, vctrl->vsync_time); - if (vp->update_cnt == 0) { - mutex_unlock(&vctrl->update_lock); - return cnt; - } + /* + * allow stage_commit without pipes queued + * (vp->update_cnt == 0) to unstage pipes after + * overlay_unset + */ vctrl->update_ndx++; vctrl->update_ndx &= 0x01; @@ -1137,7 +1138,7 @@ void mdp4_dsi_video_overlay(struct msm_fb_data_type *mfd) mdp4_overlay_mdp_perf_upd(mfd, 1); cnt = mdp4_dsi_video_pipe_commit(cndx, 0); - if (cnt) { + if (cnt >= 0) { if (pipe->ov_blt_addr) mdp4_dsi_video_wait4ov(cndx); else diff --git a/drivers/video/msm/mdp4_overlay_dtv.c b/drivers/video/msm/mdp4_overlay_dtv.c index 7f3e287098d..34983a4a4f5 100644 --- a/drivers/video/msm/mdp4_overlay_dtv.c +++ b/drivers/video/msm/mdp4_overlay_dtv.c @@ -188,10 +188,11 @@ int mdp4_dtv_pipe_commit(int cndx, int wait) mdp_update_pm(vctrl->mfd, vctrl->vsync_time); - if (vp->update_cnt == 0) { - mutex_unlock(&vctrl->update_lock); - return 0; - } + /* + * allow stage_commit without pipes queued + * (vp->update_cnt == 0) to unstage pipes after + * overlay_unset + */ vctrl->update_ndx++; vctrl->update_ndx &= 0x01; diff --git a/drivers/video/msm/mdp4_overlay_lcdc.c b/drivers/video/msm/mdp4_overlay_lcdc.c index 7a320013dab..9feaaca0747 100644 --- a/drivers/video/msm/mdp4_overlay_lcdc.c +++ b/drivers/video/msm/mdp4_overlay_lcdc.c @@ -174,10 +174,11 @@ int mdp4_lcdc_pipe_commit(int cndx, int wait) mdp_update_pm(vctrl->mfd, vctrl->vsync_time); - if (vp->update_cnt == 0) { - mutex_unlock(&vctrl->update_lock); - return 0; - } + /* + * allow stage_commit without pipes queued + * (vp->update_cnt == 0) to unstage pipes after + * overlay_unset + */ vctrl->update_ndx++; vctrl->update_ndx &= 0x01; @@ -977,7 +978,7 @@ void mdp4_lcdc_overlay(struct msm_fb_data_type *mfd) mdp4_overlay_mdp_perf_upd(mfd, 1); cnt = mdp4_lcdc_pipe_commit(cndx, 0); - if (cnt) { + if (cnt >= 0) { if (pipe->ov_blt_addr) mdp4_lcdc_wait4ov(cndx); else diff --git a/drivers/video/msm/mdp4_overlay_writeback.c b/drivers/video/msm/mdp4_overlay_writeback.c index bd20e821518..82feabaea29 100644 --- a/drivers/video/msm/mdp4_overlay_writeback.c +++ b/drivers/video/msm/mdp4_overlay_writeback.c @@ -344,10 +344,11 @@ int mdp4_wfd_pipe_commit(struct msm_fb_data_type *mfd, pipe = vctrl->base_pipe; mixer = pipe->mixer_num; - if (vp->update_cnt == 0) { - mutex_unlock(&vctrl->update_lock); - return cnt; - } + /* + * allow stage_commit without pipes queued + * (vp->update_cnt == 0) to unstage pipes after + * overlay_unset + */ vctrl->update_ndx++; vctrl->update_ndx &= 0x01;