Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: <intel-gfx@lists.freedesktop.org>, <intel-xe@lists.freedesktop.org>
Cc: Imre Deak <imre.deak@gmail.com>
Subject: [PATCH v2 03/20] drm/i915/dp_mst: Reuse intel_dp_check_link_state() in the HPD IRQ handler
Date: Wed, 25 Feb 2026 18:27:34 +0200	[thread overview]
Message-ID: <20260225162751.1255913-4-imre.deak@intel.com> (raw)
In-Reply-To: <20260225162751.1255913-1-imre.deak@intel.com>

From: Imre Deak <imre.deak@gmail.com>

Use intel_dp_check_link_state() in the MST HPD IRQ handler instead of
open-coding it.

Signed-off-by: Imre Deak <imre.deak@gmail.com>
---
 drivers/gpu/drm/i915/display/intel_dp.c | 34 +++----------------------
 1 file changed, 4 insertions(+), 30 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 7cd4fb130a7cd..9c7359057fc8b 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -5444,24 +5444,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
@@ -5480,9 +5462,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 (;;) {
@@ -5499,12 +5478,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);
 
@@ -5523,10 +5497,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;
 }
-- 
2.49.1


  parent reply	other threads:[~2026-02-25 16:28 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-25 16:27 [PATCH v2 00/20] drm/i915/dp: Fix few SST HPD IRQ handling issues Imre Deak
2026-02-25 16:27 ` [PATCH v2 01/20] drm/i915/dp_mst: Reprobe connector if the IRQ ESI read failed Imre Deak
2026-02-25 16:27 ` [PATCH v2 02/20] drm/i915/dp_mst: Verify the link status always the same way Imre Deak
2026-02-25 16:27 ` Imre Deak [this message]
2026-02-25 16:27 ` [PATCH v2 04/20] drm/i915/dp: Handle a tunneling IRQ after acking it Imre Deak
2026-02-25 16:27 ` [PATCH v2 05/20] drm/i915/dp: Handle the RX_CAP_CHANGED HPD IRQ Imre Deak
2026-02-25 16:27 ` [PATCH v2 06/20] drm/i915/dp: Handle the DOWNSTREAM_PORT_STATUS_CHANGED event Imre Deak
2026-02-25 16:27 ` [PATCH v2 07/20] drm/i915/dp: Don't clobber the encoder state in the HPD IRQ handler Imre Deak
2026-02-25 16:27 ` [PATCH v2 08/20] drm/i915/dp: Remove the device service IRQ handling from connector detect Imre Deak
2026-02-25 16:27 ` [PATCH v2 09/20] drm/i915/dp: Fix the device service IRQ DPCD_REV check Imre Deak
2026-02-25 16:27 ` [PATCH v2 10/20] drm/i915/dp: Fix the link " Imre Deak
2026-02-25 16:27 ` [PATCH v2 11/20] drm/i915/dp: Reprobe connector if getting/acking device IRQs fails Imre Deak
2026-02-25 16:27 ` [PATCH v2 12/20] drm/i915/dp: Reprobe connector if getting/acking link service " Imre Deak
2026-02-25 16:27 ` [PATCH v2 13/20] drm/i915/dp: Return early if getting/acking device " Imre Deak
2026-02-25 16:27 ` [PATCH v2 14/20] drm/i915/dp: Return early if getting/acking link " Imre Deak
2026-02-25 16:27 ` [PATCH v2 15/20] drm/i915/dp: Read/ack sink count and sink IRQs for SST as it's done for MST Imre Deak
2026-02-25 16:27 ` [PATCH v2 16/20] drm/i915/dp: Print debug message for a sink connected off request Imre Deak
2026-02-25 16:27 ` [PATCH v2 17/20] drm/i915/dp: Check SST link status while handling link service IRQs Imre Deak
2026-02-25 16:27 ` [PATCH v2 18/20] drm/i915/dp_mst: Reuse intel_dp_handle_link_service_irq() Imre Deak
2026-02-25 16:27 ` [PATCH v2 19/20] drm/i915/dp: Ack only the handled device service IRQs Imre Deak
2026-02-25 16:27 ` [PATCH v2 20/20] drm/i915/dp: Ack only the handled link " Imre Deak
2026-02-25 16:34 ` [PATCH v2 00/20] drm/i915/dp: Fix few SST HPD IRQ handling issues Imre Deak
2026-02-25 16:52 ` ✓ CI.KUnit: success for drm/i915/dp: Fix few SST HPD IRQ handling issues (rev2) Patchwork
2026-02-25 17:26 ` ✓ Xe.CI.BAT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260225162751.1255913-4-imre.deak@intel.com \
    --to=imre.deak@intel.com \
    --cc=imre.deak@gmail.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox