[Intel-gfx] [PATCH] drm/i915: Fall back to zero vswing/preemph if the sink doesn't like the last good values

ville.syrjala at linux.intel.com ville.syrjala at linux.intel.com
Fri Oct 30 09:47:36 PDT 2015


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

My Lenovo STM STDP3100 miniDP->VGA dongle doesn't seem to like it when
we try to start link training with non-zero vswing/preemphasis. So when
the initial link training DPCD write fails, retry it with zero values.

Fixes a bunch of errors like so:
[drm:intel_dp_start_link_train [i915]] *ERROR* failed to enable link training

Cc: Mika Kahola <mika.kahola at intel.com>
Cc: Sivakumar Thulasimani <sivakumar.thulasimani at intel.com>
Cc: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira at intel.com>
Fixes: 5fa836a9d859 ("drm/i915: DP link training optimization")
Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index ba4cbf5..9529a6e 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -3750,10 +3750,17 @@ intel_dp_link_training_clock_recovery(struct intel_dp *intel_dp)
 
 	DP |= DP_PORT_EN;
 
+again:
 	/* clock recovery */
 	if (!intel_dp_reset_link_train(intel_dp, &DP,
 				       DP_TRAINING_PATTERN_1 |
 				       DP_LINK_SCRAMBLING_DISABLE)) {
+		if (intel_dp->train_set_valid) {
+			DRM_DEBUG_KMS("Sink rejected link training request, trying again with zero values\n");
+			intel_dp->train_set_valid = false;
+			goto again;
+		}
+
 		DRM_ERROR("failed to enable link training\n");
 		return;
 	}
-- 
2.4.10



More information about the Intel-gfx mailing list