[PATCH 2/4] drm/i915: dp: Don't rely on .detect() for eDP display link params

Sean Paul sean at poorly.run
Tue Oct 30 13:17:49 UTC 2018


From: Sean Paul <seanpaul at chromium.org>

Currently, we rely on .detect() being called for an eDP display to
populate the link parameters. Since we have DPCD information at
initialization (and reset), read and store the link params at that time.

Change-Id: Ibb1a3764ae19cc2b5e2479fd53c61e693fbe3c14
Signed-off-by: Sean Paul <seanpaul at chromium.org>
---
 drivers/gpu/drm/i915/intel_dp.c | 28 +++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 6b37d66194a3..fcce82509044 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -2066,6 +2066,21 @@ intel_dp_compute_link_config(struct intel_encoder *encoder,
 	return true;
 }
 
+static void
+intel_dp_reset_link_params(struct intel_dp *intel_dp)
+{
+	if (!intel_dp->reset_link_params)
+		return;
+
+	/* Initial max link lane count */
+	intel_dp->max_link_lane_count = intel_dp_max_common_lane_count(intel_dp);
+
+	/* Initial max link rate */
+	intel_dp->max_link_rate = intel_dp_max_common_rate(intel_dp);
+
+	intel_dp->reset_link_params = false;
+}
+
 bool
 intel_dp_compute_config(struct intel_encoder *encoder,
 			struct intel_crtc_state *pipe_config,
@@ -5139,15 +5154,7 @@ intel_dp_detect(struct drm_connector *connector,
 		goto out;
 	}
 
-	if (intel_dp->reset_link_params) {
-		/* Initial max link lane count */
-		intel_dp->max_link_lane_count = intel_dp_max_common_lane_count(intel_dp);
-
-		/* Initial max link rate */
-		intel_dp->max_link_rate = intel_dp_max_common_rate(intel_dp);
-
-		intel_dp->reset_link_params = false;
-	}
+	intel_dp_reset_link_params(intel_dp);
 
 	intel_dp_print_rates(intel_dp);
 
@@ -5622,6 +5629,7 @@ void intel_dp_encoder_reset(struct drm_encoder *encoder)
 		/* Reinit the power sequencer, in case BIOS did something with it. */
 		intel_dp_pps_init(intel_dp);
 		intel_edp_panel_vdd_sanitize(intel_dp);
+		intel_dp_reset_link_params(intel_dp);
 	}
 
 	pps_unlock(intel_dp);
@@ -6448,6 +6456,8 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp,
 		goto out_vdd_off;
 	}
 
+	intel_dp_reset_link_params(intel_dp);
+
 	mutex_lock(&dev->mode_config.mutex);
 	edid = drm_get_edid(connector, &intel_dp->aux.ddc);
 	if (edid) {
-- 
Sean Paul, Software Engineer, Google / Chromium OS



More information about the Intel-gfx-trybot mailing list