public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 1/4] tests/kms_cursor_crc: Run tests once per pipe
Date: Mon, 29 Apr 2019 18:05:54 +0200	[thread overview]
Message-ID: <20190429160557.17889-2-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <20190429160557.17889-1-maarten.lankhorst@linux.intel.com>

Instead of running tests on all pipes and all outputs,
change the tests to only run once on each pipe, with
igt_get_single_output_for_pipe() to select an output.

This way we'll test all pipes and all outputs at least once,
but not all combinations. This reduces the amount of time
required for each test with dual/triple outputs.

In order to reduce the test time further, only run the
DPMS/suspend tests once for each pipe. They should not
be dependent on cursor size.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 tests/kms_cursor_crc.c | 125 +++++++++++++++++++----------------------
 1 file changed, 57 insertions(+), 68 deletions(-)

diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index fd74fda5c5f0..7e6c522c438b 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -462,42 +462,11 @@ static void test_cursor_opaque(data_t *data)
 	test_cursor_alpha(data, 1.0);
 }
 
-
 static void run_test(data_t *data, void (*testfunc)(data_t *), int cursor_w, int cursor_h)
 {
-	igt_display_t *display = &data->display;
-	igt_output_t *output;
-	enum pipe p;
-	int valid_tests = 0;
-
-	igt_require(cursor_w <= data->cursor_max_w &&
-		    cursor_h <= data->cursor_max_h);
-
-	for_each_pipe_with_valid_output(display, p, output) {
-		data->output = output;
-		data->pipe = p;
-
-		prepare_crtc(data, output, cursor_w, cursor_h);
-
-		valid_tests++;
-
-		igt_info("Beginning %s on pipe %s, connector %s\n",
-			  igt_subtest_name(),
-			  kmstest_pipe_name(data->pipe),
-			  igt_output_name(output));
-
-		testfunc(data);
-
-		igt_info("\n%s on pipe %s, connector %s: PASSED\n\n",
-			  igt_subtest_name(),
-			  kmstest_pipe_name(data->pipe),
-			  igt_output_name(output));
-
-		/* cleanup what prepare_crtc() has done */
-		cleanup_crtc(data, output);
-	}
-
-	igt_require_f(valid_tests, "no valid crtc/connector combinations found\n");
+	prepare_crtc(data, data->output, cursor_w, cursor_h);
+	testfunc(data);
+	cleanup_crtc(data, data->output);
 }
 
 static void create_cursor_fb(data_t *data, int cur_w, int cur_h)
@@ -639,38 +608,66 @@ static void test_rapid_movement(data_t *data)
 
 }
 
-static void run_test_generic(data_t *data)
+static void run_tests_on_pipe(data_t *data, enum pipe pipe)
 {
 	int cursor_size;
+
+	igt_fixture {
+		data->pipe = pipe;
+		data->output = igt_get_single_output_for_pipe(&data->display, pipe);
+		igt_require(data->output);
+	}
+
+	igt_subtest_f("pipe-%s-cursor-size-change", kmstest_pipe_name(pipe))
+		run_test(data, test_cursor_size,
+			 data->cursor_max_w, data->cursor_max_h);
+
+	igt_subtest_f("pipe-%s-cursor-alpha-opaque", kmstest_pipe_name(pipe))
+		run_test(data, test_cursor_opaque, data->cursor_max_w, data->cursor_max_h);
+
+	igt_subtest_f("pipe-%s-cursor-alpha-transparent", kmstest_pipe_name(pipe))
+		run_test(data, test_cursor_transparent, data->cursor_max_w, data->cursor_max_h);
+
+	igt_fixture
+		create_cursor_fb(data, data->cursor_max_w, data->cursor_max_h);
+
+	igt_subtest_f("pipe-%s-cursor-dpms", kmstest_pipe_name(pipe)) {
+		data->flags = TEST_DPMS;
+		run_test(data, test_crc_random, data->cursor_max_w, data->cursor_max_h);
+	}
+	data->flags = 0;
+
+	igt_subtest_f("pipe-%s-cursor-suspend", kmstest_pipe_name(pipe)) {
+		data->flags = TEST_SUSPEND;
+		run_test(data, test_crc_random, data->cursor_max_w, data->cursor_max_h);
+	}
+	data->flags = 0;
+
+	igt_fixture
+		igt_remove_fb(data->drm_fd, &data->fb);
+
 	for (cursor_size = 64; cursor_size <= 512; cursor_size *= 2) {
 		int w = cursor_size;
 		int h = cursor_size;
 
-		igt_fixture
+		igt_fixture {
+			igt_require(w <= data->cursor_max_w &&
+				    h <= data->cursor_max_h);
+
 			create_cursor_fb(data, w, h);
+		}
 
 		/* Using created cursor FBs to test cursor support */
-		igt_subtest_f("cursor-%dx%d-onscreen", w, h)
+		igt_subtest_f("pipe-%s-cursor-%dx%d-onscreen", kmstest_pipe_name(pipe), w, h)
 			run_test(data, test_crc_onscreen, w, h);
-		igt_subtest_f("cursor-%dx%d-offscreen", w, h)
+		igt_subtest_f("pipe-%s-cursor-%dx%d-offscreen", kmstest_pipe_name(pipe), w, h)
 			run_test(data, test_crc_offscreen, w, h);
-		igt_subtest_f("cursor-%dx%d-sliding", w, h)
+		igt_subtest_f("pipe-%s-cursor-%dx%d-sliding", kmstest_pipe_name(pipe), w, h)
 			run_test(data, test_crc_sliding, w, h);
-		igt_subtest_f("cursor-%dx%d-random", w, h)
+		igt_subtest_f("pipe-%s-cursor-%dx%d-random", kmstest_pipe_name(pipe), w, h)
 			run_test(data, test_crc_random, w, h);
-		igt_subtest_f("cursor-%dx%d-dpms", w, h) {
-			data->flags = TEST_DPMS;
-			run_test(data, test_crc_random, w, h);
-			data->flags = 0;
-		}
-
-		igt_subtest_f("cursor-%dx%d-suspend", w, h) {
-			data->flags = TEST_SUSPEND;
-			run_test(data, test_crc_random, w, h);
-			data->flags = 0;
-		}
 
-		igt_subtest_f("cursor-%dx%d-rapid-movement", w, h) {
+		igt_subtest_f("pipe-%s-cursor-%dx%d-rapid-movement", kmstest_pipe_name(pipe), w, h) {
 			run_test(data, test_rapid_movement, w, h);
 		}
 
@@ -688,19 +685,19 @@ static void run_test_generic(data_t *data)
 			create_cursor_fb(data, w, h);
 
 		/* Using created cursor FBs to test cursor support */
-		igt_subtest_f("cursor-%dx%d-onscreen", w, h) {
+		igt_subtest_f("pipe-%s-cursor-%dx%d-onscreen", kmstest_pipe_name(pipe), w, h) {
 			igt_require(has_nonsquare_cursors(data));
 			run_test(data, test_crc_onscreen, w, h);
 		}
-		igt_subtest_f("cursor-%dx%d-offscreen", w, h) {
+		igt_subtest_f("pipe-%s-cursor-%dx%d-offscreen", kmstest_pipe_name(pipe), w, h) {
 			igt_require(has_nonsquare_cursors(data));
 			run_test(data, test_crc_offscreen, w, h);
 		}
-		igt_subtest_f("cursor-%dx%d-sliding", w, h) {
+		igt_subtest_f("pipe-%s-cursor-%dx%d-sliding", kmstest_pipe_name(pipe), w, h) {
 			igt_require(has_nonsquare_cursors(data));
 			run_test(data, test_crc_sliding, w, h);
 		}
-		igt_subtest_f("cursor-%dx%d-random", w, h) {
+		igt_subtest_f("pipe-%s-cursor-%dx%d-random", kmstest_pipe_name(pipe), w, h) {
 			igt_require(has_nonsquare_cursors(data));
 			run_test(data, test_crc_random, w, h);
 		}
@@ -716,6 +713,7 @@ igt_main
 {
 	uint64_t cursor_width = 64, cursor_height = 64;
 	int ret;
+	enum pipe pipe;
 
 	igt_skip_on_simulation();
 
@@ -741,18 +739,9 @@ igt_main
 	data.cursor_max_w = cursor_width;
 	data.cursor_max_h = cursor_height;
 
-	igt_subtest_f("cursor-size-change")
-		run_test(&data, test_cursor_size, cursor_width, cursor_height);
-
-	igt_subtest_f("cursor-alpha-opaque") {
-		run_test(&data, test_cursor_opaque, cursor_width, cursor_height);
-	 }
-
-	igt_subtest_f("cursor-alpha-transparent") {
-		run_test(&data, test_cursor_transparent, cursor_width, cursor_height);
-	 }
-
-	run_test_generic(&data);
+	for_each_pipe_static(pipe)
+		igt_subtest_group
+			run_tests_on_pipe(&data, pipe);
 
 	igt_fixture {
 		igt_display_fini(&data.display);
-- 
2.20.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2019-04-29 16:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-29 16:05 [igt-dev] [PATCH i-g-t 0/4] kms_cursor_crc test improvements and cleanups Maarten Lankhorst
2019-04-29 16:05 ` Maarten Lankhorst [this message]
2019-04-29 16:05 ` [igt-dev] [PATCH i-g-t 2/4] tests/kms_cursor_crc: Handle display cleanup in init Maarten Lankhorst
2019-04-29 16:05 ` [igt-dev] [PATCH i-g-t 3/4] lib/igt_kms: Update cursor when fb width/height changes too Maarten Lankhorst
2019-04-29 16:05 ` [igt-dev] [PATCH i-g-t 4/4] tests/kms_cursor_crc: Use igt_kms calls for everything Maarten Lankhorst
2019-04-29 16:57 ` [igt-dev] ✓ Fi.CI.BAT: success for kms_cursor_crc test improvements and cleanups Patchwork
2019-04-29 22:31 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-05-11 15:17 ` [igt-dev] [PATCH i-g-t 0/4] " Juha-Pekka Heikkilä
2019-05-13 15:07   ` Maarten Lankhorst

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=20190429160557.17889-2-maarten.lankhorst@linux.intel.com \
    --to=maarten.lankhorst@linux.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