[PATCH i-g-t 2/3] tests/kms_color: Add connector name to dynamic subtests

Bhanuprakash Modem bhanuprakash.modem at intel.com
Fri May 24 10:12:01 UTC 2024


Add connector name to dynamic subtests, so that it would
be easy to understand that which pipe/output combo is
selected.

Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
---
 tests/kms_color.c | 66 +++++++++++++++++++++++------------------------
 1 file changed, 32 insertions(+), 34 deletions(-)

diff --git a/tests/kms_color.c b/tests/kms_color.c
index bdb80a4ad..645a03537 100644
--- a/tests/kms_color.c
+++ b/tests/kms_color.c
@@ -790,8 +790,8 @@ run_gamma_degamma_tests_for_pipe(data_t *data, enum pipe p,
 	if (!pipe_output_combo_valid(data, p))
 		goto out;
 
-	igt_assert(test_t(data, data->primary));
-
+	igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(p), igt_output_name(data->output))
+		igt_assert(test_t(data, data->primary));
 out:
 	test_cleanup(data);
 }
@@ -832,30 +832,32 @@ run_ctm_tests_for_pipe(data_t *data, enum pipe p,
 	if (!iter)
 		iter = 1;
 
-	/*
-	 * We tests a few values around the expected result because
-	 * it depends on the hardware we're dealing with, we can either
-	 * get clamped or rounded values and we also need to account
-	 * for odd number of items in the LUTs.
-	 */
-	for (i = 0; i < iter; i++) {
-		color_t expected_colors[3] = {
-			fb_colors[0],
-			fb_colors[1],
-			fb_colors[2],
-		};
-
-		transform_color(&expected_colors[0], ctm, delta * (i - (iter / 2)));
-		transform_color(&expected_colors[1], ctm, delta * (i - (iter / 2)));
-		transform_color(&expected_colors[2], ctm, delta * (i - (iter / 2)));
-
-		if (test_pipe_ctm(data, data->primary, fb_colors,
-				  expected_colors, ctm)) {
-			success = true;
-			break;
+	igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(p), igt_output_name(data->output)) {
+		/*
+		 * We tests a few values around the expected result because
+		 * it depends on the hardware we're dealing with, we can either
+		 * get clamped or rounded values and we also need to account
+		 * for odd number of items in the LUTs.
+		 */
+		for (i = 0; i < iter; i++) {
+			color_t expected_colors[3] = {
+				fb_colors[0],
+				fb_colors[1],
+				fb_colors[2],
+			};
+
+			transform_color(&expected_colors[0], ctm, delta * (i - (iter / 2)));
+			transform_color(&expected_colors[1], ctm, delta * (i - (iter / 2)));
+			transform_color(&expected_colors[2], ctm, delta * (i - (iter / 2)));
+
+			if (test_pipe_ctm(data, data->primary, fb_colors,
+					  expected_colors, ctm)) {
+				success = true;
+				break;
+			}
 		}
+		igt_assert(success);
 	}
-	igt_assert(success);
 
 out:
 	test_cleanup(data);
@@ -1129,10 +1131,8 @@ 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) {
-				igt_dynamic_f("pipe-%s", kmstest_pipe_name(pipe)) {
-					run_gamma_degamma_tests_for_pipe(data, pipe,
-									 gamma_degamma_tests[i].test_t);
-				}
+				run_gamma_degamma_tests_for_pipe(data, pipe,
+								 gamma_degamma_tests[i].test_t);
 			}
 		}
 	}
@@ -1141,12 +1141,10 @@ 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) {
-				igt_dynamic_f("pipe-%s", kmstest_pipe_name(pipe)) {
-					run_ctm_tests_for_pipe(data, pipe,
-							       ctm_tests[i].fb_colors,
-							       ctm_tests[i].ctm,
-							       ctm_tests[i].iter);
-				}
+				run_ctm_tests_for_pipe(data, pipe,
+						       ctm_tests[i].fb_colors,
+						       ctm_tests[i].ctm,
+						       ctm_tests[i].iter);
 			}
 		}
 	}
-- 
2.43.2



More information about the igt-dev mailing list