drm/i915/ilk-glk: Fix link training on links with LTTPRs
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/3 drm/i915/ilk-glk: Fix link training on links with LTTPRs
The spec requires to use at least 3.2ms for the AUX timeout period if there are LT-tunable PHY Repeaters on the link (2.11.2). An upcoming spec update makes this more specific, by requiring a 3.2ms minimum timeout period for the LTTPR detection reading the 0xF0000-0xF0007 range (3.6.5.1).
Accordingly disable LTTPR detection until GLK, where the maximum timeout we can set is only 1.6ms.
Link training in the non-transparent mode is known to fail at least on some SKL systems with a WD19 dock on the link, which exposes an LTTPR (see the References below). While this could have different reasons besides the too short AUX timeout used, not detecting LTTPRs (and so not using the non-transparent LT mode) fixes link training on these systems.
While at it add a code comment about the platform specific maximum timeout values.
v2: Add a comment about the g4x maximum timeout as well. (Ville)
References: https://gitlab.freedesktop.org/drm/intel/-/issues/3166
--- drivers/gpu/drm/i915/display/intel_dp_aux.c | 7 +++++++ .../gpu/drm/i915/display/intel_dp_link_training.c | 15 ++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/display/intel_dp_aux.c +7 -0
@@ -133,6 +133,7 @@ static u32 g4x_get_aux_send_ctl(struct intel_dp *intel_dp,else precharge =5 ; +/* Max timeout value on G4x-BDW: 1.6ms */ if (IS_BROADWELL (dev_priv)) timeout = DP_AUX_CH_CTL_TIME_OUT_600us;else
@@ -159,6 +160,12 @@ static u32 skl_get_aux_send_ctl(struct intel_dp *intel_dp,enum phy phy =intel_port_to_phy (i915, dig_port->base.port);u32 ret; +/* +* Max timeout values: +* SKL-GLK: 1.6ms +* CNL: 3.2ms +* ICL+: 4ms +*/ ret =DP_AUX_CH_CTL_SEND_BUSY |DP_AUX_CH_CTL_DONE | DP_AUX_CH_CTL_INTERRUPT |
drivers/gpu/drm/i915/display/intel_dp_link_training.c +12 -3
@@ -81,6 +81,18 @@ static void intel_dp_read_lttpr_phy_caps(struct intel_dp *intel_dp,static bool intel_dp_read_lttpr_common_caps (struct intel_dp *intel_dp) { +struct drm_i915_private *i915 =dp_to_i915 (intel_dp); + +if (intel_dp_is_edp (intel_dp)) +return false; + +/* +* Detecting LTTPRs must be avoided on platforms with an AUX timeout +* period < 3.2ms. (see DP Standard v2.0, 2.11.2, 3.6.6.1). +*/ +if (INTEL_GEN (i915) <10 ) +return false; +if (drm_dp_read_lttpr_common_caps (&intel_dp->aux, intel_dp->lttpr_common_caps) <0 ) { memset(intel_dp->lttpr_common_caps, 0,
@@ -126,9 +138,6 @@ int intel_dp_lttpr_init(struct intel_dp *intel_dp)bool ret;int i; -if (intel_dp_is_edp (intel_dp)) -return 0 ; - ret =intel_dp_read_lttpr_common_caps (intel_dp);if (!ret)return 0 ;
Please ignore this patchset, it's not yet the correct version rebased on v5.11 (more precisely I Cc'd stable for this version of the patchset by mistake).
I'll resend this patchset properly rebased on v5.11.
Sorry for the noise.
--Imre
Quoted 95 lines · Imre Deak
The spec requires to use at least 3.2ms for the AUX timeout period if there are LT-tunable PHY Repeaters on the link (2.11.2). An upcoming spec update makes this more specific, by requiring a 3.2ms minimum timeout period for the LTTPR detection reading the 0xF0000-0xF0007 range (3.6.5.1).
Accordingly disable LTTPR detection until GLK, where the maximum timeout we can set is only 1.6ms.
Link training in the non-transparent mode is known to fail at least on some SKL systems with a WD19 dock on the link, which exposes an LTTPR (see the References below). While this could have different reasons besides the too short AUX timeout used, not detecting LTTPRs (and so not using the non-transparent LT mode) fixes link training on these systems.
While at it add a code comment about the platform specific maximum timeout values.
v2: Add a comment about the g4x maximum timeout as well. (Ville)
Reported-by Takashi Iwai <[email protected]>Reported-and-tested-by Santiago Zarate <[email protected]>Reported-and-tested-by Bodo Graumann <[email protected]>References: https://gitlab.freedesktop.org/drm/intel/-/issues/3166
Fixes b30edfd8d0b4 ("drm/i915: Switch to LTTPR non-transparent mode link training")Cc <[email protected]> # v5.11Cc Takashi Iwai <[email protected]>Cc Ville Syrjälä <[email protected]>Signed-off-by Imre Deak <[email protected]>Reviewed-by Ville Syrjälä <[email protected]>(cherry picked from commit 984982f3ef7b240cd24c2feb2762d81d9d8da3c2)--- drivers/gpu/drm/i915/display/intel_dp_aux.c | 7 +++++++ .../gpu/drm/i915/display/intel_dp_link_training.c | 15 ++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-)drivers/gpu/drm/i915/display/intel_dp_aux.c +7
-0@@ -133,6 +133,7 @@ static u32 g4x_get_aux_send_ctl(struct intel_dp *intel_dp,else precharge =5 ; +/* Max timeout value on G4x-BDW: 1.6ms */ if (IS_BROADWELL (dev_priv)) timeout = DP_AUX_CH_CTL_TIME_OUT_600us;else @@ -159,6 +160,12 @@ static u32 skl_get_aux_send_ctl(struct intel_dp *intel_dp,enum phy phy =intel_port_to_phy (i915, dig_port->base.port);u32 ret; +/* +* Max timeout values: +* SKL-GLK: 1.6ms +* CNL: 3.2ms +* ICL+: 4ms +*/ ret =DP_AUX_CH_CTL_SEND_BUSY |DP_AUX_CH_CTL_DONE | DP_AUX_CH_CTL_INTERRUPT |drivers/gpu/drm/i915/display/intel_dp_link_training.c +12
-3@@ -81,6 +81,18 @@ static void intel_dp_read_lttpr_phy_caps(struct intel_dp *intel_dp,static bool intel_dp_read_lttpr_common_caps (struct intel_dp *intel_dp) { +struct drm_i915_private *i915 =dp_to_i915 (intel_dp); + +if (intel_dp_is_edp (intel_dp)) +return false; + +/* +* Detecting LTTPRs must be avoided on platforms with an AUX timeout +* period < 3.2ms. (see DP Standard v2.0, 2.11.2, 3.6.6.1). +*/ +if (INTEL_GEN (i915) <10 ) +return false; +if (drm_dp_read_lttpr_common_caps (&intel_dp->aux, intel_dp->lttpr_common_caps) <0 ) { memset(intel_dp->lttpr_common_caps, 0,@@ -126,9 +138,6 @@ int intel_dp_lttpr_init(struct intel_dp *intel_dp)bool ret;int i; -if (intel_dp_is_edp (intel_dp)) -return 0 ; - ret =intel_dp_read_lttpr_common_caps (intel_dp);if (!ret)return 0 ;
PATCH 2/3 drm/i915: Disable LTTPR support when the DPCD rev < 1.4
In reply to a message not in the archiveBy the specification the 0xF0000-0xF02FF range is only valid when the DPCD revision is 1.4 or higher. Disable LTTPR support if this isn't so.
Trying to detect LTTPRs returned corrupted values for the above DPCD range at least on a Skylake host with an LG 43UD79-B monitor with a DPCD revision 1.2 connected.
v2: Add the actual version check.
v3: Fix s/DRPX/DPRX/ typo.
--- drivers/gpu/drm/i915/display/intel_dp.c | 4 +- .../drm/i915/display/intel_dp_link_training.c | 48 ++++++++++++++----- .../drm/i915/display/intel_dp_link_training.h | 2 +- 3 files changed, 39 insertions(+), 15 deletions(-)
drivers/gpu/drm/i915/display/intel_dp.c +1 -3
@@ -3712,9 +3712,7 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp) {int ret; -intel_dp_lttpr_init (intel_dp); - -if (drm_dp_read_dpcd_caps (&intel_dp->aux, intel_dp->dpcd)) +if (intel_dp_init_lttpr_and_dprx_caps (intel_dp) <0 )return false;/*
drivers/gpu/drm/i915/display/intel_dp_link_training.c +37 -11
95 lines not on this page · raw message
drivers/gpu/drm/i915/display/intel_dp_link_training.h +1 -1
@@ -11,7 +11,7 @@struct intel_crtc_state ;struct intel_dp ; -int intel_dp_lttpr_init (struct intel_dp *intel_dp); +int intel_dp_init_lttpr_and_dprx_caps (struct intel_dp *intel_dp); void intel_dp_get_adjust_train(struct intel_dp *intel_dp, const struct intel_crtc_state *crtc_state,
PATCH 3/3 drm/i915: Disable LTTPR support when the LTTPR rev < 1.4
In reply to a message not in the archiveBy the specification the 0xF0000 - 0xF02FF range is only valid if the LTTPR revision at 0xF0000 is at least 1.4. Disable the LTTPR support otherwise.
--- .../gpu/drm/i915/display/intel_dp_link_training.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/display/intel_dp_link_training.c +10 -4
@@ -99,17 +99,23 @@ static bool intel_dp_read_lttpr_common_caps(struct intel_dp *intel_dp)return false;if (drm_dp_read_lttpr_common_caps (&intel_dp->aux, - intel_dp->lttpr_common_caps) <0 ) { -intel_dp_reset_lttpr_common_caps (intel_dp); -return false; - } + intel_dp->lttpr_common_caps) <0 ) + goto reset_caps;drm_dbg_kms (&dp_to_i915 (intel_dp)->drm,"LTTPR common capabilities: %*ph\n" , (int )sizeof (intel_dp->lttpr_common_caps), intel_dp->lttpr_common_caps); +/* The minimum value of LT_TUNABLE_PHY_REPEATER_FIELD_DATA_STRUCTURE_REV is 1.4 */ +if (intel_dp->lttpr_common_caps[0 ] <0x14 ) + goto reset_caps; +return true; + +reset_caps: +intel_dp_reset_lttpr_common_caps (intel_dp); +return false; } static bool