summaryrefslogtreecommitdiff
path: root/drivers/video/fbdev
diff options
context:
space:
mode:
authorXiaoming Zhou <zhoux@codeaurora.org>2013-09-16 15:22:52 -0400
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 20:20:54 -0700
commit26fb335032e29648ac07867e57e978ec892f03bf (patch)
treef7f085e36fa41945867e29e4b2134360dbb1f932 /drivers/video/fbdev
parentea07a5ac104d374d8ca12467b3f99d214247be1c (diff)
msm: mdss: fix a dead-lock issue on 8x10
The shutdown function involves two seperate steps: shut down the dma and unset the overlay. Due to the use of the mutex, a UI update thread can comes in between the two steps. Futher, the UI update thread does not hold the mutex while trying to check the display status. This results a dead-lock: UI update thread tries to wait for vsync event, while the display has already been shut-down. Change-Id: Ib1242c60605a85441af78dcdc75a69a209dec7d1 Signed-off-by: Xiaoming Zhou <zhoux@codeaurora.org>
Diffstat (limited to 'drivers/video/fbdev')
-rw-r--r--drivers/video/fbdev/msm/mdp3_ctrl.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/drivers/video/fbdev/msm/mdp3_ctrl.c b/drivers/video/fbdev/msm/mdp3_ctrl.c
index d92556da992c..c5f669dc2faf 100644
--- a/drivers/video/fbdev/msm/mdp3_ctrl.c
+++ b/drivers/video/fbdev/msm/mdp3_ctrl.c
@@ -673,11 +673,6 @@ static int mdp3_ctrl_display_commit_kickoff(struct msm_fb_data_type *mfd)
if (!mdp3_session || !mdp3_session->dma)
return -EINVAL;
- if (!mdp3_session->status) {
- pr_err("%s, display off!\n", __func__);
- return -EPERM;
- }
-
if (!mdp3_iommu_is_attached(MDP3_CLIENT_DMA_P)) {
pr_debug("continuous splash screen, IOMMU not attached\n");
mdp3_ctrl_off(mfd);
@@ -687,6 +682,12 @@ static int mdp3_ctrl_display_commit_kickoff(struct msm_fb_data_type *mfd)
mutex_lock(&mdp3_session->lock);
+ if (!mdp3_session->status) {
+ pr_err("%s, display off!\n", __func__);
+ mutex_unlock(&mdp3_session->lock);
+ return -EPERM;
+ }
+
data = mdp3_bufq_pop(&mdp3_session->bufq_in);
if (data) {
mdp3_session->dma->update(mdp3_session->dma,
@@ -721,11 +722,6 @@ static void mdp3_ctrl_pan_display(struct msm_fb_data_type *mfd)
if (!mdp3_session || !mdp3_session->dma)
return;
- if (!mdp3_session->status) {
- pr_err("mdp3_ctrl_pan_display, display off!\n");
- return;
- }
-
if (!mdp3_iommu_is_attached(MDP3_CLIENT_DMA_P)) {
pr_debug("continuous splash screen, IOMMU not attached\n");
mdp3_ctrl_off(mfd);
@@ -733,6 +729,12 @@ static void mdp3_ctrl_pan_display(struct msm_fb_data_type *mfd)
}
mutex_lock(&mdp3_session->lock);
+
+ if (!mdp3_session->status) {
+ pr_err("mdp3_ctrl_pan_display, display off!\n");
+ goto pan_error;
+ }
+
fbi = mfd->fbi;
bpp = fbi->var.bits_per_pixel / 8;