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

Commit c4fbdb10 authored by Padmanabhan Komanduru's avatar Padmanabhan Komanduru Committed by Gerrit - the friendly Code Review server
Browse files

msm: mdss: handle ESD status for split DSI panels with broadcast mode



For split DSI panels when broadcast mode is enabled, the ESD status
check command needs to be sent to both the controllers at the same
time. Also, the status needs to be checked from the buffer of the
trigger controller. Add change to take care of this.

Change-Id: I47c8cacd657a4528d1859a34ba1d588a54357bb9
Signed-off-by: default avatarPadmanabhan Komanduru <pkomandu@codeaurora.org>
parent f5d3db32
Loading
Loading
Loading
Loading
+28 −2
Original line number Diff line number Diff line
@@ -1022,6 +1022,7 @@ static int mdss_dsi_read_status(struct mdss_dsi_ctrl_pdata *ctrl)
int mdss_dsi_reg_status_check(struct mdss_dsi_ctrl_pdata *ctrl_pdata)
{
	int ret = 0;
	struct mdss_dsi_ctrl_pdata *sctrl_pdata = NULL;

	if (ctrl_pdata == NULL) {
		pr_err("%s: Invalid input data\n", __func__);
@@ -1033,7 +1034,28 @@ int mdss_dsi_reg_status_check(struct mdss_dsi_ctrl_pdata *ctrl_pdata)
	mdss_dsi_clk_ctrl(ctrl_pdata, ctrl_pdata->dsi_clk_handle,
			  MDSS_DSI_ALL_CLKS, MDSS_DSI_CLK_ON);

	sctrl_pdata = mdss_dsi_get_other_ctrl(ctrl_pdata);
	if (!mdss_dsi_sync_wait_enable(ctrl_pdata)) {
		ret = mdss_dsi_read_status(ctrl_pdata);
	} else {
		/*
		 * Read commands to check ESD status are usually sent at
		 * the same time to both the controllers. However, if
		 * sync_wait is enabled, we need to ensure that the
		 * dcs commands are first sent to the non-trigger
		 * controller so that when the commands are triggered,
		 * both controllers receive it at the same time.
		 */
		if (mdss_dsi_sync_wait_trigger(ctrl_pdata)) {
			if (sctrl_pdata)
				ret = mdss_dsi_read_status(sctrl_pdata);
			ret = mdss_dsi_read_status(ctrl_pdata);
		} else {
			ret = mdss_dsi_read_status(ctrl_pdata);
			if (sctrl_pdata)
				ret = mdss_dsi_read_status(sctrl_pdata);
		}
	}

	/*
	 * mdss_dsi_read_status returns the number of bytes returned
@@ -1041,7 +1063,11 @@ int mdss_dsi_reg_status_check(struct mdss_dsi_ctrl_pdata *ctrl_pdata)
	 * case returns zero.
	 */
	if (ret > 0) {
		if (!mdss_dsi_sync_wait_enable(ctrl_pdata) ||
			mdss_dsi_sync_wait_trigger(ctrl_pdata))
			ret = ctrl_pdata->check_read_status(ctrl_pdata);
		else if (sctrl_pdata)
			ret = ctrl_pdata->check_read_status(sctrl_pdata);
	} else {
		pr_err("%s: Read status register returned error\n", __func__);
	}