Skip to content

Commit e118514

Browse files
ideakjnikula
authored andcommitted
drm/i915: Reenable LTTPR non-transparent LT mode for DPCD_REV<1.4
The driver currently disables the LTTPR non-transparent link training mode for sinks with a DPCD_REV<1.4, based on the following description of the LTTPR DPCD register range in DP standard 2.0 (at the 0xF0000 register description): "" LTTPR-related registers at DPCD Addresses F0000h through F02FFh are valid only for DPCD r1.4 (or higher). """ The transparent link training mode should still work fine, however the implementation for this in some retimer FWs seems to be broken, see the References: link below. After discussions with DP standard authors the above "DPCD r1.4" does not refer to the DPCD revision (stored in the DPCD_REV reg at 0x00000), rather to the "LTTPR field data structure revision" stored in the 0xF0000 reg. An update request has been filed at vesa.org (see wg/Link/documentComment/3746) for the upcoming v2.1 specification to clarify the above description along the following lines: """ LTTPR-related registers at DPCD Addresses F0000h through F02FFh are valid only for LT_TUNABLE_PHY_REPEATER_FIELD_DATA_STRUCTURE_REV 1.4 (or higher) """ Based on my tests Windows uses the non-transparent link training mode for DPCD_REV==1.2 sinks as well (so presumably for all DPCD_REVs), and forcing it to use transparent mode on ICL/TGL platforms leads to the same LT failure as reported at the References: link. Based on the above let's assume that the transparent link training mode is not well tested/supported and align the code to the correct interpretation of what the r1.4 version refers to. Reported-and-tested-by: Casey Harkins <[email protected]> Tested-by: Khaled Almahallawy <[email protected]> References: https://gitlab.freedesktop.org/drm/intel/-/issues/3415 Fixes: 264613b ("drm/i915: Disable LTTPR support when the DPCD rev < 1.4") Cc: <[email protected]> # v5.11+ Signed-off-by: Imre Deak <[email protected]> Reviewed-by: Khaled Almahallawy <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit cb4920c) Signed-off-by: Jani Nikula <[email protected]>
1 parent c468154 commit e118514

File tree

1 file changed

+33
-38
lines changed

1 file changed

+33
-38
lines changed

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

Lines changed: 33 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -128,49 +128,13 @@ intel_dp_set_lttpr_transparent_mode(struct intel_dp *intel_dp, bool enable)
128128
return drm_dp_dpcd_write(&intel_dp->aux, DP_PHY_REPEATER_MODE, &val, 1) == 1;
129129
}
130130

131-
/**
132-
* intel_dp_init_lttpr_and_dprx_caps - detect LTTPR and DPRX caps, init the LTTPR link training mode
133-
* @intel_dp: Intel DP struct
134-
*
135-
* Read the LTTPR common and DPRX capabilities and switch to non-transparent
136-
* link training mode if any is detected and read the PHY capabilities for all
137-
* detected LTTPRs. In case of an LTTPR detection error or if the number of
138-
* LTTPRs is more than is supported (8), fall back to the no-LTTPR,
139-
* transparent mode link training mode.
140-
*
141-
* Returns:
142-
* >0 if LTTPRs were detected and the non-transparent LT mode was set. The
143-
* DPRX capabilities are read out.
144-
* 0 if no LTTPRs or more than 8 LTTPRs were detected or in case of a
145-
* detection failure and the transparent LT mode was set. The DPRX
146-
* capabilities are read out.
147-
* <0 Reading out the DPRX capabilities failed.
148-
*/
149-
int intel_dp_init_lttpr_and_dprx_caps(struct intel_dp *intel_dp)
131+
static int intel_dp_init_lttpr(struct intel_dp *intel_dp)
150132
{
151133
int lttpr_count;
152-
bool ret;
153134
int i;
154135

155-
ret = intel_dp_read_lttpr_common_caps(intel_dp);
156-
157-
/* The DPTX shall read the DPRX caps after LTTPR detection. */
158-
if (drm_dp_read_dpcd_caps(&intel_dp->aux, intel_dp->dpcd)) {
159-
intel_dp_reset_lttpr_common_caps(intel_dp);
160-
return -EIO;
161-
}
162-
163-
if (!ret)
164-
return 0;
165-
166-
/*
167-
* The 0xF0000-0xF02FF range is only valid if the DPCD revision is
168-
* at least 1.4.
169-
*/
170-
if (intel_dp->dpcd[DP_DPCD_REV] < 0x14) {
171-
intel_dp_reset_lttpr_common_caps(intel_dp);
136+
if (!intel_dp_read_lttpr_common_caps(intel_dp))
172137
return 0;
173-
}
174138

175139
lttpr_count = drm_dp_lttpr_count(intel_dp->lttpr_common_caps);
176140
/*
@@ -211,6 +175,37 @@ int intel_dp_init_lttpr_and_dprx_caps(struct intel_dp *intel_dp)
211175

212176
return lttpr_count;
213177
}
178+
179+
/**
180+
* intel_dp_init_lttpr_and_dprx_caps - detect LTTPR and DPRX caps, init the LTTPR link training mode
181+
* @intel_dp: Intel DP struct
182+
*
183+
* Read the LTTPR common and DPRX capabilities and switch to non-transparent
184+
* link training mode if any is detected and read the PHY capabilities for all
185+
* detected LTTPRs. In case of an LTTPR detection error or if the number of
186+
* LTTPRs is more than is supported (8), fall back to the no-LTTPR,
187+
* transparent mode link training mode.
188+
*
189+
* Returns:
190+
* >0 if LTTPRs were detected and the non-transparent LT mode was set. The
191+
* DPRX capabilities are read out.
192+
* 0 if no LTTPRs or more than 8 LTTPRs were detected or in case of a
193+
* detection failure and the transparent LT mode was set. The DPRX
194+
* capabilities are read out.
195+
* <0 Reading out the DPRX capabilities failed.
196+
*/
197+
int intel_dp_init_lttpr_and_dprx_caps(struct intel_dp *intel_dp)
198+
{
199+
int lttpr_count = intel_dp_init_lttpr(intel_dp);
200+
201+
/* The DPTX shall read the DPRX caps after LTTPR detection. */
202+
if (drm_dp_read_dpcd_caps(&intel_dp->aux, intel_dp->dpcd)) {
203+
intel_dp_reset_lttpr_common_caps(intel_dp);
204+
return -EIO;
205+
}
206+
207+
return lttpr_count;
208+
}
214209
EXPORT_SYMBOL(intel_dp_init_lttpr_and_dprx_caps);
215210

216211
static u8 dp_voltage_max(u8 preemph)

0 commit comments

Comments
 (0)