[PATCH 25/32] drm/i915: Split current joiner hw state readout

Ankit Nautiyal ankit.k.nautiyal at intel.com
Wed Sep 4 08:45:36 UTC 2024


From: Stanislav Lisovskiy <stanislav.lisovskiy at intel.com>

We need to add a new sanity checks and also do
some preparations for adding ultrajoiner hw state readout.
Lets first split reading of the uncompressed joiner and bigjoiner
bit masks into separate functions.

v2: Fix checkpatch warnings (Ankit)
v3: Move changes to intel_joiner (Ankit)

Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy at intel.com>
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal at intel.com>
---
 drivers/gpu/drm/i915/display/intel_joiner.c | 45 +++++++++++++++++----
 1 file changed, 38 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_joiner.c b/drivers/gpu/drm/i915/display/intel_joiner.c
index 90a2871ef6ff..15bd2b0901a7 100644
--- a/drivers/gpu/drm/i915/display/intel_joiner.c
+++ b/drivers/gpu/drm/i915/display/intel_joiner.c
@@ -87,8 +87,25 @@ u8 intel_joiner_supported_pipes(struct intel_display *display)
 	return pipes & DISPLAY_RUNTIME_INFO(display)->pipe_mask;
 }
 
-void intel_joiner_enabled_pipes(struct intel_display *display,
-				u8 *primary_pipes, u8 *secondary_pipes)
+
+static void enabled_uncompressed_joiner_pipes(struct intel_display *display,
+					      u8 *primary_pipes, u8 *secondary_pipes)
+{
+	struct drm_i915_private *i915 = to_i915(display->drm);
+	struct intel_crtc *crtc;
+
+	*primary_pipes = 0;
+	*secondary_pipes = 0;
+
+	for_each_intel_crtc_in_pipe_mask(&i915->drm, crtc,
+					 intel_joiner_supported_pipes(display))
+		intel_dss_get_uncompressed_joiner_pipes(crtc,
+							primary_pipes,
+							secondary_pipes);
+}
+
+static void enabled_bigjoiner_pipes(struct intel_display *display,
+				    u8 *primary_pipes, u8 *secondary_pipes)
 {
 	struct drm_i915_private *i915 = to_i915(display->drm);
 	struct intel_crtc *crtc;
@@ -97,15 +114,29 @@ void intel_joiner_enabled_pipes(struct intel_display *display,
 	*secondary_pipes = 0;
 
 	for_each_intel_crtc_in_pipe_mask(&i915->drm, crtc,
-					 intel_joiner_supported_pipes(display)) {
+					 intel_joiner_supported_pipes(display))
 		intel_dss_get_compressed_joiner_pipes(crtc,
 						      primary_pipes,
 						      secondary_pipes);
+}
 
-		intel_dss_get_uncompressed_joiner_pipes(crtc,
-							primary_pipes,
-							secondary_pipes);
-	}
+void intel_joiner_enabled_pipes(struct intel_display *display,
+				u8 *primary_pipes, u8 *secondary_pipes)
+{
+	u8 primary_uncompressed_joiner_pipes, primary_bigjoiner_pipes;
+	u8 secondary_uncompressed_joiner_pipes, secondary_bigjoiner_pipes;
+
+	enabled_uncompressed_joiner_pipes(display, &primary_uncompressed_joiner_pipes,
+					  &secondary_uncompressed_joiner_pipes);
+
+	enabled_bigjoiner_pipes(display, &primary_bigjoiner_pipes,
+				&secondary_bigjoiner_pipes);
+
+	*primary_pipes = 0;
+	*secondary_pipes = 0;
+
+	*primary_pipes = primary_uncompressed_joiner_pipes | primary_bigjoiner_pipes;
+	*secondary_pipes = secondary_uncompressed_joiner_pipes | secondary_bigjoiner_pipes;
 
 	/* Joiner pipes should always be consecutive primary and secondary */
 	drm_WARN(display->drm, *secondary_pipes != *primary_pipes << 1,
-- 
2.45.2



More information about the Intel-gfx-trybot mailing list