All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Cc: jani.nikula@intel.com, ville.syrjala@linux.intel.com,
	Arun R Murthy <arun.r.murthy@intel.com>
Subject: [RESEND v3 3/6] drm/i915/mst: abstract choosing the MST mode to use
Date: Tue, 19 Mar 2024 11:12:50 +0200	[thread overview]
Message-ID: <f626144f10b03d4609ff38a29bac013ecf3aca4e.1710839496.git.jani.nikula@intel.com> (raw)
In-Reply-To: <cover.1710839496.git.jani.nikula@intel.com>

Clarify the conditions for choosing the MST mode to use by adding a new
function intel_dp_mst_mode_choose(). This also prepares for being able
to extend the MST modes to single-stream sideband messaging.

Cc: Arun R Murthy <arun.r.murthy@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp.c | 25 +++++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 9590c8c2c4f3..127b5a89502d 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -4049,6 +4049,24 @@ static const char *intel_dp_mst_mode_str(enum drm_dp_mst_mode mst_mode)
 		return "SST";
 }
 
+static enum drm_dp_mst_mode
+intel_dp_mst_mode_choose(struct intel_dp *intel_dp,
+			 enum drm_dp_mst_mode sink_mst_mode)
+{
+	struct drm_i915_private *i915 = dp_to_i915(intel_dp);
+
+	if (!i915->display.params.enable_dp_mst)
+		return DRM_DP_SST;
+
+	if (!intel_dp_mst_source_support(intel_dp))
+		return DRM_DP_SST;
+
+	if (sink_mst_mode == DRM_DP_SST_SIDEBAND_MSG)
+		return DRM_DP_SST;
+
+	return sink_mst_mode;
+}
+
 static enum drm_dp_mst_mode
 intel_dp_mst_detect(struct intel_dp *intel_dp)
 {
@@ -4059,12 +4077,7 @@ intel_dp_mst_detect(struct intel_dp *intel_dp)
 
 	sink_mst_mode = drm_dp_read_mst_cap(&intel_dp->aux, intel_dp->dpcd);
 
-	if (i915->display.params.enable_dp_mst &&
-	    intel_dp_mst_source_support(intel_dp) &&
-	    sink_mst_mode == DRM_DP_MST)
-		mst_detect = DRM_DP_MST;
-	else
-		mst_detect = DRM_DP_SST;
+	mst_detect = intel_dp_mst_mode_choose(intel_dp, sink_mst_mode);
 
 	drm_dbg_kms(&i915->drm,
 		    "[ENCODER:%d:%s] MST support: port: %s, sink: %s, modparam: %s -> enable: %s\n",
-- 
2.39.2


  parent reply	other threads:[~2024-03-19  9:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-19  9:12 [RESEND v3 0/6] drm/i915/mst: enable MST mode for 128b/132b single-stream sideband Jani Nikula
2024-03-19  9:12 ` [RESEND v3 1/6] drm/mst: read sideband messaging cap Jani Nikula
2024-03-19  9:20   ` Jani Nikula
2024-03-19  9:46     ` Maxime Ripard
2024-03-19 11:14     ` Danilo Krummrich
2024-03-19 11:11   ` Danilo Krummrich
2024-03-19  9:12 ` [RESEND v3 2/6] drm/i915/mst: improve debug logging of DP MST mode detect Jani Nikula
2024-03-19  9:12 ` Jani Nikula [this message]
2024-03-19  9:12 ` [RESEND v3 4/6] drm/i915/mst: use the MST mode detected previously Jani Nikula
2024-03-19  9:12 ` [RESEND v3 5/6] drm/i915/mst: add intel_dp_mst_disconnect() Jani Nikula
2024-03-19  9:12 ` [RESEND v3 6/6] drm/i915/mst: enable MST mode for 128b/132b single-stream sideband Jani Nikula
2024-03-19 19:09 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/mst: enable MST mode for 128b/132b single-stream sideband (rev5) Patchwork
2024-03-19 19:09 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-03-19 19:23 ` ✓ Fi.CI.BAT: success " Patchwork
2024-03-20 15:26 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-03-21  7:29 ` [RESEND v3 0/6] drm/i915/mst: enable MST mode for 128b/132b single-stream sideband Jani Nikula

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=f626144f10b03d4609ff38a29bac013ecf3aca4e.1710839496.git.jani.nikula@intel.com \
    --to=jani.nikula@intel.com \
    --cc=arun.r.murthy@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.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 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.