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

Commit 2ac4d93a authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge changes I1b3162c5,I63442826 into msm-4.14

* changes:
  drm/msm/dsi-staging: Prevent modeset on first frame update
  drm/msm/dsi-staging: avoid ESD failure during first kickoff
parents 72043e6e 4d1c1237
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.
+14 −3
Original line number Diff line number Diff line
@@ -423,9 +423,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);

@@ -4971,12 +4979,15 @@ int dsi_display_prepare(struct dsi_display *display)
	mode = display->panel->cur_mode;

	if (mode->dsi_mode_flags & DSI_MODE_FLAG_DMS) {
		if (display->is_cont_splash_enabled) {
			pr_err("DMS is not supposed to be set on first frame\n");
			return -EINVAL;
		}
		/* update dsi ctrl for new mode */
		rc = dsi_display_pre_switch(display);
		if (rc)
			pr_err("[%s] panel pre-prepare-res-switch failed, rc=%d\n",
					display->name, rc);

		goto error;
	}