@@ -3846,6 +3846,7 @@ intel_dp_check_link_status(struct intel_dp *intel_dp)
struct intel_encoder *intel_encoder = &dp_to_dig_port(intel_dp)->base;
struct drm_device *dev = intel_dp_to_dev(intel_dp);
u8 link_status[DP_LINK_STATUS_SIZE];
+ bool check_link = false;
WARN_ON(!drm_modeset_is_locked(&dev->mode_config.connection_mutex));
@@ -3854,17 +3855,20 @@ intel_dp_check_link_status(struct intel_dp *intel_dp)
return;
}
- if (!intel_encoder->base.crtc)
- return;
-
- if (!to_intel_crtc(intel_encoder->base.crtc)->active)
- return;
-
/* if link training is requested we should perform it always */
- if ((intel_dp->compliance_test_type == DP_TEST_LINK_TRAINING) ||
- (!drm_dp_channel_eq_ok(link_status, intel_dp->lane_count))) {
- DRM_DEBUG_KMS("%s: channel EQ not ok, retraining\n",
+ if (intel_dp->compliance_test_type == DP_TEST_LINK_TRAINING) {
+ DRM_DEBUG_KMS("%s: Link training requested, retraining\n",
intel_encoder->base.name);
+ check_link = true;
+ } else if (((to_intel_crtc(intel_encoder->base.crtc)->active) &&
+ (intel_encoder->base.crtc)) &&
+ (!drm_dp_channel_eq_ok(link_status, intel_dp->lane_count))) {
+ DRM_DEBUG_KMS("%s: channel EQ not ok, retraining\n",
+ intel_encoder->base.name);
+ check_link = true;
+ }
+
+ if (check_link) {
intel_dp_start_link_train(intel_dp);
intel_dp_stop_link_train(intel_dp);
}