Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Swati Sharma <swati2.sharma@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Swati Sharma <swati2.sharma@intel.com>
Subject: [PATCH i-g-t,v6 3/4] tests/intel/kms_dsc_helper: Add helper func()
Date: Fri,  1 May 2026 00:39:46 +0530	[thread overview]
Message-ID: <20260430190947.2347314-4-swati2.sharma@intel.com> (raw)
In-Reply-To: <20260430190947.2347314-1-swati2.sharma@intel.com>

Introduce check_dsc_joiner_constraints() to validate minimum pipe
count, DSC slice requirements, and joiner support for DSC joiner
scenarios.

Update meson.build to link kms_joiner_helper.c into DSC-related
tests so the new helper can call igt_is_joiner_supported_by_source().

v2: -Avoid hardcoding min_pipes/min_slices, use enum values (Santhosh)

Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
 tests/intel/kms_dsc_helper.c | 54 ++++++++++++++++++++++++++++++++++++
 tests/intel/kms_dsc_helper.h |  3 ++
 tests/meson.build            | 17 ++++++++----
 3 files changed, 68 insertions(+), 6 deletions(-)

diff --git a/tests/intel/kms_dsc_helper.c b/tests/intel/kms_dsc_helper.c
index 29b998c2f..63170af1e 100644
--- a/tests/intel/kms_dsc_helper.c
+++ b/tests/intel/kms_dsc_helper.c
@@ -203,3 +203,57 @@ bool is_dsc_fractional_bpp_supported(int disp_ver, int drmfd, igt_output_t *outp
 
 	return true;
 }
+
+bool check_dsc_joiner_constraints(int drm_fd,
+                                  igt_output_t *output,
+                                  int num_pipes,
+                                  enum joined_pipes type)
+{
+	int min_pipes = 0, min_slices = 0;
+
+	if (!igt_is_joiner_supported_by_source(drm_fd, type))
+		return false;
+
+	/*
+	 * For joiner, 2 slices per pipe is used
+	 * i.e. min_slices = 2 * min_pipes
+	 */
+	switch (type) {
+	case JOINED_PIPES_BIG_JOINER:
+		min_pipes = JOINED_PIPES_BIG_JOINER;
+		min_slices = min_pipes * 2;
+		break;
+	case JOINED_PIPES_ULTRA_JOINER:
+		min_pipes = JOINED_PIPES_ULTRA_JOINER;
+		min_slices = min_pipes * 2;
+		break;
+	case JOINED_PIPES_NONE:
+	case JOINED_PIPES_DEFAULT:
+	default:
+		igt_info("Unsupported joiner type: %s\n",
+                          igt_get_joined_pipes_name(type));
+		return false;
+	}
+
+	if (num_pipes < min_pipes) {
+		igt_info("%s requires minimum %d pipes\n",
+			  igt_get_joined_pipes_name(type), min_pipes);
+		return false;
+	}
+
+	if (igt_get_dsc_sink_max_slice_count(drm_fd, output->name) < min_slices) {
+		igt_info("Output %s doesn't support minimum %d slice count for %s\n",
+			  igt_output_name(output), min_slices,
+			  igt_get_joined_pipes_name(type));
+		return false;
+	}
+
+	if (!igt_has_force_joiner_debugfs(drm_fd, output->name)) {
+	    igt_info("Output %s doesn't support force_joiner debugfs for %s\n",
+		      igt_output_name(output),
+		      igt_get_joined_pipes_name(type));
+		return false;
+	}
+
+	return true;
+}
diff --git a/tests/intel/kms_dsc_helper.h b/tests/intel/kms_dsc_helper.h
index ee419c849..e4c970447 100644
--- a/tests/intel/kms_dsc_helper.h
+++ b/tests/intel/kms_dsc_helper.h
@@ -8,6 +8,7 @@
 
 #include "igt.h"
 #include "igt_sysfs.h"
+#include "kms_joiner_helper.h"
 #include <errno.h>
 #include <getopt.h>
 #include <math.h>
@@ -39,5 +40,7 @@ void force_dsc_fractional_bpp_enable(int drmfd, igt_output_t *output);
 void save_force_dsc_fractional_bpp_en(int drmfd, igt_output_t *output);
 void restore_force_dsc_fractional_bpp_en(void);
 bool is_dsc_fractional_bpp_supported(int disp_ver, int drmfd, igt_output_t *output);
+bool check_dsc_joiner_constraints(int drm_fd, igt_output_t *output, int num_pipes,
+                                  enum joined_pipes type);
 
 #endif
diff --git a/tests/meson.build b/tests/meson.build
index 60cea3aa8..38a42bda6 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -399,14 +399,19 @@ extra_sources = {
 	'kms_chamelium_hpd': [ join_paths ('chamelium', 'kms_chamelium_helper.c') ],
 	'kms_chamelium_sharpness_filter': [ join_paths ('chamelium', 'kms_chamelium_helper.c') ],
 	'kms_dp_linktrain_fallback': [
-           join_paths ('intel', 'kms_mst_helper.c'),
-           join_paths ('intel', 'kms_dsc_helper.c') ],
+          join_paths ('intel', 'kms_mst_helper.c'),
+          join_paths ('intel', 'kms_dsc_helper.c'),
+          join_paths ('intel', 'kms_joiner_helper.c') ],
 	'kms_dp_link_training': [
-           join_paths ('intel', 'kms_mst_helper.c'),
-           join_paths ('intel', 'kms_joiner_helper.c') ],
-	'kms_dsc': [ join_paths ('intel', 'kms_dsc_helper.c') ],
+          join_paths ('intel', 'kms_mst_helper.c'),
+          join_paths ('intel', 'kms_joiner_helper.c') ],
+	'kms_dsc': [
+          join_paths ('intel', 'kms_dsc_helper.c'),
+          join_paths ('intel', 'kms_joiner_helper.c') ],
 	'kms_joiner': [ join_paths ('intel', 'kms_joiner_helper.c') ],
-	'kms_psr2_sf':  [ join_paths ('intel', 'kms_dsc_helper.c') ],
+	'kms_psr2_sf': [
+          join_paths ('intel', 'kms_dsc_helper.c'),
+          join_paths ('intel', 'kms_joiner_helper.c') ],
 }
 
 # Extra dependencies used on core and Intel drivers
-- 
2.25.1


  parent reply	other threads:[~2026-04-30 19:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-30 19:09 [PATCH i-g-t,v6 0/4] Add dsc+bigjoiner subtest Swati Sharma
2026-04-30 19:09 ` [PATCH i-g-t, v6 1/4] tests/intel/kms_joiner_helper: Add igt_get_joined_pipes_name() Swati Sharma
2026-05-15  6:06   ` Karthik B S
2026-04-30 19:09 ` [PATCH i-g-t, v6 2/4] tests/kms_joiner_helper: Add igt_is_joiner_supported_by_source() Swati Sharma
2026-05-15  6:18   ` Karthik B S
2026-04-30 19:09 ` Swati Sharma [this message]
2026-05-15  8:36   ` [PATCH i-g-t,v6 3/4] tests/intel/kms_dsc_helper: Add helper func() Karthik B S
2026-04-30 19:09 ` [PATCH i-g-t, v6 4/4] tests/intel/kms_dsc: Add force dsc and joiner test cases Swati Sharma
2026-05-15  8:42   ` Karthik B S
2026-04-30 20:34 ` ✓ Xe.CI.BAT: success for Add dsc+bigjoiner subtest (rev8) Patchwork
2026-04-30 20:43 ` ✓ i915.CI.BAT: " Patchwork
2026-05-01  1:26 ` ✗ i915.CI.Full: failure " Patchwork
2026-05-01  7:11 ` ✗ Xe.CI.FULL: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260430190947.2347314-4-swati2.sharma@intel.com \
    --to=swati2.sharma@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox