Просмотр исходного кода

disp: msm: sde: add esd check during wr_ptr wait

Move esd check to write pointer wait instead of during
write pointer timeout. With this change display will avoid
improperly signaling a retire fence and allowing two flushes
to happen within a single vsync in cases where ESD failure
is happening.

Change-Id: I6fbd76a2f6b47d3237039f66a3b1edd1f72a0a1d
Signed-off-by: Samantha Tran <[email protected]>
Samantha Tran 4 лет назад
Родитель
Сommit
dc56d01f20
2 измененных файлов с 17 добавлено и 3 удалено
  1. 15 0
      msm/sde/sde_connector.h
  2. 2 3
      msm/sde/sde_encoder_phys_cmd.c

+ 15 - 0
msm/sde/sde_connector.h

@@ -742,6 +742,21 @@ static inline enum sde_rm_topology_name sde_connector_get_old_topology_name(
 	return c_state->old_topology_name;
 }
 
+/**
+ * sde_connector_panel_dead - check if panel is dead
+ * @conn: pointer to drm connector
+ * Returns: bool indicating whether or not panel is dead based on connector
+ */
+static inline bool sde_connector_panel_dead(struct drm_connector *conn)
+{
+	struct sde_connector *sde_conn = to_sde_connector(conn);
+
+	if (!sde_conn)
+		return true;
+
+	return sde_conn->panel_dead;
+}
+
 /**
  * sde_connector_set_old_topology_name - helper to cache value of previous
  *	mode's topology

+ 2 - 3
msm/sde/sde_encoder_phys_cmd.c

@@ -1449,7 +1449,7 @@ static int _sde_encoder_phys_cmd_wait_for_wr_ptr(
 		if (ctl && ctl->ops.get_start_state)
 			frame_pending = ctl->ops.get_start_state(ctl);
 
-		ret = frame_pending ? ret : 0;
+		ret = (frame_pending || sde_connector_esd_status(phys_enc->connector)) ? ret : 0;
 
 		/*
 		 * There can be few cases of ESD where CTL_START is cleared but
@@ -1521,8 +1521,7 @@ static int _sde_encoder_phys_cmd_handle_wr_ptr_timeout(
 
 	SDE_EVT32(DRMID(phys_enc->parent), switch_te, SDE_EVTLOG_FUNC_ENTRY);
 
-	if (sde_connector_esd_status(phys_enc->connector)) {
-		/* watchdog TE already set on esd status check failure */
+	if (sde_connector_panel_dead(phys_enc->connector)) {
 		ret = _sde_encoder_phys_cmd_wait_for_wr_ptr(phys_enc);
 	} else if (switch_te) {
 		SDE_DEBUG_CMDENC(cmd_enc,