[PATCH 13/14] drm/i915/display: Consider ultrajoiner for computing maxdotclock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Move helper to check ultrajoiner from intel_dp to intel_display and
use it to compute maxdotclock.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@xxxxxxxxx>
---
 drivers/gpu/drm/i915/display/intel_display.c | 21 ++++++++++++++++++--
 drivers/gpu/drm/i915/display/intel_display.h |  2 ++
 drivers/gpu/drm/i915/display/intel_dp.c      |  8 --------
 3 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index f05e4cfd2146..cb52d412c961 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -8199,12 +8199,29 @@ void intel_setup_outputs(struct drm_i915_private *dev_priv)
 	drm_helper_move_panel_connectors_to_head(&dev_priv->drm);
 }
 
+static bool intel_display_can_use_joiner(struct intel_display *display)
+{
+	/* icl+ might use joiner */
+	return (DISPLAY_VER(display) >= 11);
+}
+
+bool intel_display_can_use_ultrajoiner(struct intel_display *display)
+{
+	struct drm_i915_private *i915 = to_i915(display->drm);
+
+	return ((DISPLAY_VER(display) == 14 && IS_DGFX(i915)) ||
+		DISPLAY_VER(display) > 14);
+}
+
 static int max_dotclock(struct drm_i915_private *i915)
 {
+	struct intel_display *display = to_intel_display(&i915->drm);
 	int max_dotclock = i915->display.cdclk.max_dotclk_freq;
 
-	/* icl+ might use joiner */
-	if (DISPLAY_VER(i915) >= 11)
+	if (intel_display_can_use_joiner(display))
+		max_dotclock *= 2;
+
+	if (intel_display_can_use_ultrajoiner(display))
 		max_dotclock *= 2;
 
 	return max_dotclock;
diff --git a/drivers/gpu/drm/i915/display/intel_display.h b/drivers/gpu/drm/i915/display/intel_display.h
index ac7b007b3b15..aa7e1b52d165 100644
--- a/drivers/gpu/drm/i915/display/intel_display.h
+++ b/drivers/gpu/drm/i915/display/intel_display.h
@@ -53,6 +53,7 @@ struct intel_atomic_state;
 struct intel_crtc;
 struct intel_crtc_state;
 struct intel_digital_port;
+struct intel_display;
 struct intel_dp;
 struct intel_encoder;
 struct intel_initial_plane_config;
@@ -600,5 +601,6 @@ bool assert_port_valid(struct drm_i915_private *i915, enum port port);
 bool intel_scanout_needs_vtd_wa(struct drm_i915_private *i915);
 
 int intel_joiner_num_pipes(const struct intel_crtc_state *crtc_state);
+bool intel_display_can_use_ultrajoiner(struct intel_display *display);
 
 #endif
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index f8e642a57ec7..79837ba05a14 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -1308,14 +1308,6 @@ bool intel_dp_has_dsc(const struct intel_connector *connector)
 	return true;
 }
 
-static bool intel_display_can_use_ultrajoiner(struct intel_display *display)
-{
-	struct drm_i915_private *i915 = to_i915(display->drm);
-
-	return ((DISPLAY_VER(display) == 14 && IS_DGFX(i915)) ||
-		DISPLAY_VER(display) > 14);
-}
-
 bool intel_dp_need_ultrajoiner(struct intel_dp *dp, int clock)
 {
 	const struct intel_encoder *encoder = &dp_to_dig_port(dp)->base;
-- 
2.45.2




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux