All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: jani.nikula@intel.com
Subject: [Intel-gfx] [PATCH 4/7] drm/i915/mst: abstract handling of link status in DP MST
Date: Tue,  4 Jan 2022 19:39:48 +0200	[thread overview]
Message-ID: <b71ce9442afdb775d3fe0744bf522a5a4571f90a.1641317930.git.jani.nikula@intel.com> (raw)
In-Reply-To: <cover.1641317930.git.jani.nikula@intel.com>

We'll want to expand on this, so abstract it to a separate function
first. Improve debug logging while at it.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp.c | 23 ++++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 065c4607e21f..b8ca8cfca2b4 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -3638,6 +3638,21 @@ intel_dp_mst_hpd_irq(struct intel_dp *intel_dp, u8 *esi, bool *handled)
 	}
 }
 
+static bool intel_dp_mst_link_status(struct intel_dp *intel_dp, u8 *esi)
+{
+	struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base;
+	struct drm_i915_private *i915 = to_i915(encoder->base.dev);
+
+	if (!drm_dp_channel_eq_ok(&esi[10], intel_dp->lane_count)) {
+		drm_dbg_kms(&i915->drm,
+			    "[ENCODER:%d:%s] channel EQ not ok, retraining\n",
+			    encoder->base.base.id, encoder->base.name);
+		return false;
+	}
+
+	return true;
+}
+
 /**
  * intel_dp_check_mst_status - service any pending MST interrupts, check link status
  * @intel_dp: Intel DP struct
@@ -3685,11 +3700,9 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp)
 		drm_dbg_kms(&i915->drm, "DPRX ESI: %4ph\n", esi);
 
 		/* check link status - esi[10] = 0x200c */
-		if (intel_dp->active_mst_links > 0 && link_ok &&
-		    !drm_dp_channel_eq_ok(&esi[10], intel_dp->lane_count)) {
-			drm_dbg_kms(&i915->drm,
-				    "channel EQ not ok, retraining\n");
-			link_ok = false;
+		if (intel_dp->active_mst_links > 0 && link_ok) {
+			if (!intel_dp_mst_link_status(intel_dp, esi))
+				link_ok = false;
 		}
 
 		intel_dp_mst_hpd_irq(intel_dp, esi, &handled);
-- 
2.30.2


  parent reply	other threads:[~2022-01-04 17:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-04 17:39 [Intel-gfx] [PATCH 0/7] drm/i915/mst: DP MST ESI handling improvements Jani Nikula
2022-01-04 17:39 ` [Intel-gfx] [PATCH 1/7] drm/i915/mst: fix intel_dp_mst_hpd_irq() indentation Jani Nikula
2022-01-20 10:24   ` Shankar, Uma
2022-01-04 17:39 ` [Intel-gfx] [PATCH 2/7] drm/i915/mst: abstract intel_dp_ack_sink_irq_esi() Jani Nikula
2022-01-20 10:28   ` Shankar, Uma
2022-01-20 10:32     ` Jani Nikula
2022-01-20 10:35       ` Shankar, Uma
2022-01-04 17:39 ` [Intel-gfx] [PATCH 3/7] drm/i915/mst: debug log 4 bytes of ESI right after reading Jani Nikula
2022-01-04 17:39 ` Jani Nikula [this message]
2022-01-04 17:39 ` [Intel-gfx] [PATCH 5/7] drm/i915/mst: read link status only when requested by sink in ESI Jani Nikula
2022-01-04 17:39 ` [Intel-gfx] [PATCH 6/7] drm/i915/mst: ack sink irq ESI for link status changes Jani Nikula
2022-01-04 17:39 ` [Intel-gfx] [PATCH 7/7] drm/i915/mst: only ack the ESI we actually handled Jani Nikula
2022-01-20 10:30   ` [Intel-gfx] [PATCH v2] " Jani Nikula
2022-01-04 19:11 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/mst: DP MST ESI handling improvements Patchwork
2022-01-04 20:59 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2022-01-20 11:17 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/mst: DP MST ESI handling improvements (rev2) Patchwork
2022-01-20 13:02 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " 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=b71ce9442afdb775d3fe0744bf522a5a4571f90a.1641317930.git.jani.nikula@intel.com \
    --to=jani.nikula@intel.com \
    --cc=intel-gfx@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.