Commit 603801d0 authored by Jani Nikula's avatar Jani Nikula

drm/i915/mst: abstract intel_dp_ack_sink_irq_esi()

Smaller functions make the thing easier to read. Debug log failures to
ack.

Note: Looks like we have the retry loop simply because of hysterical
raisins, dating back to the original DP MST enabling. Keep it, though I
have no idea why we have it.
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarUma Shankar <uma.shankar@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220112110319.1172110-2-jani.nikula@intel.com
parent 26950f29
...@@ -2821,6 +2821,19 @@ intel_dp_get_sink_irq_esi(struct intel_dp *intel_dp, u8 *sink_irq_vector) ...@@ -2821,6 +2821,19 @@ intel_dp_get_sink_irq_esi(struct intel_dp *intel_dp, u8 *sink_irq_vector)
DP_DPRX_ESI_LEN; DP_DPRX_ESI_LEN;
} }
static bool intel_dp_ack_sink_irq_esi(struct intel_dp *intel_dp, u8 esi[4])
{
int retry;
for (retry = 0; retry < 3; retry++) {
if (drm_dp_dpcd_write(&intel_dp->aux, DP_SINK_COUNT_ESI + 1,
&esi[1], 3) == 3)
return true;
}
return false;
}
bool bool
intel_dp_needs_vsc_sdp(const struct intel_crtc_state *crtc_state, intel_dp_needs_vsc_sdp(const struct intel_crtc_state *crtc_state,
const struct drm_connector_state *conn_state) const struct drm_connector_state *conn_state)
...@@ -3661,7 +3674,6 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp) ...@@ -3661,7 +3674,6 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp)
*/ */
u8 esi[DP_DPRX_ESI_LEN+2] = {}; u8 esi[DP_DPRX_ESI_LEN+2] = {};
bool handled; bool handled;
int retry;
if (!intel_dp_get_sink_irq_esi(intel_dp, esi)) { if (!intel_dp_get_sink_irq_esi(intel_dp, esi)) {
drm_dbg_kms(&i915->drm, drm_dbg_kms(&i915->drm,
...@@ -3686,15 +3698,8 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp) ...@@ -3686,15 +3698,8 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp)
if (!handled) if (!handled)
break; break;
for (retry = 0; retry < 3; retry++) { if (!intel_dp_ack_sink_irq_esi(intel_dp, esi))
int wret; drm_dbg_kms(&i915->drm, "Failed to ack ESI\n");
wret = drm_dp_dpcd_write(&intel_dp->aux,
DP_SINK_COUNT_ESI+1,
&esi[1], 3);
if (wret == 3)
break;
}
} }
return link_ok; return link_ok;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment