Skip to contentSkip to conversation

drm/i915: Disable link training optimization if DP config has changed

PATCH In review Mika Kahola 4 participants 7 messages Jan 5, 2016 – Apr 18, 2016

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

v6 cover drm/i915: Disable link training optimization if DP config has changed

These three patches are fixes for DP link trainging failures and flickering issues reported by https://bugs.freedesktop.org/show_bug.cgi?id=91393

Mika Kahola (3):
drm/i915: Disable fast link training if DP config changes drm/i915: Check DP no aux transaction bit on link training drm/i915: DP channel EQ check for use of DP link training optimization

 drivers/gpu/drm/i915/intel_dp.c               |  9 ++++++++-
 drivers/gpu/drm/i915/intel_dp_link_training.c | 22 ++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_drv.h              |  1 +
 3 files changed, 31 insertions(+), 1 deletion(-)
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH v6 1/3 drm/i915: Disable fast link training if DP config changes

Disable DP link training optimization if DP link configuration changes. If one of the DP link parameters i.e. link rate or lane count changes the link training does no longer apply the previously computed drive current and pre-emphasis level. Instead, the link training is started with zero values.

v6: Debug message update to use yesno() routine (Ville)

v5: Commit message update. Split the original patch in two.
This part considers only changes on link configuration. Removed unnecessary debug messages. (Ville)

v4: Parameter and debug message naming improvements.
Fix for link parameter check (Ville)

v3: Remove cached old link parameters. Instead, disable
fast link training feature when link parameters are set (Ville)

v2: Readout DPCD register to check if no aux handshaking is
required in link training (Ander)

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

---
 drivers/gpu/drm/i915/intel_dp.c               | 5 +++++
 drivers/gpu/drm/i915/intel_dp_link_training.c | 3 +++
 2 files changed, 8 insertions(+)
drivers/gpu/drm/i915/intel_dp.c +5 -0
index 796e3d3..6b36d82 100644
@@ -1676,6 +1676,11 @@ found:
 void intel_dp_set_link_params(struct intel_dp *intel_dp,
 			      const struct intel_crtc_state *pipe_config)
 {
+	if (intel_dp->link_rate != pipe_config->port_clock ||
+	    intel_dp->lane_count != pipe_config->lane_count) {
+		intel_dp->train_set_valid = false;
+	}
+
 	intel_dp->link_rate = pipe_config->port_clock;
 	intel_dp->lane_count = pipe_config->lane_count;
 }
drivers/gpu/drm/i915/intel_dp_link_training.c +3 -0
index 8888793..8f22c92 100644
@@ -85,6 +85,9 @@ static bool
 intel_dp_reset_link_train(struct intel_dp *intel_dp,
 			uint8_t dp_train_pat)
 {
+	DRM_DEBUG_KMS("link training optimization: %s\n",
+		      yesno(intel_dp->train_set_valid));
+
 	if (!intel_dp->train_set_valid)
 		memset(intel_dp->train_set, 0, sizeof(intel_dp->train_set));
 	intel_dp_set_signal_levels(intel_dp);
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

PATCH v6 2/3 drm/i915: Check DP no aux transaction bit on link training

In reply to Mika Kahola

Check if *NO_AUX_TRANSACTIONS_LINK_TRAINING* bit is set on DPCD registers. If this bit is set, we can reuse the known good drive current and pre-emphasis level from the last "full" link training.

v2: Commit message update (Thierry)

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

---
 drivers/gpu/drm/i915/intel_dp.c               |  2 +-
 drivers/gpu/drm/i915/intel_dp_link_training.c | 19 +++++++++++++++++++
 drivers/gpu/drm/i915/intel_drv.h              |  1 +
 3 files changed, 21 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_dp.c +1 -1
index 6b36d82..3137187 100644
@@ -3852,7 +3852,7 @@ intel_dp_link_down(struct intel_dp *intel_dp)
 	intel_dp->DP = DP;
 }
 
-static bool
+bool
 intel_dp_get_dpcd(struct intel_dp *intel_dp)
 {
 	struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
drivers/gpu/drm/i915/intel_dp_link_training.c +19 -0
index 8f22c92..bcf2801 100644
@@ -85,6 +85,25 @@ static bool
 intel_dp_reset_link_train(struct intel_dp *intel_dp,
 			uint8_t dp_train_pat)
 {
+	bool has_dpcd;
+	bool no_aux_handshake = false;
+
+	has_dpcd = intel_dp_get_dpcd(intel_dp);
+
+	/*
+	 * Source device can try to use drive current and pre-emphasis
+	 * parameters computed by the last "full" link training if the
+	 * DP_NO_AUX_HANDSHAKE_LINK_TRAINING bit is set to 1.
+	 */
+	if (has_dpcd) {
+		if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11) {
+			no_aux_handshake = (intel_dp->dpcd[DP_MAX_DOWNSPREAD] &
+					    DP_NO_AUX_HANDSHAKE_LINK_TRAINING);
+		}
+	}
+
+	intel_dp->train_set_valid &= no_aux_handshake;
+
 	DRM_DEBUG_KMS("link training optimization: %s\n",
 		      yesno(intel_dp->train_set_valid));
 
drivers/gpu/drm/i915/intel_drv.h +1 -0
index 0438b57..918bdf1 100644
@@ -1250,6 +1250,7 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc);
 bool intel_dp_compute_config(struct intel_encoder *encoder,
 			     struct intel_crtc_state *pipe_config);
 bool intel_dp_is_edp(struct drm_device *dev, enum port port);
+bool intel_dp_get_dpcd(struct intel_dp *intel_dp);
 enum irqreturn intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port,
 				  bool long_hpd);
 void intel_edp_backlight_on(struct intel_dp *intel_dp);
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

PATCH v6 3/3 drm/i915: DP channel EQ check for use of DP link training optimization

In reply to Mika Kahola

Don't use DP link training optimization if channel EQ is not ok. It has been reported that in case of failure in channel EQ check the link training optimization can be enabled and therefore may not be able to reuse the previously computed drive current and pre-emphasis levels.

v2: Added MST case (Ville)

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

---
 drivers/gpu/drm/i915/intel_dp.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/intel_dp.c +2 -0
index 3137187..c995dbd 100644
@@ -4254,6 +4254,7 @@ go_again:
 			if (intel_dp->active_mst_links &&
 			    !drm_dp_channel_eq_ok(&esi[10], intel_dp->lane_count)) {
 				DRM_DEBUG_KMS("channel EQ not ok, retraining\n");
+				intel_dp->train_set_valid = false;
 				intel_dp_start_link_train(intel_dp);
 				intel_dp_stop_link_train(intel_dp);
 			}
@@ -4354,6 +4355,7 @@ intel_dp_check_link_status(struct intel_dp *intel_dp)
 		(!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);
+		intel_dp->train_set_valid = false;
 		intel_dp_start_link_train(intel_dp);
 		intel_dp_stop_link_train(intel_dp);
 	}
Signature · 6 lines
1.9.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v6 3/3
#4 lore raw

Re: [PATCH v6 3/3] drm/i915: DP channel EQ check for use of DP link training optimization

Quoted 9 lines · Mika Kahola

Don't use DP link training optimization if channel EQ is not ok. It has been reported that in case of failure in channel EQ check the link training optimization can be enabled and therefore may not be able to reuse the previously computed drive current and pre-emphasis levels.

v2: Added MST case (Ville)

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

Quoted 26 lines
---
 drivers/gpu/drm/i915/intel_dp.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/intel_dp.c +2 -0
index 3137187..c995dbd 100644
@@ -4254,6 +4254,7 @@ go_again:
 			if (intel_dp->active_mst_links &&
 			    !drm_dp_channel_eq_ok(&esi[10], intel_dp->lane_count)) {
 				DRM_DEBUG_KMS("channel EQ not ok, retraining\n");
+				intel_dp->train_set_valid = false;
 				intel_dp_start_link_train(intel_dp);
 				intel_dp_stop_link_train(intel_dp);
 			}
@@ -4354,6 +4355,7 @@ intel_dp_check_link_status(struct intel_dp *intel_dp)
 		(!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);
+		intel_dp->train_set_valid = false;
 		intel_dp_start_link_train(intel_dp);
 		intel_dp_stop_link_train(intel_dp);
 	}
Signature · 1 line
1.9.1
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw

✓ success: Fi.CI.BAT

In reply to Mika Kahola
== Summary ==

== Summary ==

Built on 05ade905f2fda5416476677509e016ef830d181a drm-intel-nightly: 2016y-01m-05d-13h-00m-24s UTC integration manifest

Test gem_storedw_loop:

        Subgroup basic-render:
                dmesg-warn -> PASS       (bdw-nuci7)
Test kms_flip:
        Subgroup basic-flip-vs-modeset:
                dmesg-warn -> PASS       (bsw-nuc-2) UNSTABLE
Test kms_pipe_crc_basic:
        Subgroup read-crc-pipe-a:
                dmesg-warn -> PASS       (skl-i7k-2) UNSTABLE
        Subgroup read-crc-pipe-a-frame-sequence:
                pass       -> DMESG-WARN (byt-nuc) UNSTABLE
        Subgroup read-crc-pipe-b:
                dmesg-warn -> PASS       (skl-i5k-2) UNSTABLE
                dmesg-warn -> PASS       (snb-dellxps) UNSTABLE
        Subgroup suspend-read-crc-pipe-a:
                dmesg-warn -> PASS       (snb-x220t) UNSTABLE
        Subgroup suspend-read-crc-pipe-b:
                pass       -> DMESG-WARN (snb-x220t) UNSTABLE
                dmesg-warn -> PASS       (skl-i7k-2)
Test pm_rpm:
        Subgroup basic-rte:
                dmesg-warn -> PASS       (byt-nuc) UNSTABLE
bdw-nuci7        total:132  pass:122  dwarn:1   dfail:0   fail:0   skip:9  
bdw-ultra        total:132  pass:124  dwarn:2   dfail:0   fail:0   skip:6  
bsw-nuc-2        total:135  pass:114  dwarn:1   dfail:0   fail:0   skip:20 
byt-nuc          total:135  pass:120  dwarn:2   dfail:0   fail:0   skip:13 
hsw-brixbox      total:135  pass:126  dwarn:2   dfail:0   fail:0   skip:7  
hsw-gt2          total:135  pass:130  dwarn:1   dfail:0   fail:0   skip:4  
hsw-xps12        total:132  pass:125  dwarn:3   dfail:0   fail:0   skip:4  
ilk-hp8440p      total:135  pass:100  dwarn:0   dfail:0   fail:0   skip:35 
ivb-t430s        total:135  pass:127  dwarn:2   dfail:0   fail:0   skip:6  
skl-i5k-2        total:135  pass:125  dwarn:2   dfail:0   fail:0   skip:8  
skl-i7k-2        total:135  pass:125  dwarn:2   dfail:0   fail:0   skip:8  
snb-dellxps      total:135  pass:122  dwarn:1   dfail:0   fail:0   skip:12 
snb-x220t        total:135  pass:121  dwarn:2   dfail:0   fail:1   skip:11 

Results at /archive/results/CI_IGT_test/Patchwork_1084/

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#6 lore raw
In reply to Mika Kahola

05.01.2016, 15:49, Mika Kahola kirjoitti:

Quoted 8 lines

These three patches are fixes for DP link trainging failures and flickering issues reported by https://bugs.freedesktop.org/show_bug.cgi?id=91393

Mika Kahola (3):
drm/i915: Disable fast link training if DP config changes drm/i915: Check DP no aux transaction bit on link training drm/i915: DP channel EQ check for use of DP link training optimization

Quoted 4 lines
 drivers/gpu/drm/i915/intel_dp.c               |  9 ++++++++-
 drivers/gpu/drm/i915/intel_dp_link_training.c | 22 ++++++++++++++++++++++
 drivers/gpu/drm/i915/intel_drv.h              |  1 +
 3 files changed, 31 insertions(+), 1 deletion(-)

The fourth patch from the bug is missing, have you sent it to the list?

Signature · 5 lines
t
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx