[PATCH 1/2] drm/i915: dp: Initialize link params for eDP displays

Sean Paul sean at poorly.run
Tue Oct 23 18:31:27 UTC 2018


From: Sean Paul <seanpaul at chromium.org>

Since we have the DPCD information for eDP displays at initialization,
read and store the link params at that time. This avoids having to rely
on detect() being called to get correct max lane/link values.

Cc: stable at vger.kernel.org
Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
Cc: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
Signed-off-by: Sean Paul <seanpaul at chromium.org>
---
 drivers/gpu/drm/i915/intel_dp.c | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 3384a9bbdafd..8d36de98b9c8 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -5094,6 +5094,21 @@ intel_dp_unset_edid(struct intel_dp *intel_dp)
 	intel_dp->has_audio = false;
 }
 
+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;
+}
+
 static int
 intel_dp_detect(struct drm_connector *connector,
 		struct drm_modeset_acquire_ctx *ctx,
@@ -5133,15 +5148,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);
 
@@ -6444,6 +6451,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