]> www.infradead.org Git - users/willy/xarray.git/commitdiff
drm/i915/dp: Use check link state work in the detect handler
authorImre Deak <imre.deak@intel.com>
Mon, 10 Jun 2024 16:49:24 +0000 (19:49 +0300)
committerImre Deak <imre.deak@intel.com>
Thu, 13 Jun 2024 18:26:49 +0000 (21:26 +0300)
Simplify things by retraining a DP link if a bad link is detected in the
connector detect handler from the encoder's check link state work,
similarly to how this is done after a modeset link training failure.

v2: Add TODO: comment to remove the detect-time link state check.
    (Ville)

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240610164933.2947366-13-imre.deak@intel.com
drivers/gpu/drm/i915/display/intel_dp.c
drivers/gpu/drm/i915/display/intel_dp.h

index fd6069ea8f2acf5ad1c14d93c5a2a5be37b7fe8d..06ebf3267038950cca997c21c65ff6ec593aa57b 100644 (file)
@@ -5169,8 +5169,8 @@ static bool intel_dp_is_connected(struct intel_dp *intel_dp)
                intel_dp->is_mst;
 }
 
-int intel_dp_retrain_link(struct intel_encoder *encoder,
-                         struct drm_modeset_acquire_ctx *ctx)
+static int intel_dp_retrain_link(struct intel_encoder *encoder,
+                                struct drm_modeset_acquire_ctx *ctx)
 {
        struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
        struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
@@ -5904,12 +5904,13 @@ intel_dp_detect(struct drm_connector *connector,
        /*
         * Some external monitors do not signal loss of link synchronization
         * with an IRQ_HPD, so force a link status check.
+        *
+        * TODO: this probably became redundant, so remove it: the link state
+        * is rechecked/recovered now after modesets, where the loss of
+        * synchronization tends to occur.
         */
-       if (!intel_dp_is_edp(intel_dp)) {
-               ret = intel_dp_retrain_link(encoder, ctx);
-               if (ret)
-                       return ret;
-       }
+       if (!intel_dp_is_edp(intel_dp))
+               intel_dp_check_link_state(intel_dp);
 
        /*
         * Clearing NACK and defer counts to get their exact values
index a283641c1a9c0d6461dd3ebc318abd7f2da2ec6d..0dca688fac6b53fa25545ee2e9215e98de12c6c6 100644 (file)
@@ -57,8 +57,6 @@ void intel_dp_set_link_params(struct intel_dp *intel_dp,
 int intel_dp_get_active_pipes(struct intel_dp *intel_dp,
                              struct drm_modeset_acquire_ctx *ctx,
                              u8 *pipe_mask);
-int intel_dp_retrain_link(struct intel_encoder *encoder,
-                         struct drm_modeset_acquire_ctx *ctx);
 void intel_dp_link_check(struct intel_encoder *encoder);
 void intel_dp_check_link_state(struct intel_dp *intel_dp);
 void intel_dp_set_power(struct intel_dp *intel_dp, u8 mode);