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: Jani Nikula <jani.nikula@intel.com>
Subject: [PATCH 5/6] drm/i915/dp_mst: Use intel_dp_mst_active_streams() instead of open-coding it
Date: Fri, 4 Apr 2025 18:03:09 +0300	[thread overview]
Message-ID: <20250404150310.1156696-6-imre.deak@intel.com> (raw)
In-Reply-To: <20250404150310.1156696-1-imre.deak@intel.com>

Use intel_dp_mst_active_streams() everywhere, instead of open-coding it.

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp.c     | 2 +-
 drivers/gpu/drm/i915/display/intel_dp_mst.c | 8 ++++----
 drivers/gpu/drm/i915/display/intel_hdcp.c   | 3 ++-
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index aae944183d111..aeb14a5455fd1 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -5018,7 +5018,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_links > 0 && link_ok &&
+		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;
diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c
index 2a4bbe692558d..9ae025ace3c0d 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
@@ -1028,7 +1028,7 @@ static void mst_stream_disable(struct intel_atomic_state *state,
 		to_intel_connector(old_conn_state->connector);
 	enum transcoder trans = old_crtc_state->cpu_transcoder;
 
-	if (intel_dp->mst.active_links == 1)
+	if (intel_dp_mst_active_streams(intel_dp) == 1)
 		intel_dp->link.active = false;
 
 	intel_hdcp_disable(intel_mst->connector);
@@ -1144,7 +1144,7 @@ static void mst_stream_post_pll_disable(struct intel_atomic_state *state,
 	struct intel_encoder *primary_encoder = to_primary_encoder(encoder);
 	struct intel_dp *intel_dp = to_primary_dp(encoder);
 
-	if (intel_dp->mst.active_links == 0 &&
+	if (intel_dp_mst_active_streams(intel_dp) == 0 &&
 	    primary_encoder->post_pll_disable)
 		primary_encoder->post_pll_disable(state, primary_encoder, old_crtc_state, old_conn_state);
 }
@@ -1157,7 +1157,7 @@ static void mst_stream_pre_pll_enable(struct intel_atomic_state *state,
 	struct intel_encoder *primary_encoder = to_primary_encoder(encoder);
 	struct intel_dp *intel_dp = to_primary_dp(encoder);
 
-	if (intel_dp->mst.active_links == 0)
+	if (intel_dp_mst_active_streams(intel_dp) == 0)
 		primary_encoder->pre_pll_enable(state, primary_encoder,
 						pipe_config, NULL);
 	else
@@ -1303,7 +1303,7 @@ static void mst_stream_enable(struct intel_atomic_state *state,
 	struct drm_dp_mst_topology_state *mst_state =
 		drm_atomic_get_new_mst_topology_state(&state->base, &intel_dp->mst.mgr);
 	enum transcoder trans = pipe_config->cpu_transcoder;
-	bool first_mst_stream = intel_dp->mst.active_links == 1;
+	bool first_mst_stream = intel_dp_mst_active_streams(intel_dp) == 1;
 	struct intel_crtc *pipe_crtc;
 	int ret, i, min_hblank;
 
diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c
index 72a43ef6e4d2a..411f17655f895 100644
--- a/drivers/gpu/drm/i915/display/intel_hdcp.c
+++ b/drivers/gpu/drm/i915/display/intel_hdcp.c
@@ -24,6 +24,7 @@
 #include "intel_display_power_well.h"
 #include "intel_display_rpm.h"
 #include "intel_display_types.h"
+#include "intel_dp_mst.h"
 #include "intel_hdcp.h"
 #include "intel_hdcp_gsc.h"
 #include "intel_hdcp_regs.h"
@@ -137,7 +138,7 @@ intel_hdcp_required_content_stream(struct intel_atomic_state *state,
 		data->k++;
 
 		/* if there is only one active stream */
-		if (dig_port->dp.mst.active_links <= 1)
+		if (intel_dp_mst_active_streams(&dig_port->dp) <= 1)
 			break;
 	}
 	drm_connector_list_iter_end(&conn_iter);
-- 
2.44.2


  parent reply	other threads:[~2025-04-04 15:03 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-04 15:03 [PATCH 0/6] drm/i915/dp_mst: Clean up active stream count tracking Imre Deak
2025-04-04 15:03 ` [PATCH 1/6] drm/i915/dp: Rename intel_dp::link_trained to link.active Imre Deak
2025-04-04 15:03 ` [PATCH 2/6] drm/i915/dp_mst: Add intel_dp_mst_{inc, dec}_active_streams() Imre Deak
2025-04-04 15:03 ` [PATCH 3/6] drm/i915/dp_mst: Remove stream count assert from intel_dp_check_mst_status() Imre Deak
2025-04-04 15:03 ` [PATCH 4/6] drm/i915/dp_mst: Rename intel_dp_mst_encoder_active_links() to intel_dp_mst_active_streams() Imre Deak
2025-04-04 15:03 ` Imre Deak [this message]
2025-04-04 15:03 ` [PATCH 6/6] drm/i915/dp_mst: Rename intel_dp::mst.active_links to mst.active_streams Imre Deak
2025-04-04 15:53 ` ✓ CI.Patch_applied: success for drm/i915/dp_mst: Clean up active stream count tracking Patchwork
2025-04-04 15:53 ` ✓ CI.checkpatch: " Patchwork
2025-04-04 15:54 ` ✓ CI.KUnit: " Patchwork
2025-04-04 16:11 ` ✓ CI.Build: " Patchwork
2025-04-04 16:13 ` ✓ CI.Hooks: " Patchwork
2025-04-04 16:15 ` ✓ CI.checksparse: " Patchwork
2025-04-04 17:00 ` ✓ Xe.CI.BAT: " Patchwork
2025-04-07 10:33 ` [PATCH 0/6] " Jani Nikula
2025-04-07 15:22 ` ✗ Xe.CI.Full: failure for " 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=20250404150310.1156696-6-imre.deak@intel.com \
    --to=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    /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