[PATCH 12/26] drm/i915/intel_dp: Add support for forcing ultrajoiner

Ankit Nautiyal ankit.k.nautiyal at intel.com
Wed Aug 7 09:27:39 UTC 2024


Allow forcing ultrajoiner through debugfs.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal at intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal at intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp.c     | 11 +++++++----
 drivers/gpu/drm/i915/display/intel_dp.h     |  4 +++-
 drivers/gpu/drm/i915/display/intel_dp_mst.c |  6 ++++--
 3 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 845116bcaa89..9e52466afdc5 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -1312,7 +1312,9 @@ bool intel_can_ultrajoiner(const struct intel_encoder *encoder)
 	return IS_DGFX(i915) && DISPLAY_VER(i915) >= 14;
 }
 
-bool intel_dp_need_ultrajoiner(struct intel_dp *dp, int clock)
+bool intel_dp_need_ultrajoiner(struct intel_dp *dp,
+			       struct intel_connector *connector,
+			       int clock)
 {
 	const struct intel_encoder *encoder = &dp_to_dig_port(dp)->base;
 	struct drm_i915_private *i915 = to_i915(encoder->base.dev);
@@ -1320,7 +1322,8 @@ bool intel_dp_need_ultrajoiner(struct intel_dp *dp, int clock)
 	if (!intel_can_ultrajoiner(encoder))
 		return false;
 
-	return clock > (i915->display.cdclk.max_dotclk_freq * 2);
+	return clock > (i915->display.cdclk.max_dotclk_freq * 2) ||
+	       connector->force_joined_pipes == INTEL_PIPE_JOINER_ULTRA;
 }
 
 static enum drm_mode_status
@@ -1359,7 +1362,7 @@ intel_dp_mode_valid(struct drm_connector *_connector,
 		target_clock = fixed_mode->clock;
 	}
 
-	if (intel_dp_need_ultrajoiner(intel_dp, target_clock)) {
+	if (intel_dp_need_ultrajoiner(intel_dp, connector, target_clock)) {
 		joined_pipes = INTEL_PIPE_JOINER_ULTRA;
 		max_dotclk *= INTEL_PIPE_JOINER_ULTRA;
 	} else if (intel_dp_need_bigjoiner(intel_dp, connector,
@@ -2569,7 +2572,7 @@ intel_dp_compute_link_config(struct intel_encoder *encoder,
 	    !intel_dp_supports_fec(intel_dp, connector, pipe_config))
 		return -EINVAL;
 
-	if (intel_dp_need_ultrajoiner(intel_dp, adjusted_mode->crtc_clock))
+	if (intel_dp_need_ultrajoiner(intel_dp, connector, adjusted_mode->crtc_clock))
 		pipe_config->joiner_pipes = GENMASK(crtc->pipe + 3, crtc->pipe);
 	else if (intel_dp_need_bigjoiner(intel_dp, connector,
 					 adjusted_mode->crtc_hdisplay,
diff --git a/drivers/gpu/drm/i915/display/intel_dp.h b/drivers/gpu/drm/i915/display/intel_dp.h
index b413b9f5fdf8..748e1a94afd2 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.h
+++ b/drivers/gpu/drm/i915/display/intel_dp.h
@@ -158,7 +158,9 @@ u8 intel_dp_dsc_get_slice_count(const struct intel_connector *connector,
 bool intel_dp_need_bigjoiner(struct intel_dp *intel_dp,
 			     struct intel_connector *connector,
 			     int hdisplay, int clock);
-bool intel_dp_need_ultrajoiner(struct intel_dp *intel_dp, int clock);
+bool intel_dp_need_ultrajoiner(struct intel_dp *intel_dp,
+			       struct intel_connector *connector,
+			       int clock);
 
 static inline unsigned int intel_dp_unused_lane_mask(int lane_count)
 {
diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c
index 67794c4254e3..c5d32bf66b55 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
@@ -580,7 +580,8 @@ static int intel_dp_mst_compute_config(struct intel_encoder *encoder,
 	if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN)
 		return -EINVAL;
 
-	if (intel_dp_need_ultrajoiner(intel_dp, adjusted_mode->crtc_clock))
+	if (intel_dp_need_ultrajoiner(intel_dp, connector,
+				      adjusted_mode->crtc_clock))
 		pipe_config->joiner_pipes = GENMASK(crtc->pipe + 3, crtc->pipe);
 	else if (intel_dp_need_bigjoiner(intel_dp, connector,
 					 adjusted_mode->crtc_hdisplay,
@@ -1479,7 +1480,8 @@ intel_dp_mst_mode_valid_ctx(struct drm_connector *connector,
 	 *   corresponding link capabilities of the sink) in case the
 	 *   stream is uncompressed for it by the last branch device.
 	 */
-	if (intel_dp_need_ultrajoiner(intel_dp, target_clock)) {
+	if (intel_dp_need_ultrajoiner(intel_dp, intel_connector,
+				      target_clock)) {
 		joined_pipes = INTEL_PIPE_JOINER_BIG;
 		max_dotclk *= INTEL_PIPE_JOINER_BIG;
 	} else if (intel_dp_need_bigjoiner(intel_dp, intel_connector,
-- 
2.45.2



More information about the Intel-gfx-trybot mailing list