Skip to content

Commit 28fbcde

Browse files
jnikuladdavenport-chromium
authored andcommitted
UPSTREAM: drm/i915/mst: abstract handling of link status in DP MST
We'll want to expand on this, so abstract it to a separate function first. Improve debug logging while at it. Signed-off-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Uma Shankar <uma.shankar@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220112110319.1172110-4-jani.nikula@intel.com (cherry picked from commit 1358139) Signed-off-by: Drew Davenport <ddavenport@chromium.org> BUG=b:235993998 TEST=build test Backported using forklift.py Change-Id: I6cb7d949044d76a581884b60d499aaafa10f4736
1 parent 1259157 commit 28fbcde

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

drivers/gpu/drm/i915/display/intel_dp.c

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3639,6 +3639,21 @@ intel_dp_mst_hpd_irq(struct intel_dp *intel_dp, u8 *esi, bool *handled)
36393639
}
36403640
}
36413641

3642+
static bool intel_dp_mst_link_status(struct intel_dp *intel_dp, u8 *esi)
3643+
{
3644+
struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base;
3645+
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
3646+
3647+
if (!drm_dp_channel_eq_ok(&esi[10], intel_dp->lane_count)) {
3648+
drm_dbg_kms(&i915->drm,
3649+
"[ENCODER:%d:%s] channel EQ not ok, retraining\n",
3650+
encoder->base.base.id, encoder->base.name);
3651+
return false;
3652+
}
3653+
3654+
return true;
3655+
}
3656+
36423657
/**
36433658
* intel_dp_check_mst_status - service any pending MST interrupts, check link status
36443659
* @intel_dp: Intel DP struct
@@ -3686,11 +3701,9 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp)
36863701
drm_dbg_kms(&i915->drm, "DPRX ESI: %4ph\n", esi);
36873702

36883703
/* check link status - esi[10] = 0x200c */
3689-
if (intel_dp->active_mst_links > 0 && link_ok &&
3690-
!drm_dp_channel_eq_ok(&esi[10], intel_dp->lane_count)) {
3691-
drm_dbg_kms(&i915->drm,
3692-
"channel EQ not ok, retraining\n");
3693-
link_ok = false;
3704+
if (intel_dp->active_mst_links > 0 && link_ok) {
3705+
if (!intel_dp_mst_link_status(intel_dp, esi))
3706+
link_ok = false;
36943707
}
36953708

36963709
intel_dp_mst_hpd_irq(intel_dp, esi, &handled);

0 commit comments

Comments
 (0)