|
@@ -322,6 +322,24 @@ static int intel_dp_common_len_rate_limit(struct intel_dp *intel_dp,
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+static bool intel_dp_link_params_valid(struct intel_dp *intel_dp)
|
|
|
+{
|
|
|
+ /*
|
|
|
+ * FIXME: we need to synchronize the current link parameters with
|
|
|
+ * hardware readout. Currently fast link training doesn't work on
|
|
|
+ * boot-up.
|
|
|
+ */
|
|
|
+ if (intel_dp->link_rate == 0 ||
|
|
|
+ intel_dp->link_rate > intel_dp->max_link_rate)
|
|
|
+ return false;
|
|
|
+
|
|
|
+ if (intel_dp->lane_count == 0 ||
|
|
|
+ intel_dp->lane_count > intel_dp_max_lane_count(intel_dp))
|
|
|
+ return false;
|
|
|
+
|
|
|
+ return true;
|
|
|
+}
|
|
|
+
|
|
|
int intel_dp_get_link_train_fallback_values(struct intel_dp *intel_dp,
|
|
|
int link_rate, uint8_t lane_count)
|
|
|
{
|
|
@@ -4253,9 +4271,11 @@ intel_dp_check_link_status(struct intel_dp *intel_dp)
|
|
|
if (!to_intel_crtc(intel_encoder->base.crtc)->active)
|
|
|
return;
|
|
|
|
|
|
- /* FIXME: we need to synchronize this sort of stuff with hardware
|
|
|
- * readout. Currently fast link training doesn't work on boot-up. */
|
|
|
- if (!intel_dp->lane_count)
|
|
|
+ /*
|
|
|
+ * Validate the cached values of intel_dp->link_rate and
|
|
|
+ * intel_dp->lane_count before attempting to retrain.
|
|
|
+ */
|
|
|
+ if (!intel_dp_link_params_valid(intel_dp))
|
|
|
return;
|
|
|
|
|
|
/* Retrain if Channel EQ or CR not ok */
|