Skip to content

Commit aeeb517

Browse files
committed
Merge tag 'drm-intel-fixes-2021-05-27' of ssh://git.freedesktop.org/git/drm/drm-intel into drm-fixes
drm/i915 fixes for v5.13-rc4: - Re-enable LTTPR non-transparent LT mode for DPCD_REV<1.4 Signed-off-by: Dave Airlie <[email protected]> From: Jani Nikula <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents b26389e + e118514 commit aeeb517

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)