Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b4ba591 authored by Kuogee Hsieh's avatar Kuogee Hsieh
Browse files

mdss: display: extend mutex coverage inside cmdlist_put



At Current implementation mutex is released after dcs
commands had been added to queue and before cmdlist_commit
called to tx commands. This is created a possibility to allow
other thread do take over command queue and call cmdlist_commit
to tx commands which not added by it. Extend mutex coverage to
including both cmdlsit_put and cmdlist_commit to fix the problem.

CRs-Fixed: 669136
Change-Id: I317adae2b39505d96afe1edd27f1a1ab813b343d
Signed-off-by: default avatarKuogee Hsieh <khsieh@codeaurora.org>
parent c8100225
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -965,6 +965,7 @@ int msm_dsi_cmdlist_commit(struct mdss_dsi_ctrl_pdata *ctrl, int from_mdp)
		return ret;
	}

	if (from_mdp)	/* from mdp kickoff */
		mutex_lock(&ctrl->cmd_mutex);
	req = mdss_dsi_cmdlist_get(ctrl);

@@ -995,6 +996,7 @@ int msm_dsi_cmdlist_commit(struct mdss_dsi_ctrl_pdata *ctrl, int from_mdp)
	msm_dsi_clk_ctrl(&ctrl->panel_data, 0);
	mdp3_res_update(0, 1, MDP3_CLIENT_DMA_P);

	if (from_mdp)	/* from mdp kickoff */
		mutex_unlock(&ctrl->cmd_mutex);
	return 0;
}
+2 −1
Original line number Diff line number Diff line
@@ -671,7 +671,6 @@ int mdss_dsi_cmdlist_put(struct mdss_dsi_ctrl_pdata *ctrl,
		clist->get %= CMD_REQ_MAX;
		clist->tot--;
	}
	mutex_unlock(&ctrl->cmd_mutex);

	pr_debug("%s: tot=%d put=%d get=%d\n", __func__,
		clist->tot, clist->put, clist->get);
@@ -682,6 +681,8 @@ int mdss_dsi_cmdlist_put(struct mdss_dsi_ctrl_pdata *ctrl,
		else
			ret = ctrl->cmdlist_commit(ctrl, 0);
	}
	mutex_unlock(&ctrl->cmd_mutex);

	return ret;
}
+10 −5
Original line number Diff line number Diff line
@@ -1321,7 +1321,10 @@ int mdss_dsi_cmdlist_commit(struct mdss_dsi_ctrl_pdata *ctrl, int from_mdp)
	struct dcs_cmd_req *req;
	int ret = -EINVAL;
	int rc = 0;

	if (from_mdp)	/* from mdp kickoff */
		mutex_lock(&ctrl->cmd_mutex);

	req = mdss_dsi_cmdlist_get(ctrl);

	MDSS_XLOG(ctrl->ndx, from_mdp, ctrl->mdp_busy, current->pid,
@@ -1364,15 +1367,17 @@ int mdss_dsi_cmdlist_commit(struct mdss_dsi_ctrl_pdata *ctrl, int from_mdp)

need_lock:

	if (from_mdp) { /* from pipe_commit */
	MDSS_XLOG(ctrl->ndx, from_mdp, ctrl->mdp_busy, current->pid,
							XLOG_FUNC_EXIT);

	if (from_mdp) { /* from mdp kickoff */
		/* acquire lock only has new frame update */
		if (ctrl->roi.w != 0 || ctrl->roi.h != 0)
			mdss_dsi_cmd_mdp_start(ctrl);
	}

	MDSS_XLOG(ctrl->ndx, from_mdp, ctrl->mdp_busy, current->pid,
							XLOG_FUNC_EXIT);
		mutex_unlock(&ctrl->cmd_mutex);
	}

	return ret;
}