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
Subject: [igt-dev] [PATCH i-g-t 3/3] tests/kms_vblank: restrict to 2 pipes and add capability to run on all pipes
Date: Wed, 11 Oct 2023 19:01:14 +0530	[thread overview]
Message-ID: <20231011133114.68627-4-swati2.sharma@intel.com> (raw)
In-Reply-To: <20231011133114.68627-1-swati2.sharma@intel.com>

Restrict execution to 2 pipes but add capability to executed
on all pipes.

Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
 tests/kms_vblank.c | 39 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 38 insertions(+), 1 deletion(-)

diff --git a/tests/kms_vblank.c b/tests/kms_vblank.c
index 4edd3f6bc..593da691e 100644
--- a/tests/kms_vblank.c
+++ b/tests/kms_vblank.c
@@ -150,6 +150,10 @@ typedef struct {
 #define RPM	0x80
 } data_t;
 
+static bool all_pipes;
+static enum pipe active_pipes[IGT_MAX_PIPES];
+static uint32_t last_pipe;
+
 static double elapsed(const struct timespec *start,
 		      const struct timespec *end,
 		      int loop)
@@ -546,6 +550,10 @@ static void run_subtests(data_t *data)
 					if (!pipe_output_combo_valid(&data->display, data->pipe, data->output))
 						continue;
 
+					if (!all_pipes && data->pipe != active_pipes[0] &&
+					    data->pipe != active_pipes[last_pipe])
+						continue;
+
 					igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(data->pipe), data->output->name) {
 						data->flags = m->flags | NOHANG;
 						run_test(data, f->func);
@@ -566,6 +574,10 @@ static void run_subtests(data_t *data)
 					if (!pipe_output_combo_valid(&data->display, data->pipe, data->output))
 						continue;
 
+					if (!all_pipes && data->pipe != active_pipes[0] &&
+					    data->pipe != active_pipes[last_pipe])
+						continue;
+
 					igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(data->pipe), data->output->name) {
 						data->flags = m->flags;
 						run_test(data, f->func);
@@ -622,7 +634,23 @@ static void invalid_subtest(data_t *data, int fd)
 	cleanup_crtc(data, fd, output);
 }
 
-igt_main
+static int opt_handler(int opt, int opt_index, void *data)
+{
+	switch (opt) {
+		case 'e':
+			all_pipes = true;
+			break;
+		default:
+			return IGT_OPT_HANDLER_ERROR;
+	}
+
+	return IGT_OPT_HANDLER_SUCCESS;
+}
+
+const char *help_str =
+	"  -e \tRun on all pipes. (By default subtests will run on two pipes)\n";
+
+igt_main_args("e", NULL, help_str, opt_handler, NULL)
 {
 	int fd;
 	data_t data;
@@ -632,6 +660,11 @@ igt_main
 		kmstest_set_vt_graphics_mode();
 		igt_display_require(&data.display, fd);
 		igt_display_require_output(&data.display);
+
+		/* Get active pipes. */
+		for_each_pipe(&data.display, data.pipe)
+			active_pipes[last_pipe++] = data.pipe;
+		last_pipe--;
 	}
 
 	igt_describe("Negative test for vblank request.");
@@ -652,6 +685,10 @@ igt_main
 			if (!pipe_output_combo_valid(&data.display, data.pipe, data.output))
 				continue;
 
+			if (!all_pipes && data.pipe != active_pipes[0] &&
+					  data.pipe != active_pipes[last_pipe])
+				continue;
+
 			igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(data.pipe), data.output->name)
 				crtc_id_subtest(&data, fd);
 		}
-- 
2.25.1

  parent reply	other threads:[~2023-10-11 13:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-11 13:31 [igt-dev] [PATCH i-g-t 0/3] tests/kms_vblank: Test cleanup and dynamic conversion Swati Sharma
2023-10-11 13:31 ` [igt-dev] [PATCH i-g-t 1/3] tests/kms_vblank: cosmetic changes Swati Sharma
2023-10-11 13:31 ` [igt-dev] [PATCH i-g-t 2/3] tests/kms_vblank: convert test to dynamic Swati Sharma
2023-10-13  3:21   ` Karthik B S
2023-10-11 13:31 ` Swati Sharma [this message]
2023-10-13  3:27   ` [igt-dev] [PATCH i-g-t 3/3] tests/kms_vblank: restrict to 2 pipes and add capability to run on all pipes Karthik B S
2023-10-12  0:26 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_vblank: Test cleanup and dynamic conversion (rev3) Patchwork
2023-10-12  0:58 ` [igt-dev] ✓ CI.xeBAT: " Patchwork
2023-10-12 17:13 ` [igt-dev] ✗ Fi.CI.IGT: failure " 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=20231011133114.68627-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