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>,
	Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Subject: [PATCH i-g-t] tests/intel/kms_dsc: Store valid DSC outputs
Date: Thu,  8 May 2025 12:56:20 +0530	[thread overview]
Message-ID: <20250508072620.1310699-1-swati2.sharma@intel.com> (raw)

Instead of repeatedly checking debugfs to determine if a panel
supports DSC, perform the check once and store valid outputs (those
that support DSC and meet the required constraints) in an array.

v2: - store pipe as well in array

Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
 tests/intel/kms_dsc.c | 37 ++++++++++++++++++++++---------------
 1 file changed, 22 insertions(+), 15 deletions(-)

diff --git a/tests/intel/kms_dsc.c b/tests/intel/kms_dsc.c
index 7f0745370..173307d28 100644
--- a/tests/intel/kms_dsc.c
+++ b/tests/intel/kms_dsc.c
@@ -71,12 +71,15 @@ IGT_TEST_DESCRIPTION("Test to validate display stream compression");
 
 typedef struct {
 	int drm_fd;
+	int count;
 	uint32_t devid;
 	igt_display_t display;
 	struct igt_fb fb_test_pattern;
 	enum dsc_output_format output_format;
 	unsigned int plane_format;
 	igt_output_t *output;
+	igt_output_t *valid_output[IGT_MAX_PIPES];
+	enum pipe output_pipe[IGT_MAX_PIPES];
 	int input_bpc;
 	int disp_ver;
 	enum pipe pipe;
@@ -248,32 +251,21 @@ static void test_dsc(data_t *data, uint32_t test_type, int bpc,
 		     unsigned int plane_format,
 		     enum dsc_output_format output_format)
 {
-	igt_display_t *display = &data->display;
-	igt_output_t *output;
-	enum pipe pipe;
 	char name[3][LEN] = {
 				{0},
 				{0},
 				{0},
 			    };
 
+	igt_require_f(data->count > 0, "No dsc output found that meets all constraints\n");
 	igt_require(check_gen11_bpc_constraint(data->drm_fd, data->input_bpc));
 
-	for_each_pipe_with_valid_output(display, pipe, output) {
+	for (int i = 0; i < data->count; i++) {
 		data->output_format = output_format;
 		data->plane_format = plane_format;
 		data->input_bpc = bpc;
-		data->output = output;
-		data->pipe = pipe;
-
-		if (!is_dsc_supported_by_sink(data->drm_fd, data->output) ||
-		    !check_gen11_dp_constraint(data->drm_fd, data->output, data->pipe))
-			continue;
-
-		if (igt_get_output_max_bpc(data->drm_fd, output->name) < MIN_DSC_BPC) {
-			igt_info("Output %s doesn't support min %d-bpc\n", igt_output_name(data->output), MIN_DSC_BPC);
-			continue;
-		}
+		data->output = data->valid_output[i];
+		data->pipe = data->output_pipe[i];
 
 		if ((test_type & TEST_DSC_OUTPUT_FORMAT) &&
 		    (!is_dsc_output_format_supported(data->drm_fd, data->disp_ver,
@@ -323,15 +315,30 @@ data_t data = {};
 
 igt_main_args("l", NULL, help_str, opt_handler, &data)
 {
+	igt_output_t *output;
+	enum pipe pipe;
+
 	igt_fixture {
 		data.drm_fd = drm_open_driver_master(DRIVER_INTEL | DRIVER_XE);
 		data.devid = intel_get_drm_devid(data.drm_fd);
 		data.disp_ver = intel_display_ver(data.devid);
+		data.count = 0;
 		kmstest_set_vt_graphics_mode();
 		igt_install_exit_handler(kms_dsc_exit_handler);
 		igt_display_require(&data.display, data.drm_fd);
 		igt_display_require_output(&data.display);
 		igt_require(is_dsc_supported_by_source(data.drm_fd));
+
+		for_each_pipe(&data.display, pipe) {
+			for_each_valid_output_on_pipe(&data.display, pipe, output) {
+				if (is_dsc_supported_by_sink(data.drm_fd, output) &&
+				    check_gen11_dp_constraint(data.drm_fd, output, pipe) &&
+				    igt_get_output_max_bpc(data.drm_fd, output->name) > MIN_DSC_BPC) {
+						data.output_pipe[data.count] = pipe;
+						data.valid_output[data.count++] = output;
+				}
+			}
+		}
 	}
 
 	igt_describe("Tests basic display stream compression functionality if supported "
-- 
2.25.1


             reply	other threads:[~2025-05-08  7:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-08  7:26 Swati Sharma [this message]
2025-05-08  7:33 ` [PATCH i-g-t] tests/intel/kms_dsc: Store valid DSC outputs Nautiyal, Ankit K
2025-05-09  7:00 ` ✓ Xe.CI.BAT: success for tests/intel/kms_dsc: Store valid DSC outputs (rev3) Patchwork
2025-05-09  7:12 ` ✓ i915.CI.BAT: " Patchwork
2025-05-09  9:27 ` ✗ i915.CI.Full: failure " Patchwork
2025-05-09 19:47 ` ✗ Xe.CI.Full: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2025-02-18 13:03 [PATCH i-g-t] tests/intel/kms_dsc: Store valid DSC outputs Swati Sharma
2025-03-12  6:11 ` Nautiyal, Ankit K

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=20250508072620.1310699-1-swati2.sharma@intel.com \
    --to=swati2.sharma@intel.com \
    --cc=ankit.k.nautiyal@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