All of lore.kernel.org
 help / color / mirror / Atom feed
From: Karthik B S <karthik.b.s@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v5 1/2] tests/kms_async_flips: Convert tests to dynamic
Date: Mon, 30 May 2022 11:59:58 +0530	[thread overview]
Message-ID: <20220530062959.18257-2-karthik.b.s@intel.com> (raw)
In-Reply-To: <20220530062959.18257-1-karthik.b.s@intel.com>

v2: -Get the mode after igt_display_reset() (Bhanu)

v3: -Move patch to start of series to avoid code duplication (Bhanu)
    -Use for_each_pipe() instead of for_each_pipe_static() (Bhanu)

Signed-off-by: Karthik B S <karthik.b.s@intel.com>
Reviewed-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
 tests/kms_async_flips.c | 122 +++++++++++++++++++++++++++++++++++-----
 1 file changed, 108 insertions(+), 14 deletions(-)

diff --git a/tests/kms_async_flips.c b/tests/kms_async_flips.c
index 1701883b..b1bd5186 100644
--- a/tests/kms_async_flips.c
+++ b/tests/kms_async_flips.c
@@ -51,6 +51,7 @@ typedef struct {
 	struct igt_fb bufs[4];
 	igt_display_t display;
 	drmModeConnectorPtr connector;
+	igt_output_t *output;
 	unsigned long flip_timestamp_us;
 	double flip_interval;
 	igt_pipe_crc_t *pipe_crc;
@@ -58,6 +59,8 @@ typedef struct {
 	int flip_count;
 	int frame_count;
 	bool flip_pending;
+	bool extended;
+	enum pipe pipe;
 } data_t;
 
 static drmModeConnectorPtr find_connector_for_modeset(data_t *data)
@@ -540,10 +543,29 @@ static void test_crc(data_t *data)
 	igt_assert_lt(data->frame_count * 2, data->flip_count);
 }
 
-igt_main
+static int opt_handler(int opt, int opt_index, void *_data)
+{
+	data_t *data = _data;
+
+	switch (opt) {
+	case 'e':
+		data->extended = true;
+		break;
+	}
+
+	return IGT_OPT_HANDLER_SUCCESS;
+}
+
+static const char help_str[] =
+"  --e \t\tRun the extended tests\n";
+
+static data_t data;
+
+igt_main_args("e", NULL, help_str, opt_handler, &data)
 {
-	static data_t data;
 	int i;
+	igt_output_t *output;
+	enum pipe pipe;
 
 	igt_fixture {
 		data.drm_fd = drm_open_driver_master(DRIVER_ANY);
@@ -561,28 +583,100 @@ igt_main
 			test_init(&data);
 
 		igt_describe("Wait for page flip events in between successive asynchronous flips");
-		igt_subtest("async-flip-with-page-flip-events")
-			test_async_flip(&data, false);
+		igt_subtest_with_dynamic("async-flip-with-page-flip-events") {
+			for_each_pipe(&data.display, pipe) {
+				for_each_valid_output_on_pipe(&data.display, pipe, output) {
+					igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), output->name) {
+						data.output = output;
+						data.pipe = pipe;
+						test_async_flip(&data, false);
+					}
+
+					if (!data.extended)
+						break;
+				}
+			}
+		}
 
 		igt_describe("Alternate between sync and async flips");
-		igt_subtest("alternate-sync-async-flip")
-			test_async_flip(&data, true);
+		igt_subtest_with_dynamic("alternate-sync-async-flip") {
+			for_each_pipe(&data.display, pipe) {
+				for_each_valid_output_on_pipe(&data.display, pipe, output) {
+					igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), output->name) {
+						data.output = output;
+						data.pipe = pipe;
+						test_async_flip(&data, true);
+					}
+
+					if (!data.extended)
+						break;
+				}
+			}
+		}
 
 		igt_describe("Verify that the async flip timestamp does not coincide with either previous or next vblank");
-		igt_subtest("test-time-stamp")
-			test_timestamp(&data);
+		igt_subtest_with_dynamic("test-time-stamp") {
+			for_each_pipe(&data.display, pipe) {
+				for_each_valid_output_on_pipe(&data.display, pipe, output) {
+					igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), output->name) {
+						data.output = output;
+						data.pipe = pipe;
+						test_timestamp(&data);
+					}
+
+					if (!data.extended)
+						break;
+				}
+			}
+		}
 
 		igt_describe("Verify that the DRM_IOCTL_MODE_CURSOR passes after async flip");
-		igt_subtest("test-cursor")
-			test_cursor(&data);
+		igt_subtest_with_dynamic("test-cursor") {
+			for_each_pipe(&data.display, pipe) {
+				for_each_valid_output_on_pipe(&data.display, pipe, output) {
+					igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), output->name) {
+						data.output = output;
+						data.pipe = pipe;
+						test_cursor(&data);
+					}
+
+					if (!data.extended)
+						break;
+				}
+			}
+		}
 
 		igt_describe("Negative case to verify if changes in fb are rejected from kernel as expected");
-		igt_subtest("invalid-async-flip")
-			test_invalid(&data);
+		igt_subtest_with_dynamic("invalid-async-flip") {
+			for_each_pipe(&data.display, pipe) {
+				for_each_valid_output_on_pipe(&data.display, pipe, output) {
+					igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), output->name) {
+						data.output = output;
+						data.pipe = pipe;
+						test_invalid(&data);
+					}
+
+					if (!data.extended)
+						break;
+				}
+			}
+		}
 
 		igt_describe("Use CRC to verify async flip scans out the correct framebuffer");
-		igt_subtest("crc")
-			test_crc(&data);
+		igt_subtest_with_dynamic("crc") {
+			for_each_pipe(&data.display, pipe) {
+				for_each_valid_output_on_pipe(&data.display, pipe, output) {
+					igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), output->name) {
+						data.output = output;
+						data.pipe = pipe;
+						test_crc(&data);
+					}
+
+					if (!data.extended)
+						break;
+				}
+			}
+		}
 
 		igt_fixture {
 			for (i = 0; i < ARRAY_SIZE(data.bufs); i++)
-- 
2.22.0

  reply	other threads:[~2022-05-30  7:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-30  6:29 [igt-dev] [PATCH i-g-t v5 0/2] tests/kms_async_flips: Cleanup Karthik B S
2022-05-30  6:29 ` Karthik B S [this message]
2022-05-30 19:27   ` [igt-dev] [PATCH i-g-t v5 1/2] tests/kms_async_flips: Convert tests to dynamic André Almeida
2022-05-31  6:01     ` Karthik B S
2022-05-30  6:29 ` [igt-dev] [PATCH i-g-t v5 2/2] tests/kms_async_flips: Test Cleanup Karthik B S
2022-05-30 19:35   ` André Almeida
2022-05-31  6:03     ` Karthik B S
2022-05-30  8:16 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_async_flips: Cleanup Patchwork
2022-05-30 10:12 ` [igt-dev] ✓ Fi.CI.IGT: " 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=20220530062959.18257-2-karthik.b.s@intel.com \
    --to=karthik.b.s@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.