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

Commit 9ce6a2fb authored by Dhaval Patel's avatar Dhaval Patel Committed by Gerrit - the friendly Code Review server
Browse files

disp: msm: sde: trigger esd recovery before event notification



ESD recovery schedules KICKOFF event on event_thread,
switches the vsync source to wd_timer and waits for
pending frame. This work is triggered from workthread
and it must be finished before panel dead event
notification to avoid race condition with power off
sequence. This change also cancels the delayed work
after encoder is disabled.

Change-Id: Iadc5753238a54e6dad3ff57a9b8ae3bd9644c0dc
Signed-off-by: default avatarDhaval Patel <pdhaval@codeaurora.org>
parent d9c2a8d3
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -2392,14 +2392,15 @@ static void _sde_connector_report_panel_dead(struct sde_connector *conn,
	if (conn->panel_dead)
		return;

	SDE_EVT32(SDE_EVTLOG_ERROR);
	sde_encoder_display_failure_notification(conn->encoder,
		skip_pre_kickoff);

	conn->panel_dead = true;
	event.type = DRM_EVENT_PANEL_DEAD;
	event.length = sizeof(bool);
	msm_mode_object_event_notify(&conn->base.base,
		conn->base.dev, &event, (u8 *)&conn->panel_dead);
	sde_encoder_display_failure_notification(conn->encoder,
		skip_pre_kickoff);
	SDE_EVT32(SDE_EVTLOG_ERROR);
	SDE_ERROR("esd check failed report PANEL_DEAD conn_id: %d enc_id: %d\n",
			conn->base.base.id, conn->encoder->base.id);
}
+3 −4
Original line number Diff line number Diff line
@@ -1607,8 +1607,7 @@ static void _sde_encoder_rc_restart_delayed(struct sde_encoder_virt *sde_enc,
static void _sde_encoder_rc_cancel_delayed(struct sde_encoder_virt *sde_enc,
	u32 sw_event)
{
	if (kthread_cancel_delayed_work_sync(
			&sde_enc->delayed_off_work))
	if (kthread_cancel_delayed_work_sync(&sde_enc->delayed_off_work))
		SDE_DEBUG_ENC(sde_enc, "sw_event:%d, work cancelled\n",
				sw_event);
}
@@ -2695,8 +2694,7 @@ static void sde_encoder_virt_enable(struct drm_encoder *drm_enc)
			!(msm_is_mode_seamless_vrr(cur_mode)
			|| msm_is_mode_seamless_dms(cur_mode)
			|| msm_is_mode_seamless_dyn_clk(cur_mode)))
		kthread_init_delayed_work(&sde_enc->delayed_off_work,
			sde_encoder_off_work);
		kthread_cancel_delayed_work_sync(&sde_enc->delayed_off_work);

	ret = sde_encoder_resource_control(drm_enc, SDE_ENC_RC_EVENT_KICKOFF);
	if (ret) {
@@ -2856,6 +2854,7 @@ static void sde_encoder_virt_disable(struct drm_encoder *drm_enc)
	 */
	sde_enc->crtc = NULL;
	memset(&sde_enc->mode_info, 0, sizeof(sde_enc->mode_info));
	kthread_cancel_delayed_work_sync(&sde_enc->delayed_off_work);

	SDE_DEBUG_ENC(sde_enc, "encoder disabled\n");