diff mbox series

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

Message ID 20240718081803.3338564-13-ankit.k.nautiyal@intel.com (mailing list archive)
State New, archived
Headers show
Series Ultrajoiner basic functionality series | expand

Commit Message

Nautiyal, Ankit K July 18, 2024, 8:18 a.m. UTC
Allow forcing ultrajoiner through debugfs.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@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(-)

Comments

Kandpal, Suraj Aug. 1, 2024, 7:13 a.m. UTC | #1
> -----Original Message-----
> From: Intel-gfx <intel-gfx-bounces@lists.freedesktop.org> On Behalf Of Ankit
> Nautiyal
> Sent: Thursday, July 18, 2024 1:48 PM
> To: intel-gfx@lists.freedesktop.org
> Cc: Lisovskiy, Stanislav <stanislav.lisovskiy@intel.com>; Saarinen, Jani
> <jani.saarinen@intel.com>; ville.syrjala@linux.intel.com
> Subject: [PATCH 12/12] drm/i915/intel_dp: Add support for forcing ultrajoiner
> 
> Allow forcing ultrajoiner through debugfs.
> 
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>

LGTM
Reviewed-by: Suraj Kandpal <suraj.kandpal@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 c0a1f2603274..da6d8acf710a 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -1208,7 +1208,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); @@ -
> 1216,7 +1218,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
> @@ -1255,7 +1258,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, @@ -2465,7
> +2468,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 6c607a218fbc..b23db3eb477a 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.h
> +++ b/drivers/gpu/drm/i915/display/intel_dp.h
> @@ -156,7 +156,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 d4fc4439ce2b..b4351d37b963 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> @@ -579,7 +579,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,
> @@ -1444,7 +1445,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
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index c0a1f2603274..da6d8acf710a 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -1208,7 +1208,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);
@@ -1216,7 +1218,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
@@ -1255,7 +1258,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,
@@ -2465,7 +2468,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 6c607a218fbc..b23db3eb477a 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.h
+++ b/drivers/gpu/drm/i915/display/intel_dp.h
@@ -156,7 +156,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 d4fc4439ce2b..b4351d37b963 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
@@ -579,7 +579,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,
@@ -1444,7 +1445,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,