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

Sean Paul sean at poorly.run
Thu Oct 25 14:48: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.

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 1193202766a2..dd7f3d2bbaeb 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -4648,6 +4648,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_long_pulse(struct intel_connector *connector,
 		    struct drm_modeset_acquire_ctx *ctx)
@@ -4684,15 +4699,7 @@ intel_dp_long_pulse(struct intel_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);
 
@@ -6065,6 +6072,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