[Intel-gfx] [PATCH i-g-t] tests: add some color management tests to BAT

Lionel Landwerlin lionel.g.landwerlin at intel.com
Tue Jul 19 13:56:47 UTC 2016


We only enable pipe A tests and basic size fuzzing tests to minimize
the amount of time spend. From experience color management issues
tends to trigger failures on all pipes so only testing one seems
reasonable.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
---
 tests/kms_pipe_color.c | 37 ++++++++++++++++++++++---------------
 1 file changed, 22 insertions(+), 15 deletions(-)

diff --git a/tests/kms_pipe_color.c b/tests/kms_pipe_color.c
index 9f7ac7e..eea70b9 100644
--- a/tests/kms_pipe_color.c
+++ b/tests/kms_pipe_color.c
@@ -830,6 +830,13 @@ static void test_pipe_limited_range_ctm(data_t *data,
 }
 #endif
 
+static const char *
+test_prefix_for_pipe(enum pipe p)
+{
+	// Only make the first pipe part of the BAT.
+	return p == PIPE_A ? "basic-" : "";
+}
+
 static void
 run_tests_for_pipe(data_t *data, enum pipe p)
 {
@@ -879,7 +886,7 @@ run_tests_for_pipe(data_t *data, enum pipe p)
 	data->color_depth = 8;
 	delta = 1.0 / (1 << data->color_depth);
 
-	igt_subtest_f("ctm-red-to-blue-pipe%d", p) {
+	igt_subtest_f("%sctm-red-to-blue-pipe%d", test_prefix_for_pipe(p), p) {
 		color_t blue_green_blue[] = {
 			{ 0.0, 0.0, 1.0 },
 			{ 0.0, 1.0, 0.0 },
@@ -892,7 +899,7 @@ run_tests_for_pipe(data_t *data, enum pipe p)
 					 blue_green_blue, ctm));
 	}
 
-	igt_subtest_f("ctm-green-to-red-pipe%d", p) {
+	igt_subtest_f("%sctm-green-to-red-pipe%d", test_prefix_for_pipe(p), p) {
 		color_t red_red_blue[] = {
 			{ 1.0, 0.0, 0.0 },
 			{ 1.0, 0.0, 0.0 },
@@ -905,7 +912,7 @@ run_tests_for_pipe(data_t *data, enum pipe p)
 					 red_red_blue, ctm));
 	}
 
-	igt_subtest_f("ctm-blue-to-red-pipe%d", p) {
+	igt_subtest_f("%sctm-blue-to-red-pipe%d", test_prefix_for_pipe(p), p) {
 		color_t red_green_red[] = {
 			{ 1.0, 0.0, 0.0 },
 			{ 0.0, 1.0, 0.0 },
@@ -922,7 +929,7 @@ run_tests_for_pipe(data_t *data, enum pipe p)
 	 * the 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. */
-	igt_subtest_f("ctm-0-25-pipe%d", p) {
+	igt_subtest_f("%sctm-0-25-pipe%d", test_prefix_for_pipe(p), p) {
 		color_t expected_colors[] = {
 			{ 0.0, }, { 0.0, }, { 0.0, }
 		};
@@ -943,7 +950,7 @@ run_tests_for_pipe(data_t *data, enum pipe p)
 		igt_assert(success);
 	}
 
-	igt_subtest_f("ctm-0-5-pipe%d", p) {
+	igt_subtest_f("%sctm-0-5-pipe%d", test_prefix_for_pipe(p), p) {
 		color_t expected_colors[] = {
 			{ 0.0, }, { 0.0, }, { 0.0, }
 		};
@@ -964,7 +971,7 @@ run_tests_for_pipe(data_t *data, enum pipe p)
 		igt_assert(success);
 	}
 
-	igt_subtest_f("ctm-0-75-pipe%d", p) {
+	igt_subtest_f("%sctm-0-75-pipe%d", test_prefix_for_pipe(p), p) {
 		color_t expected_colors[] = {
 			{ 0.0, }, { 0.0, }, { 0.0, }
 		};
@@ -985,7 +992,7 @@ run_tests_for_pipe(data_t *data, enum pipe p)
 		igt_assert(success);
 	}
 
-	igt_subtest_f("ctm-max-pipe%d", p) {
+	igt_subtest_f("%sctm-max-pipe%d", test_prefix_for_pipe(p), p) {
 		color_t full_rgb[] = {
 			{ 1.0, 0.0, 0.0 },
 			{ 0.0, 1.0, 0.0 },
@@ -1003,7 +1010,7 @@ run_tests_for_pipe(data_t *data, enum pipe p)
 					 full_rgb, ctm));
 	}
 
-	igt_subtest_f("ctm-negative-pipe%d", p) {
+	igt_subtest_f("%sctm-negative-pipe%d", test_prefix_for_pipe(p), p) {
 		color_t all_black[] = {
 			{ 0.0, 0.0, 0.0 },
 			{ 0.0, 0.0, 0.0 },
@@ -1017,20 +1024,20 @@ run_tests_for_pipe(data_t *data, enum pipe p)
 	}
 
 #if 0
-	igt_subtest_f("ctm-limited-range-pipe%d", p)
+	igt_subtest_f("%sctm-limited-range-pipe%d", test_prefix_for_pipe(p), p)
 		test_pipe_limited_range_ctm(data, primary);
 #endif
 
-	igt_subtest_f("degamma-pipe%d", p)
+	igt_subtest_f("%sdegamma-pipe%d", test_prefix_for_pipe(p), p)
 		test_pipe_degamma(data, primary);
 
-	igt_subtest_f("gamma-pipe%d", p)
+	igt_subtest_f("%sgamma-pipe%d", test_prefix_for_pipe(p), p)
 		test_pipe_gamma(data, primary);
 
-	igt_subtest_f("legacy-gamma-pipe%d", p)
+	igt_subtest_f("%slegacy-gamma-pipe%d", test_prefix_for_pipe(p), p)
 		test_pipe_legacy_gamma(data, primary);
 
-	igt_subtest_f("legacy-gamma-reset-pipe%d", p)
+	igt_subtest_f("%slegacy-gamma-reset-pipe%d", test_prefix_for_pipe(p), p)
 		test_pipe_legacy_gamma_reset(data, primary);
 
 	igt_fixture {
@@ -1172,10 +1179,10 @@ igt_main
 	for (int pipe = 0; pipe < I915_MAX_PIPES; pipe++)
 		run_tests_for_pipe(&data, pipe);
 
-	igt_subtest_f("invalid-lut-sizes")
+	igt_subtest_f("basic-invalid-lut-sizes")
 		invalid_lut_sizes(&data);
 
-	igt_subtest_f("invalid-ctm-matrix-sizes")
+	igt_subtest_f("basic-invalid-ctm-matrix-sizes")
 		invalid_ctm_matrix_sizes(&data);
 
 	igt_fixture {
-- 
2.8.1



More information about the Intel-gfx mailing list