]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/i915/dp_mst: Reuse intel_dp_check_link_state() in the HPD IRQ handler
authorImre Deak <imre.deak@intel.com>
Wed, 25 Feb 2026 16:46:01 +0000 (18:46 +0200)
committerImre Deak <imre.deak@intel.com>
Tue, 3 Mar 2026 15:49:03 +0000 (17:49 +0200)
Use intel_dp_check_link_state() in the MST HPD IRQ handler instead of
open-coding it.

Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260225164618.1261368-4-imre.deak@intel.com
drivers/gpu/drm/i915/display/intel_dp.c

index ac6cacd19d17d89ffff61df46d026108c6d6e17a..8f0309c5c91f4976bd9c8ca2e6055df5b678c5d2 100644 (file)
@@ -5457,24 +5457,6 @@ intel_dp_mst_hpd_irq(struct intel_dp *intel_dp, u8 *esi, u8 *ack)
        }
 }
 
-static bool intel_dp_mst_link_status(struct intel_dp *intel_dp)
-{
-       struct intel_display *display = to_intel_display(intel_dp);
-       struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base;
-       u8 link_status[DP_LINK_STATUS_SIZE] = {};
-       const size_t esi_link_status_size = DP_LINK_STATUS_SIZE - 2;
-
-       if (drm_dp_dpcd_read(&intel_dp->aux, DP_LANE0_1_STATUS_ESI, link_status,
-                            esi_link_status_size) != esi_link_status_size) {
-               drm_err(display->drm,
-                       "[ENCODER:%d:%s] Failed to read link status\n",
-                       encoder->base.base.id, encoder->base.name);
-               return false;
-       }
-
-       return intel_dp_link_ok(intel_dp, link_status);
-}
-
 /**
  * intel_dp_check_mst_status - service any pending MST interrupts, check link status
  * @intel_dp: Intel DP struct
@@ -5493,9 +5475,6 @@ static bool
 intel_dp_check_mst_status(struct intel_dp *intel_dp)
 {
        struct intel_display *display = to_intel_display(intel_dp);
-       struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
-       struct intel_encoder *encoder = &dig_port->base;
-       bool link_ok = true;
        bool reprobe_needed = false;
 
        for (;;) {
@@ -5512,12 +5491,7 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp)
 
                drm_dbg_kms(display->drm, "DPRX ESI: %4ph\n", esi);
 
-               if (intel_dp_mst_active_streams(intel_dp) > 0 && link_ok &&
-                   esi[3] & LINK_STATUS_CHANGED) {
-                       if (!intel_dp_mst_link_status(intel_dp))
-                               link_ok = false;
-                       ack[3] |= LINK_STATUS_CHANGED;
-               }
+               ack[3] |= esi[3] & LINK_STATUS_CHANGED;
 
                intel_dp_mst_hpd_irq(intel_dp, esi, ack);
 
@@ -5536,10 +5510,10 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp)
 
                if (ack[1] & (DP_DOWN_REP_MSG_RDY | DP_UP_REQ_MSG_RDY))
                        drm_dp_mst_hpd_irq_send_new_request(&intel_dp->mst.mgr);
-       }
 
-       if (!link_ok || intel_dp->link.force_retrain)
-               intel_encoder_link_check_queue_work(encoder, 0);
+               if ((ack[3] & LINK_STATUS_CHANGED) || intel_dp->link.force_retrain)
+                       intel_dp_check_link_state(intel_dp);
+       }
 
        return !reprobe_needed;
 }