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

Commit d338fa3a authored by Abhijit Kulkarni's avatar Abhijit Kulkarni
Browse files

drm/msm/sde: update kickoff_cnt before ESD status check



kickoff_cnt atomic variable is used to check if a commit is
already kicked off and driver is waiting for tx_done. This
variable should be reset in case of pingpong done timeout
before checking the ESD failure to avoid recursive
timeouts.

Change-Id: I7f9062644cc3e926bba81442c98532de601ab6a0
Signed-off-by: default avatarAbhijit Kulkarni <kabhijit@codeaurora.org>
parent 888677e7
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -520,12 +520,14 @@ static int _sde_encoder_phys_cmd_handle_ppdone_timeout(
				| SDE_ENCODER_FRAME_EVENT_SIGNAL_RELEASE_FENCE;
	struct drm_connector *conn;
	int event;
	u32 pending_kickoff_cnt;

	if (!phys_enc || !phys_enc->hw_pp || !phys_enc->hw_ctl)
		return -EINVAL;

	conn = phys_enc->connector;
	cmd_enc->pp_timeout_report_cnt++;
	pending_kickoff_cnt = atomic_read(&phys_enc->pending_kickoff_cnt);

	if (sde_encoder_phys_cmd_is_master(phys_enc)) {
		 /* trigger the retire fence if it was missed */
@@ -540,9 +542,12 @@ static int _sde_encoder_phys_cmd_handle_ppdone_timeout(

	SDE_EVT32(DRMID(phys_enc->parent), phys_enc->hw_pp->idx - PINGPONG_0,
			cmd_enc->pp_timeout_report_cnt,
			atomic_read(&phys_enc->pending_kickoff_cnt),
			pending_kickoff_cnt,
			frame_event);

	/* decrement the kickoff_cnt before checking for ESD status */
	atomic_add_unless(&phys_enc->pending_kickoff_cnt, -1, 0);

	/* check if panel is still sending TE signal or not */
	if (sde_connector_esd_status(phys_enc->connector))
		goto exit;
@@ -553,7 +558,7 @@ static int _sde_encoder_phys_cmd_handle_ppdone_timeout(
				"pp:%d kickoff timed out ctl %d koff_cnt %d\n",
				phys_enc->hw_pp->idx - PINGPONG_0,
				phys_enc->hw_ctl->idx - CTL_0,
				atomic_read(&phys_enc->pending_kickoff_cnt));
				pending_kickoff_cnt);

		SDE_EVT32(DRMID(phys_enc->parent), SDE_EVTLOG_FATAL);
		sde_encoder_helper_unregister_irq(phys_enc, INTR_IDX_RDPTR);
@@ -578,8 +583,6 @@ static int _sde_encoder_phys_cmd_handle_ppdone_timeout(
	phys_enc->enable_state = SDE_ENC_ERR_NEEDS_HW_RESET;

exit:
	atomic_add_unless(&phys_enc->pending_kickoff_cnt, -1, 0);

	if (phys_enc->parent_ops.handle_frame_done)
		phys_enc->parent_ops.handle_frame_done(
				phys_enc->parent, phys_enc, frame_event);