[PATCH 12/12] drm/i915/display: Move intel_joiner_num_pipes to intel dss

Ankit Nautiyal ankit.k.nautiyal at intel.com
Mon Aug 26 11:15:26 UTC 2024


In line with other joiner helpers, move the function to get the number
of joined pipes to intel_dss.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal at intel.com>
---
 drivers/gpu/drm/i915/display/intel_display.c | 13 ++++---------
 drivers/gpu/drm/i915/display/intel_dss.c     |  5 +++++
 drivers/gpu/drm/i915/display/intel_dss.h     |  1 +
 3 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 432d39415689..51090190bc17 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -249,11 +249,6 @@ is_trans_port_sync_mode(const struct intel_crtc_state *crtc_state)
 		is_trans_port_sync_slave(crtc_state);
 }
 
-static int intel_joiner_num_pipes(const struct intel_crtc_state *crtc_state)
-{
-	return hweight8(crtc_state->joiner_pipes);
-}
-
 struct intel_crtc *intel_primary_crtc(const struct intel_crtc_state *crtc_state)
 {
 	struct drm_i915_private *i915 = to_i915(crtc_state->uapi.crtc->dev);
@@ -2308,7 +2303,7 @@ static void intel_crtc_compute_pixel_rate(struct intel_crtc_state *crtc_state)
 static void intel_joiner_adjust_timings(const struct intel_crtc_state *crtc_state,
 					struct drm_display_mode *mode)
 {
-	int num_pipes = intel_joiner_num_pipes(crtc_state);
+	int num_pipes = intel_dss_get_num_joiner_pipes(crtc_state);
 
 	if (num_pipes < 2)
 		return;
@@ -2372,7 +2367,7 @@ static void intel_crtc_readout_derived_state(struct intel_crtc_state *crtc_state
 	drm_mode_copy(mode, pipe_mode);
 	intel_mode_from_crtc_timings(mode, mode);
 	mode->hdisplay = drm_rect_width(&crtc_state->pipe_src) *
-		(intel_joiner_num_pipes(crtc_state) ?: 1);
+		(intel_dss_get_num_joiner_pipes(crtc_state) ?: 1);
 	mode->vdisplay = drm_rect_height(&crtc_state->pipe_src);
 
 	/* Derive per-pipe timings in case joiner is used */
@@ -2392,7 +2387,7 @@ void intel_encoder_get_config(struct intel_encoder *encoder,
 
 static void intel_joiner_compute_pipe_src(struct intel_crtc_state *crtc_state)
 {
-	int num_pipes = intel_joiner_num_pipes(crtc_state);
+	int num_pipes = intel_dss_get_num_joiner_pipes(crtc_state);
 	int width, height;
 
 	if (num_pipes < 2)
@@ -2852,7 +2847,7 @@ static void intel_get_transcoder_timings(struct intel_crtc *crtc,
 static void intel_joiner_adjust_pipe_src(struct intel_crtc_state *crtc_state)
 {
 	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
-	int num_pipes = intel_joiner_num_pipes(crtc_state);
+	int num_pipes = intel_dss_get_num_joiner_pipes(crtc_state);
 	enum pipe primary_pipe, pipe = crtc->pipe;
 	int width;
 
diff --git a/drivers/gpu/drm/i915/display/intel_dss.c b/drivers/gpu/drm/i915/display/intel_dss.c
index 976fdcac4b55..cdab6ec5f7a0 100644
--- a/drivers/gpu/drm/i915/display/intel_dss.c
+++ b/drivers/gpu/drm/i915/display/intel_dss.c
@@ -298,3 +298,8 @@ u8 intel_dss_get_secondary_joiner_pipes(const struct intel_crtc_state *crtc_stat
 	else
 		return 0;
 }
+
+int intel_dss_get_num_joiner_pipes(const struct intel_crtc_state *crtc_state)
+{
+	return hweight8(crtc_state->joiner_pipes);
+}
diff --git a/drivers/gpu/drm/i915/display/intel_dss.h b/drivers/gpu/drm/i915/display/intel_dss.h
index ff9195b8fd92..49fd9d8829ec 100644
--- a/drivers/gpu/drm/i915/display/intel_dss.h
+++ b/drivers/gpu/drm/i915/display/intel_dss.h
@@ -40,6 +40,7 @@ enum pipe intel_dss_get_primary_joiner_pipe(const struct intel_crtc_state *crtc_
 bool intel_dss_is_primary_joiner_pipe(const struct intel_crtc_state *crtc_state);
 bool intel_dss_is_secondary_joiner_pipe(const struct intel_crtc_state *crtc_state);
 u8 intel_dss_get_secondary_joiner_pipes(const struct intel_crtc_state *crtc_state);
+int intel_dss_get_num_joiner_pipes(const struct intel_crtc_state *crtc_state);
 
 #endif /* __INTEL_DSS_H__ */
 
-- 
2.45.2



More information about the Intel-gfx mailing list