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

Commit b2c1bfad authored by Shashank Babu Chinta Venkata's avatar Shashank Babu Chinta Venkata Committed by Gerrit - the friendly Code Review server
Browse files

drm/msm/dsi-staging: avoid ESD failure during first kickoff



When ESD status is read from the panel, sometimes DSI host controller
might not be initialized. During such cases, it is not accurate to
report ESD failure and it is proper to defer this check for next
ESD status read.

CRs-Fixed: 2180708
Change-Id: I63442826599992f67677b22a68ab87e713b4eeb2
Signed-off-by: default avatarShashank Babu Chinta Venkata <sbchin@codeaurora.org>
Signed-off-by: default avatarNarendra Muppalla <NarendraM@codeaurora.org>
parent 98cd82ec
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -406,6 +406,21 @@ static int dsi_ctrl_check_state(struct dsi_ctrl *dsi_ctrl,
	return rc;
}

bool dsi_ctrl_validate_host_state(struct dsi_ctrl *dsi_ctrl)
{
	struct dsi_ctrl_state_info *state = &dsi_ctrl->current_state;

	if (!state) {
		pr_err("Invalid host state for DSI controller\n");
		return -EINVAL;
	}

	if (!state->host_initialized)
		return true;

	return false;
}

static void dsi_ctrl_update_state(struct dsi_ctrl *dsi_ctrl,
				  enum dsi_ctrl_driver_ops op,
				  u32 op_state)
+10 −0
Original line number Diff line number Diff line
@@ -546,6 +546,16 @@ int dsi_ctrl_set_power_state(struct dsi_ctrl *dsi_ctrl,
int dsi_ctrl_set_cmd_engine_state(struct dsi_ctrl *dsi_ctrl,
				  enum dsi_engine_state state);

/**
 * dsi_ctrl_validate_host_state() - validate DSI ctrl host state
 * @dsi_ctrl:            DSI Controller handle.
 *
 * Validate DSI cotroller host state
 *
 * Return: boolean indicating whether host is not initialized.
 */
bool dsi_ctrl_validate_host_state(struct dsi_ctrl *dsi_ctrl);

/**
 * dsi_ctrl_set_vid_engine_state() - set video engine state
 * @dsi_ctrl:            DSI Controller handle.
+9 −1
Original line number Diff line number Diff line
@@ -389,9 +389,17 @@ static int dsi_display_read_status(struct dsi_display_ctrl *ctrl,
	struct dsi_cmd_desc *cmds;
	u32 flags = 0;

	if (!panel)
	if (!panel || !ctrl || !ctrl->ctrl)
		return -EINVAL;

	/*
	 * When DSI controller is not in initialized state, we do not want to
	 * report a false ESD failure and hence we defer until next read
	 * happen.
	 */
	if (dsi_ctrl_validate_host_state(ctrl->ctrl))
		return 1;

	/* acquire panel_lock to make sure no commands are in progress */
	dsi_panel_acquire_panel_lock(panel);