msm: fb: don't commit writeback pipe if it's not enabled

If writeback display hasn't been initialized yet, skip the pipe commit
for this display, otherwise it may cause crash.

Change-Id: I93aeecad56c04ab2a3e22dc941e259e9b9cdb9b0
Signed-off-by: Vinu Deokaran <vinud@codeaurora.org>
This commit is contained in:
Vinu Deokaran 2015-05-20 13:56:03 -04:00 committed by Zhao Wei Liew
parent 7d52ccfbc9
commit 0ca7883d1a
1 changed files with 8 additions and 1 deletions

View File

@ -1,4 +1,4 @@
/* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. /* Copyright (c) 2011-2015, The Linux Foundation. All rights reserved.
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License version 2 and
@ -93,6 +93,7 @@ static void mdp4_wfd_queue_wakeup(struct msm_fb_data_type *mfd,
struct msmfb_writeback_data_list *node); struct msmfb_writeback_data_list *node);
static int mdp4_wfd_dequeue_update(struct msm_fb_data_type *mfd, static int mdp4_wfd_dequeue_update(struct msm_fb_data_type *mfd,
struct msmfb_writeback_data_list **wfdnode); struct msmfb_writeback_data_list **wfdnode);
static int is_wb_operation_allowed(struct msm_fb_data_type *mfd);
int mdp4_overlay_writeback_on(struct platform_device *pdev) int mdp4_overlay_writeback_on(struct platform_device *pdev)
{ {
@ -368,6 +369,12 @@ int mdp4_wfd_pipe_commit(struct msm_fb_data_type *mfd,
struct msmfb_writeback_data_list *node = NULL; struct msmfb_writeback_data_list *node = NULL;
int rc = 0; int rc = 0;
rc = is_wb_operation_allowed(mfd);
if (rc) {
pr_debug("%s: Unable to commit, error = %d", __func__, rc);
return rc;
}
vctrl = &vsync_ctrl_db[cndx]; vctrl = &vsync_ctrl_db[cndx];
mutex_lock(&vctrl->update_lock); mutex_lock(&vctrl->update_lock);