Skip to content

Commit a308ccb

Browse files
committed
drm/i915: Leave FDI running after failed link training on LPT-H
Currently we disable some parts of FDI setup after a failed link training. But despite that we continue with the modeset as if everything is fine. This results in tons of noise from the state checker, and it means we're not following the proper modeset sequence for the rest of crtc enabling, nor for crtc disabling. Ideally we should abort the modeset and follow the proper disable sequence to shut off everything we enabled so far, but that would require a big rework of the modeset code. So instead just leave FDI up and running in its untrained state, and log an error. This is what we do on older platforms too. v2: Fix a typo in the commit message Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Paulo Zanoni <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 503a74e commit a308ccb

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

drivers/gpu/drm/i915/intel_ddi.c

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -675,15 +675,16 @@ void hsw_fdi_link_train(struct drm_crtc *crtc)
675675
temp = I915_READ(DP_TP_STATUS(PORT_E));
676676
if (temp & DP_TP_STATUS_AUTOTRAIN_DONE) {
677677
DRM_DEBUG_KMS("FDI link training done on step %d\n", i);
678+
break;
679+
}
678680

679-
/* Enable normal pixel sending for FDI */
680-
I915_WRITE(DP_TP_CTL(PORT_E),
681-
DP_TP_CTL_FDI_AUTOTRAIN |
682-
DP_TP_CTL_LINK_TRAIN_NORMAL |
683-
DP_TP_CTL_ENHANCED_FRAME_ENABLE |
684-
DP_TP_CTL_ENABLE);
685-
686-
return;
681+
/*
682+
* Leave things enabled even if we failed to train FDI.
683+
* Results in less fireworks from the state checker.
684+
*/
685+
if (i == ARRAY_SIZE(hsw_ddi_translations_fdi) * 2 - 1) {
686+
DRM_ERROR("FDI link training failed!\n");
687+
break;
687688
}
688689

689690
temp = I915_READ(DDI_BUF_CTL(PORT_E));
@@ -712,7 +713,12 @@ void hsw_fdi_link_train(struct drm_crtc *crtc)
712713
POSTING_READ(FDI_RX_MISC(PIPE_A));
713714
}
714715

715-
DRM_ERROR("FDI link training failed!\n");
716+
/* Enable normal pixel sending for FDI */
717+
I915_WRITE(DP_TP_CTL(PORT_E),
718+
DP_TP_CTL_FDI_AUTOTRAIN |
719+
DP_TP_CTL_LINK_TRAIN_NORMAL |
720+
DP_TP_CTL_ENHANCED_FRAME_ENABLE |
721+
DP_TP_CTL_ENABLE);
716722
}
717723

718724
void intel_ddi_init_dp_buf_reg(struct intel_encoder *encoder)

0 commit comments

Comments
 (0)