Skip to contentSkip to conversation

drm/i915: Fall back to zero vswing/preemph if the sink doesn't like the last good values

PATCH In review [email protected] 3 participants 4 messages Oct 30, 2015 – Nov 2, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: Fall back to zero vswing/preemph if the sink doesn't like the last good values

From: Ville Syrjälä <[email protected]>

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 <[email protected]>
Cc Sivakumar Thulasimani <[email protected]>
Cc Ander Conselvan de Oliveira <[email protected]>
Fixes 5fa836a9d859 ("drm/i915: DP link training optimization")
---
 drivers/gpu/drm/i915/intel_dp.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/i915/intel_dp.c +7 -0
index ba4cbf5..9529a6e 100644
@@ -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;
 	}
Signature · 6 lines
2.4.10

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
maintainer
#1 lore raw
Quoted 6 lines · On Fri, 30 Oct 2015, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

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.

Quoted 8 lines

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

Cc Mika Kahola <[email protected]>
Cc Sivakumar Thulasimani <[email protected]>
Cc Ander Conselvan de Oliveira <[email protected]>
Fixes 5fa836a9d859 ("drm/i915: DP link training optimization")

Possibly

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91393

Quoted 26 lines
---
 drivers/gpu/drm/i915/intel_dp.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/i915/intel_dp.c +7 -0
index ba4cbf5..9529a6e 100644
@@ -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;
 	}
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw
In reply to [email protected]
Quoted 5 lines · On Fri, 2015-10-30 at 18:47 +0200, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

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.

Does the device NACKs the request?

Ander

Quoted 35 lines

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

Cc Mika Kahola <[email protected]>
Cc Sivakumar Thulasimani <[email protected]>
Cc Ander Conselvan de Oliveira <[email protected]>
Fixes 5fa836a9d859 ("drm/i915: DP link training optimization")
---
 drivers/gpu/drm/i915/intel_dp.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/i915/intel_dp.c +7 -0
index ba4cbf5..9529a6e 100644
@@ -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");

drivers/gpu/drm/i915/intel_dp.c

Quoted 2 lines
drivers/gpu/drm/i915/intel_dp.c +0 -0
 		return;
 	}

---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki
Business Identity Code: 0357606 - 4
Domiciled in Helsinki

This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw
Quoted 8 lines · Ander
Quoted 5 lines · On Fri, 2015-10-30 at 18:47 +0200, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

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.

Does the device NACKs the request?

That was my assumption, but actually it just defers it to death. I had to bump the retry count to ~48 to make it work without this patch. That was with drm.debug=0, with drm.debug=0xe it seems to work even with the current retry count of 32. Which also makes me think we should run the bat stuff both with debugs on and off to catch more problems.

Quoted 40 lines

Ander

Quoted 37 lines

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

Cc Mika Kahola <[email protected]>
Cc Sivakumar Thulasimani <[email protected]>
Cc Ander Conselvan de Oliveira <[email protected]>
Fixes 5fa836a9d859 ("drm/i915: DP link training optimization")
---
 drivers/gpu/drm/i915/intel_dp.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/i915/intel_dp.c +7 -0
index ba4cbf5..9529a6e 100644
@@ -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");
drivers/gpu/drm/i915/intel_dp.c +0 -0
 		return;
 	}
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx