Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Kunal Joshi <kunal1.joshi@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Kunal Joshi <kunal1.joshi@intel.com>
Subject: [PATCH i-g-t 1/3] tests/kms_bw: convert to dynamic subtest
Date: Thu, 23 May 2024 15:32:46 +0530	[thread overview]
Message-ID: <20240523100248.230989-2-kunal1.joshi@intel.com> (raw)
In-Reply-To: <20240523100248.230989-1-kunal1.joshi@intel.com>

Convert the test structure from individual subtests for each
display mode (1080, 2k, 4k...) and display count (1, 2... n)
to a dynamic subtest structure. The change addresses the issue
of high skip counts due to potentially missing configurations,
which previously required blacklisting.

In the new structure, the display mode is set at the subtest level,
while the number of displays is dynamic. This ensures that the subtest
passes regardless of the number of connected displays.
To cover all scenarios, it may be necessary to connect the
maximum possible number of displays.

Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com>
---
 tests/kms_bw.c | 38 ++++++++++++++++++++------------------
 1 file changed, 20 insertions(+), 18 deletions(-)

diff --git a/tests/kms_bw.c b/tests/kms_bw.c
index 05f7e79ad..b50f324af 100644
--- a/tests/kms_bw.c
+++ b/tests/kms_bw.c
@@ -37,12 +37,10 @@
 #include <xf86drmMode.h>
 
 /**
- * SUBTEST: linear-tiling-%d-displays-%s
- * Description: bw test with %arg[2]
+ * SUBTEST: linear-tiling-%s
+ * Description: bw test with %arg[1]
  *
- * arg[1].values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
- *
- * arg[2]:
+ * arg[1]:
  *
  * @1920x1080p:       1920x1080 resolution
  * @2560x1440p:       2560x1440 resolution
@@ -62,6 +60,7 @@ typedef struct data {
         int w[IGT_MAX_PIPES];
         int h[IGT_MAX_PIPES];
         int fd;
+	int num_pipes;
 } data_t;
 
 static drmModeModeInfo test_mode[] = {
@@ -178,16 +177,10 @@ static void run_test_linear_tiling(data_t *data, int pipe, const drmModeModeInfo
 	igt_output_t *output;
 	struct igt_fb buffer[IGT_MAX_PIPES];
 	igt_crc_t zero, captured[IGT_MAX_PIPES];
-	int i = 0, num_pipes = 0;
-	enum pipe p;
 	int ret;
 
-	/* Cannot use igt_display_get_n_pipes() due to fused pipes on i915 where they do
-	 * not give the numver of valid crtcs and always return IGT_MAX_PIPES */
-	for_each_pipe(display, p) num_pipes++;
-
-	igt_skip_on_f(pipe >= num_pipes,
-                      "ASIC does not have %d pipes\n", pipe);
+	igt_skip_on_f(pipe >= data->num_pipes,
+				  "ASIC does not have %d pipes\n", pipe);
 
 	test_init(data);
 
@@ -244,28 +237,37 @@ igt_main
 {
 	data_t data;
 	int i = 0, j = 0;
+	enum pipe p;
 
 	memset(&data, 0, sizeof(data));
 
 	igt_fixture
 	{
 		data.fd = drm_open_driver_master(DRIVER_ANY);
+		data.num_pipes = 0;
 
 		kmstest_set_vt_graphics_mode();
 
 		igt_display_require(&data.display, data.fd);
 		igt_require(&data.display.is_atomic);
 		igt_display_require_output(&data.display);
+		/*
+		 * Cannot use igt_display_get_n_pipes() due to fused pipes on i915 where they do
+		 * not give the numver of valid crtcs and always return IGT_MAX_PIPES
+		 */
+		for_each_pipe(&data.display, p) data.num_pipes++;
 
 	}
 
 	/* We're not using for_each_pipe_static because we need the
 	 * _amount_ of pipes */
-	for (i = 0; i < IGT_MAX_PIPES; i++) {
-		for (j = 0; j < ARRAY_SIZE(test_mode); j++) {
-			igt_subtest_f("linear-tiling-%d-displays-%s", i+1,
-			      test_mode[j].name)
-			run_test_linear_tiling(&data, i, &test_mode[j]);
+	for (j = 0; j < ARRAY_SIZE(test_mode); j++) {
+		igt_subtest_with_dynamic_f("linear-tiling-%s", test_mode[j].name)
+		{
+			for (i = 0; i < data.num_pipes; i++) {
+				igt_dynamic_f("%d-display%s", i+1, i == 0 ? "" : "s")
+					run_test_linear_tiling(&data, i, &test_mode[j]);
+			}
 		}
 	}
 
-- 
2.25.1


  reply	other threads:[~2024-05-23  9:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-23 10:02 [PATCH i-g-t 0/3] fix kms_bw test Kunal Joshi
2024-05-23 10:02 ` Kunal Joshi [this message]
2024-05-23 10:02 ` [PATCH i-g-t 2/3] tests/kms_bw: allow physically connected only Kunal Joshi
2024-05-23 12:56   ` Aurabindo Pillai
2024-06-13 13:05     ` Joshi, Kunal1
2024-05-23 10:02 ` [PATCH i-g-t 3/3] HAX patch do not merge Kunal Joshi
2024-05-23 10:35 ` ✗ Fi.CI.BAT: failure for fix kms_bw test Patchwork
2024-05-23 10:50 ` ✓ CI.xeBAT: success " Patchwork
2024-05-23 11:53 ` ✗ CI.xeFULL: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2024-05-12 16:01 [PATCH i-g-t 0/3] fix kms_be test Kunal Joshi
2024-05-12 16:01 ` [PATCH i-g-t 1/3] tests/kms_bw: convert to dynamic subtest Kunal Joshi
2024-05-13 11:59   ` Kamil Konieczny

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=20240523100248.230989-2-kunal1.joshi@intel.com \
    --to=kunal1.joshi@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