Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t v3] tests/kms_color: Limit the execution to two pipes
@ 2023-02-28  4:24 Nidhi Gupta
  2023-02-28  4:46 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_color: Limit the execution to two pipes (rev2) Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Nidhi Gupta @ 2023-02-28  4:24 UTC (permalink / raw)
  To: igt-dev; +Cc: Nidhi Gupta

As the test execution is taking more time on simulation, limit the
execution to two (first & last) pipes. This optimization is for
simulation and hardware.

This patch will also provide an option (command line flag '-e') to
execute on all pipes.

Example: ./kms_color -e --run-subtest ctm-0-50

v2: Restrict the execution only on 2 pipes for
    real hardware aswell (Ankit)
v3: Restrict the execution only on 2 pipes for
    all subtests (Bhanu)

Signed-off-by: Nidhi Gupta <nidhi1.gupta@intel.com>
---
 tests/kms_color.c | 43 ++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 42 insertions(+), 1 deletion(-)

diff --git a/tests/kms_color.c b/tests/kms_color.c
index 45570083..85d9100f 100644
--- a/tests/kms_color.c
+++ b/tests/kms_color.c
@@ -26,6 +26,10 @@
 
 IGT_TEST_DESCRIPTION("Test Color Features at Pipe level");
 
+static bool extended;
+static enum pipe active_pipes[IGT_MAX_PIPES];
+static uint32_t last_pipe;
+
 static bool test_pipe_degamma(data_t *data,
 			      igt_plane_t *primary)
 {
@@ -878,6 +882,16 @@ run_deep_color_tests_for_pipe(data_t *data, enum pipe p)
 	test_cleanup(data);
 }
 
+static bool execution_constraint(enum pipe pipe)
+{
+	if (!extended &&
+	    pipe != active_pipes[0] &&
+	    pipe != active_pipes[last_pipe])
+		return true;
+
+	return false;
+}
+
 static void
 run_invalid_tests_for_pipe(data_t *data)
 {
@@ -1022,6 +1036,9 @@ run_tests_for_pipe(data_t *data)
 		igt_describe_f("%s", ctm_tests[i].desc);
 		igt_subtest_with_dynamic_f("%s", ctm_tests[i].name) {
 			for_each_pipe(&data->display, pipe) {
+				if (execution_constraint(pipe))
+					continue;
+
 				run_ctm_tests_for_pipe(data, pipe,
 						       ctm_tests[i].colors,
 						       ctm_tests[i].ctm,
@@ -1041,9 +1058,28 @@ run_tests_for_pipe(data_t *data)
 	}
 }
 
-igt_main
+static int opt_handler(int opt, int opt_index, void *_data)
+{
+	switch (opt) {
+	case 'e':
+		extended = true;
+		break;
+	default:
+		return IGT_OPT_HANDLER_ERROR;
+	}
+
+	return IGT_OPT_HANDLER_SUCCESS;
+}
+
+const char *help_str =
+	"  -e \tExtended tests.\n";
+
+igt_main_args("e", NULL, help_str, opt_handler, NULL)
 {
 	data_t data = {};
+	enum pipe pipe;
+
+	last_pipe = 0;
 
 	igt_fixture {
 		data.drm_fd = drm_open_driver_master(DRIVER_ANY);
@@ -1052,6 +1088,11 @@ igt_main
 		kmstest_set_vt_graphics_mode();
 
 		igt_display_require(&data.display, data.drm_fd);
+
+		/* Get active pipes. */
+		for_each_pipe(&data.display, pipe)
+			active_pipes[last_pipe++] = pipe;
+		last_pipe--;
 	}
 
 	igt_subtest_group
-- 
2.39.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread
* [igt-dev] [PATCH i-g-t v3] tests/kms_color: Limit the execution to two pipes
@ 2023-02-28  5:12 Nidhi Gupta
  0 siblings, 0 replies; 5+ messages in thread
From: Nidhi Gupta @ 2023-02-28  5:12 UTC (permalink / raw)
  To: igt-dev; +Cc: Nidhi Gupta

As the test execution is taking more time on simulation, limit the
execution to two (first & last) pipes. This optimization is for
simulation and hardware.

This patch will also provide an option (command line flag '-e') to
execute on all pipes.

Example: ./kms_color -e --run-subtest ctm-0-50

v2: Restrict the execution only on 2 pipes for
    real hardware aswell (Ankit)
v3: Restrict the execution only on 2 pipes for
    all subtests (Bhanu)

Signed-off-by: Nidhi Gupta <nidhi1.gupta@intel.com>
---
 tests/kms_color.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 51 insertions(+), 1 deletion(-)

diff --git a/tests/kms_color.c b/tests/kms_color.c
index 45570083..54580315 100644
--- a/tests/kms_color.c
+++ b/tests/kms_color.c
@@ -26,6 +26,10 @@
 
 IGT_TEST_DESCRIPTION("Test Color Features at Pipe level");
 
+static bool extended;
+static enum pipe active_pipes[IGT_MAX_PIPES];
+static uint32_t last_pipe;
+
 static bool test_pipe_degamma(data_t *data,
 			      igt_plane_t *primary)
 {
@@ -878,6 +882,16 @@ run_deep_color_tests_for_pipe(data_t *data, enum pipe p)
 	test_cleanup(data);
 }
 
+static bool execution_constraint(enum pipe pipe)
+{
+	if (!extended &&
+	    pipe != active_pipes[0] &&
+	    pipe != active_pipes[last_pipe])
+		return true;
+
+	return false;
+}
+
 static void
 run_invalid_tests_for_pipe(data_t *data)
 {
@@ -902,6 +916,9 @@ run_invalid_tests_for_pipe(data_t *data)
 		igt_describe_f("%s", tests[i].desc);
 		igt_subtest_with_dynamic_f("%s", tests[i].name) {
 			for_each_pipe(&data->display, pipe) {
+				if (execution_constraint(pipe))
+					continue;
+
 				prep_pipe(data, pipe);
 
 				igt_dynamic_f("pipe-%s", kmstest_pipe_name(pipe))
@@ -1012,6 +1029,9 @@ run_tests_for_pipe(data_t *data)
 		igt_describe_f("%s", gamma_degamma_tests[i].desc);
 		igt_subtest_with_dynamic_f("%s", gamma_degamma_tests[i].name) {
 			for_each_pipe(&data->display, pipe) {
+				if (execution_constraint(pipe))
+					continue;
+
 				run_gamma_degamma_tests_for_pipe(data, pipe,
 								 gamma_degamma_tests[i].test_t);
 			}
@@ -1022,6 +1042,9 @@ run_tests_for_pipe(data_t *data)
 		igt_describe_f("%s", ctm_tests[i].desc);
 		igt_subtest_with_dynamic_f("%s", ctm_tests[i].name) {
 			for_each_pipe(&data->display, pipe) {
+				if (execution_constraint(pipe))
+					continue;
+
 				run_ctm_tests_for_pipe(data, pipe,
 						       ctm_tests[i].colors,
 						       ctm_tests[i].ctm,
@@ -1036,14 +1059,36 @@ run_tests_for_pipe(data_t *data)
 	igt_describe("Verify that deep color works correctly");
 	igt_subtest_with_dynamic("deep-color") {
 		for_each_pipe(&data->display, pipe) {
+			if (execution_constraint(pipe))
+				continue;
+
 			run_deep_color_tests_for_pipe(data, pipe);
 		}
 	}
 }
 
-igt_main
+static int opt_handler(int opt, int opt_index, void *_data)
+{
+	switch (opt) {
+	case 'e':
+		extended = true;
+		break;
+	default:
+		return IGT_OPT_HANDLER_ERROR;
+	}
+
+	return IGT_OPT_HANDLER_SUCCESS;
+}
+
+const char *help_str =
+	"  -e \tExtended tests.\n";
+
+igt_main_args("e", NULL, help_str, opt_handler, NULL)
 {
 	data_t data = {};
+	enum pipe pipe;
+
+	last_pipe = 0;
 
 	igt_fixture {
 		data.drm_fd = drm_open_driver_master(DRIVER_ANY);
@@ -1052,6 +1097,11 @@ igt_main
 		kmstest_set_vt_graphics_mode();
 
 		igt_display_require(&data.display, data.drm_fd);
+
+		/* Get active pipes. */
+		for_each_pipe(&data.display, pipe)
+			active_pipes[last_pipe++] = pipe;
+		last_pipe--;
 	}
 
 	igt_subtest_group
-- 
2.39.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-02-28  7:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-28  4:24 [igt-dev] [PATCH i-g-t v3] tests/kms_color: Limit the execution to two pipes Nidhi Gupta
2023-02-28  4:46 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_color: Limit the execution to two pipes (rev2) Patchwork
2023-02-28  4:56 ` [igt-dev] [PATCH i-g-t v3] tests/kms_color: Limit the execution to two pipes Modem, Bhanuprakash
2023-02-28  7:09 ` [igt-dev] ✗ Fi.CI.IGT: failure for tests/kms_color: Limit the execution to two pipes (rev2) Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2023-02-28  5:12 [igt-dev] [PATCH i-g-t v3] tests/kms_color: Limit the execution to two pipes Nidhi Gupta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox