diff --git a/drivers/video/fbdev/msm/dsi_host_v2.c b/drivers/video/fbdev/msm/dsi_host_v2.c index 9b4afb265b00..a8a6c2b7afac 100644 --- a/drivers/video/fbdev/msm/dsi_host_v2.c +++ b/drivers/video/fbdev/msm/dsi_host_v2.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2016, 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 @@ -1000,7 +1000,7 @@ int msm_dsi_cmdlist_commit(struct mdss_dsi_ctrl_pdata *ctrl, int from_mdp) if (from_mdp) /* from mdp kickoff */ mutex_lock(&ctrl->cmd_mutex); - req = mdss_dsi_cmdlist_get(ctrl); + req = mdss_dsi_cmdlist_get(ctrl, from_mdp); if (!req) { mutex_unlock(&ctrl->cmd_mutex); diff --git a/drivers/video/fbdev/msm/mdss_dsi_cmd.c b/drivers/video/fbdev/msm/mdss_dsi_cmd.c index 0e7de6654e25..d07b504ff302 100644 --- a/drivers/video/fbdev/msm/mdss_dsi_cmd.c +++ b/drivers/video/fbdev/msm/mdss_dsi_cmd.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2016, 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 @@ -724,7 +724,8 @@ void mdss_dsi_set_tear_off(struct mdss_dsi_ctrl_pdata *ctrl) /* * mdss_dsi_cmd_get: ctrl->cmd_mutex acquired by caller */ -struct dcs_cmd_req *mdss_dsi_cmdlist_get(struct mdss_dsi_ctrl_pdata *ctrl) +struct dcs_cmd_req *mdss_dsi_cmdlist_get(struct mdss_dsi_ctrl_pdata *ctrl, + int from_mdp) { struct dcs_cmd_list *clist; struct dcs_cmd_req *req = NULL; @@ -733,6 +734,12 @@ struct dcs_cmd_req *mdss_dsi_cmdlist_get(struct mdss_dsi_ctrl_pdata *ctrl) clist = &ctrl->cmdlist; if (clist->get != clist->put) { req = &clist->list[clist->get]; + /*dont let commit thread steal ESD thread's + command*/ + if (from_mdp && (req->flags & CMD_REQ_COMMIT)) { + mutex_unlock(&ctrl->cmdlist_mutex); + return NULL; + } clist->get++; clist->get %= CMD_REQ_MAX; clist->tot--; diff --git a/drivers/video/fbdev/msm/mdss_dsi_cmd.h b/drivers/video/fbdev/msm/mdss_dsi_cmd.h index d62711558cd8..0ca968a00460 100644 --- a/drivers/video/fbdev/msm/mdss_dsi_cmd.h +++ b/drivers/video/fbdev/msm/mdss_dsi_cmd.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. +/* Copyright (c) 2012-2016, 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 @@ -133,7 +133,8 @@ int mdss_dsi_short_read2_resp(struct dsi_buf *rp); int mdss_dsi_long_read_resp(struct dsi_buf *rp); void mdss_dsi_set_tear_on(struct mdss_dsi_ctrl_pdata *ctrl); void mdss_dsi_set_tear_off(struct mdss_dsi_ctrl_pdata *ctrl); -struct dcs_cmd_req *mdss_dsi_cmdlist_get(struct mdss_dsi_ctrl_pdata *ctrl); +struct dcs_cmd_req *mdss_dsi_cmdlist_get(struct mdss_dsi_ctrl_pdata *ctrl, + int from_mdp); int mdss_dsi_cmdlist_put(struct mdss_dsi_ctrl_pdata *ctrl, struct dcs_cmd_req *cmdreq); #endif diff --git a/drivers/video/fbdev/msm/mdss_dsi_host.c b/drivers/video/fbdev/msm/mdss_dsi_host.c index cc0cbea6fced..5f9c936b54ba 100644 --- a/drivers/video/fbdev/msm/mdss_dsi_host.c +++ b/drivers/video/fbdev/msm/mdss_dsi_host.c @@ -2403,7 +2403,7 @@ int mdss_dsi_cmdlist_commit(struct mdss_dsi_ctrl_pdata *ctrl, int from_mdp) roi = &pinfo->roi; } - req = mdss_dsi_cmdlist_get(ctrl); + req = mdss_dsi_cmdlist_get(ctrl, from_mdp); if (req && from_mdp && ctrl->burst_mode_enabled) { mutex_lock(&ctrl->cmd_mutex); cmd_mutex_acquired = true;