Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t v2 0/9] tests/kms_color: Improve CTM tests
@ 2023-04-11 16:15 Ville Syrjala
  2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 1/9] tests/kms_color: Use legacy LUT for chopping off the lsbs Ville Syrjala
                   ` (9 more replies)
  0 siblings, 10 replies; 19+ messages in thread
From: Ville Syrjala @ 2023-04-11 16:15 UTC (permalink / raw)
  To: igt-dev

From: Ville Syrjälä <ville.syrjala@linux.intel.com>


Bunch of fixe and cleanups to the CTM tests. Also add a new
"signed" subtest to highlight a bug in the i915 CHV CGM code.

v2: Tweak the dyamic subtest stuff in order to
    make CHV actually run the tests

Ville Syrjälä (9):
  tests/kms_color: Use legacy LUT for chopping off the lsbs
  tests/kms_color: Use named initializers
  tests/kms_color: Make loads of stuff static const
  tests/kms_color: Pass down the colors used to paint the fb
  tests/kms_color: Get rid of hand coded "expected_colors"
  tests/kms_color: Add and additional "signed" subtest
  tests/kms_color: Dump the CTM before/after color values
  tests/kms_color: Move dynamic subtests up one level
  tests/intel-ci/fast-feedback: Run ctm tests

 tests/intel-ci/fast-feedback.testlist |  11 +
 tests/kms_color.c                     | 335 +++++++++++++++-----------
 tests/kms_color_helper.c              |   4 +-
 tests/kms_color_helper.h              |   4 +-
 4 files changed, 208 insertions(+), 146 deletions(-)

-- 
2.39.2

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

* [igt-dev] [PATCH i-g-t v2 1/9] tests/kms_color: Use legacy LUT for chopping off the lsbs
  2023-04-11 16:15 [igt-dev] [PATCH i-g-t v2 0/9] tests/kms_color: Improve CTM tests Ville Syrjala
@ 2023-04-11 16:15 ` Ville Syrjala
  2023-05-04 21:21   ` Shankar, Uma
  2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 2/9] tests/kms_color: Use named initializers Ville Syrjala
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 19+ messages in thread
From: Ville Syrjala @ 2023-04-11 16:15 UTC (permalink / raw)
  To: igt-dev

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Trying to use an interpolated gamma mode (as is the case currently
on eg. icl/tgl) for chopping off the lsbs doesn't really work. Use
the legacy LUT instead. Also get rid of the degamma LUT as that
can't even be enabled alognside the legacy LUT on split gamma i915
platforms (ivb-skl).

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/kms_color.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/tests/kms_color.c b/tests/kms_color.c
index cd03c1354c0a..369dc8057d83 100644
--- a/tests/kms_color.c
+++ b/tests/kms_color.c
@@ -504,13 +504,10 @@ static bool test_pipe_ctm(data_t *data,
 	 * rounding issues and inaccuracies leading to crc mismatch.
 	 */
 	if (is_i915_device(data->drm_fd) && memcmp(before, after, sizeof(color_t))) {
-		igt_require(igt_pipe_obj_has_prop(primary->pipe, IGT_CRTC_DEGAMMA_LUT));
 		igt_require(igt_pipe_obj_has_prop(primary->pipe, IGT_CRTC_GAMMA_LUT));
 
-		degamma_linear = generate_table(data->degamma_lut_size, 1.0);
-		gamma_linear = generate_table(data->gamma_lut_size, 1.0);
+		gamma_linear = generate_table(256, 1.0);
 
-		set_degamma(data, primary->pipe, degamma_linear);
 		set_gamma(data, primary->pipe, gamma_linear);
 	}
 
-- 
2.39.2

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

* [igt-dev] [PATCH i-g-t v2 2/9] tests/kms_color: Use named initializers
  2023-04-11 16:15 [igt-dev] [PATCH i-g-t v2 0/9] tests/kms_color: Improve CTM tests Ville Syrjala
  2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 1/9] tests/kms_color: Use legacy LUT for chopping off the lsbs Ville Syrjala
@ 2023-04-11 16:15 ` Ville Syrjala
  2023-05-04 21:23   ` Shankar, Uma
  2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 3/9] tests/kms_color: Make loads of stuff static const Ville Syrjala
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 19+ messages in thread
From: Ville Syrjala @ 2023-04-11 16:15 UTC (permalink / raw)
  To: igt-dev

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Use named initializers to make it actually possible to figure out
what is happening. And sprinkle some missing commas around while
at it.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/kms_color.c | 202 +++++++++++++++++++++++++++-------------------
 1 file changed, 118 insertions(+), 84 deletions(-)

diff --git a/tests/kms_color.c b/tests/kms_color.c
index 369dc8057d83..84a8eabe5484 100644
--- a/tests/kms_color.c
+++ b/tests/kms_color.c
@@ -35,7 +35,7 @@ static bool test_pipe_degamma(data_t *data,
 	color_t red_green_blue[] = {
 		{ 1.0, 0.0, 0.0 },
 		{ 0.0, 1.0, 0.0 },
-		{ 0.0, 0.0, 1.0 }
+		{ 0.0, 0.0, 1.0 },
 	};
 	drmModeModeInfo *mode = data->mode;
 	struct igt_fb fb_modeset, fb;
@@ -127,7 +127,7 @@ static bool test_pipe_gamma(data_t *data,
 	color_t red_green_blue[] = {
 		{ 1.0, 0.0, 0.0 },
 		{ 0.0, 1.0, 0.0 },
-		{ 0.0, 0.0, 1.0 }
+		{ 0.0, 0.0, 1.0 },
 	};
 	drmModeModeInfo *mode = data->mode;
 	struct igt_fb fb_modeset, fb;
@@ -215,7 +215,7 @@ static bool test_pipe_legacy_gamma(data_t *data,
 	color_t red_green_blue[] = {
 		{ 1.0, 0.0, 0.0 },
 		{ 0.0, 1.0, 0.0 },
-		{ 0.0, 0.0, 1.0 }
+		{ 0.0, 0.0, 1.0 },
 	};
 	drmModeCrtc *kms_crtc;
 	uint32_t i, legacy_lut_size;
@@ -324,7 +324,7 @@ static bool test_pipe_legacy_gamma_reset(data_t *data,
 	const double ctm_identity[] = {
 		1.0, 0.0, 0.0,
 		0.0, 1.0, 0.0,
-		0.0, 0.0, 1.0
+		0.0, 0.0, 1.0,
 	};
 	drmModeCrtc *kms_crtc;
 	gamma_lut_t *degamma_linear = NULL, *gamma_zero;
@@ -461,7 +461,7 @@ static bool test_pipe_ctm(data_t *data,
 	const double ctm_identity[] = {
 		1.0, 0.0, 0.0,
 		0.0, 1.0, 0.0,
-		0.0, 0.0, 1.0
+		0.0, 0.0, 1.0,
 	};
 	gamma_lut_t *degamma_linear = NULL, *gamma_linear = NULL;
 	igt_output_t *output = data->output;
@@ -569,16 +569,18 @@ static void test_pipe_limited_range_ctm(data_t *data,
 	color_t red_green_blue_limited[] = {
 		{ limited_result, 0.0, 0.0 },
 		{ 0.0, limited_result, 0.0 },
-		{ 0.0, 0.0, limited_result }
+		{ 0.0, 0.0, limited_result },
 	};
 	color_t red_green_blue_full[] = {
 		{ 0.5, 0.0, 0.0 },
 		{ 0.0, 0.5, 0.0 },
-		{ 0.0, 0.0, 0.5 }
+		{ 0.0, 0.0, 0.5 },
+	};
+	double ctm[] = {
+		1.0, 0.0, 0.0,
+		0.0, 1.0, 0.0,
+		0.0, 0.0, 1.0,
 	};
-	double ctm[] = { 1.0, 0.0, 0.0,
-			0.0, 1.0, 0.0,
-			0.0, 0.0, 1.0 };
 	gamma_lut_t *degamma_linear, *gamma_linear;
 	igt_output_t *output;
 	bool has_broadcast_rgb_output = false;
@@ -743,7 +745,7 @@ run_ctm_tests_for_pipe(data_t *data, enum pipe p,
 	color_t red_green_blue[] = {
 		{ 1.0, 0.0, 0.0 },
 		{ 0.0, 1.0, 0.0 },
-		{ 0.0, 0.0, 1.0 }
+		{ 0.0, 0.0, 1.0 },
 	};
 
 	test_setup(data, p);
@@ -799,16 +801,18 @@ run_deep_color_tests_for_pipe(data_t *data, enum pipe p)
 	color_t blue_green_blue[] = {
 		{ 0.0, 0.0, 1.0 },
 		{ 0.0, 1.0, 0.0 },
-		{ 0.0, 0.0, 1.0 }
+		{ 0.0, 0.0, 1.0 },
 	};
 	color_t red_green_blue[] = {
 		{ 1.0, 0.0, 0.0 },
 		{ 0.0, 1.0, 0.0 },
 		{ 0.0, 0.0, 1.0 }
 	};
-	double ctm[] = { 0.0, 0.0, 0.0,
-			 0.0, 1.0, 0.0,
-			 1.0, 0.0, 1.0 };
+	double ctm[] = {
+		0.0, 0.0, 0.0,
+		0.0, 1.0, 0.0,
+		1.0, 0.0, 1.0,
+	};
 
 	if (is_i915_device(data->drm_fd))
 		igt_require_f((intel_display_ver(data->devid) >= 11),
@@ -924,17 +928,22 @@ run_tests_for_pipe(data_t *data)
 		bool (*test_t)(data_t*, igt_plane_t*);
 		const char *desc;
 	} gamma_degamma_tests[] = {
-		{ "degamma", test_pipe_degamma,
-		  "Verify that degamma LUT transformation works correctly" },
-
-		{ "gamma", test_pipe_gamma,
-		  "Verify that gamma LUT transformation works correctly" },
-
-		{ "legacy-gamma", test_pipe_legacy_gamma,
-		  "Verify that legacy gamma LUT transformation works correctly" },
-
-		{ "legacy-gamma-reset", test_pipe_legacy_gamma_reset,
-		  "Verify that setting the legacy gamma LUT resets the gamma LUT set through GAMMA_LUT property" },
+		{ .name = "degamma",
+		  .test_t = test_pipe_degamma,
+		  .desc = "Verify that degamma LUT transformation works correctly",
+		},
+		{ .name = "gamma",
+		  .test_t = test_pipe_gamma,
+		  .desc = "Verify that gamma LUT transformation works correctly",
+		},
+		{ .name = "legacy-gamma",
+		  .test_t = test_pipe_legacy_gamma,
+		  .desc = "Verify that legacy gamma LUT transformation works correctly",
+		},
+		{ .name = "legacy-gamma-reset",
+		  .test_t = test_pipe_legacy_gamma_reset,
+		  .desc = "Verify that setting the legacy gamma LUT resets the gamma LUT set through GAMMA_LUT property",
+		},
 	};
 	struct {
 		const char *name;
@@ -943,71 +952,96 @@ run_tests_for_pipe(data_t *data)
 		double ctm[9];
 		const char *desc;
 	} ctm_tests[] = {
-		{ "ctm-red-to-blue", 0,
-			{{ 0.0, 0.0, 1.0 },
-			 { 0.0, 1.0, 0.0 },
-			 { 0.0, 0.0, 1.0 }},
-		  { 0.0, 0.0, 0.0,
-		    0.0, 1.0, 0.0,
-		    1.0, 0.0, 1.0 },
-		  "Check the color transformation from red to blue"
+		{ .name = "ctm-red-to-blue",
+		  .colors = {
+			  { 0.0, 0.0, 1.0 },
+			  { 0.0, 1.0, 0.0 },
+			  { 0.0, 0.0, 1.0 },
+		  },
+		  .ctm = {
+			  0.0, 0.0, 0.0,
+			  0.0, 1.0, 0.0,
+			  1.0, 0.0, 1.0,
+		  },
+		  .desc = "Check the color transformation from red to blue",
 		},
-		{ "ctm-green-to-red", 0,
-			{{ 1.0, 0.0, 0.0 },
-			 { 1.0, 0.0, 0.0 },
-			 { 0.0, 0.0, 1.0 }},
-		  { 1.0, 1.0, 0.0,
-		    0.0, 0.0, 0.0,
-		    0.0, 0.0, 1.0 },
-		  "Check the color transformation from green to red"
+		{ .name = "ctm-green-to-red",
+		  .colors = {
+			  { 1.0, 0.0, 0.0 },
+			  { 1.0, 0.0, 0.0 },
+			  { 0.0, 0.0, 1.0 },
+		  },
+		  .ctm = {
+			  1.0, 1.0, 0.0,
+			  0.0, 0.0, 0.0,
+			  0.0, 0.0, 1.0,
+		  },
+		  .desc = "Check the color transformation from green to red",
 		},
-		{ "ctm-blue-to-red", 0,
-			{{ 1.0, 0.0, 0.0 },
-			 { 0.0, 1.0, 0.0 },
-			 { 1.0, 0.0, 0.0 }},
-		  { 1.0, 0.0, 1.0,
-		    0.0, 1.0, 0.0,
-		    0.0, 0.0, 0.0 },
-		  "Check the color transformation from blue to red"
+		{ .name = "ctm-blue-to-red",
+		  .colors = {
+			  { 1.0, 0.0, 0.0 },
+			  { 0.0, 1.0, 0.0 },
+			  { 1.0, 0.0, 0.0 },
+		  },
+		  .ctm = {
+			  1.0, 0.0, 1.0,
+			  0.0, 1.0, 0.0,
+			  0.0, 0.0, 0.0,
+		  },
+		  .desc = "Check the color transformation from blue to red",
 		},
-		{ "ctm-max", 0,
-			{{ 1.0, 0.0, 0.0 },
-			 { 0.0, 1.0, 0.0 },
-			 { 0.0, 0.0, 1.0 }},
-		  { 100.0, 0.0, 0.0,
-		    0.0, 100.0, 0.0,
-		    0.0, 0.0, 100.0 },
-		  "Check the color transformation for maximum transparency"
+		{ .name = "ctm-max",
+		  .colors = {
+			  { 1.0, 0.0, 0.0 },
+			  { 0.0, 1.0, 0.0 },
+			  { 0.0, 0.0, 1.0 },
+		  },
+		  .ctm = { 100.0, 0.0, 0.0,
+			  0.0, 100.0, 0.0,
+			  0.0, 0.0, 100.0,
+		  },
+		  .desc = "Check the color transformation for maximum transparency",
 		},
-		{ "ctm-negative", 0,
-			{{ 0.0, 0.0, 0.0 },
-			 { 0.0, 0.0, 0.0 },
-			 { 0.0, 0.0, 0.0 }},
-		  { -1.0, 0.0, 0.0,
-		    0.0, -1.0, 0.0,
-		    0.0, 0.0, -1.0 },
-		  "Check the color transformation for negative transparency"
+		{ .name = "ctm-negative",
+		  .colors = {
+			  { 0.0, 0.0, 0.0 },
+			  { 0.0, 0.0, 0.0 },
+			  { 0.0, 0.0, 0.0 },
+		  },
+		  .ctm = {
+			  -1.0,  0.0,  0.0,
+			   0.0, -1.0,  0.0,
+			   0.0,  0.0, -1.0,
+		  },
+		  .desc = "Check the color transformation for negative transparency",
 		},
-		{ "ctm-0-25", 5,
-			{{ 0.0, }, { 0.0, }, { 0.0, }},
-		  { 0.25, 0.0,  0.0,
-		    0.0,  0.25, 0.0,
-		    0.0,  0.0,  0.25 },
-		  "Check the color transformation for 0.25 transparency"
+		{ .name = "ctm-0-25",
+		  .iter = 5,
+		  .ctm = {
+			  0.25, 0.0,  0.0,
+			  0.0,  0.25, 0.0,
+			  0.0,  0.0,  0.25,
+		  },
+		  .desc = "Check the color transformation for 0.25 transparency",
 		},
-		{ "ctm-0-50", 5,
-			{{ 0.0, }, { 0.0, }, { 0.0, }},
-		  { 0.5,  0.0,  0.0,
-		    0.0,  0.5,  0.0,
-		    0.0,  0.0,  0.5 },
-		  "Check the color transformation for 0.5 transparency"
+		{ .name = "ctm-0-50",
+		  .iter = 5,
+		  .ctm = {
+			  0.5,  0.0,  0.0,
+			  0.0,  0.5,  0.0,
+			  0.0,  0.0,  0.5,
+		  },
+		  .desc = "Check the color transformation for 0.5 transparency",
 		},
-		{ "ctm-0-75", 7,
-			{{ 0.0, }, { 0.0, }, { 0.0, }},
-		  { 0.75, 0.0,  0.0,
-		    0.0,  0.75, 0.0,
-		    0.0,  0.0,  0.75 },
-		  "Check the color transformation for 0.75 transparency"
+		{ .name = "ctm-0-75",
+		  .iter = 7,
+		  .ctm = {
+			  0.75, 0.0,  0.0,
+			  0.0,  0.75, 0.0,
+			  0.0,  0.0,  0.75,
+		  },
+		  .desc = "Check the color transformation for 0.75 transparency",
 		},
 	};
 	int i;
-- 
2.39.2

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

* [igt-dev] [PATCH i-g-t v2 3/9] tests/kms_color: Make loads of stuff static const
  2023-04-11 16:15 [igt-dev] [PATCH i-g-t v2 0/9] tests/kms_color: Improve CTM tests Ville Syrjala
  2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 1/9] tests/kms_color: Use legacy LUT for chopping off the lsbs Ville Syrjala
  2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 2/9] tests/kms_color: Use named initializers Ville Syrjala
@ 2023-04-11 16:15 ` Ville Syrjala
  2023-05-04 21:26   ` Shankar, Uma
  2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 4/9] tests/kms_color: Pass down the colors used to paint the fb Ville Syrjala
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 19+ messages in thread
From: Ville Syrjala @ 2023-04-11 16:15 UTC (permalink / raw)
  To: igt-dev

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Huge swaths of the data used in the test can be made static const.
The one slightly tricky part is 'expected_colors' which is being
mutated in the ctm tests. But we can just use an on stack variable
for that.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/kms_color.c        | 47 +++++++++++++++++++++-------------------
 tests/kms_color_helper.c |  4 ++--
 tests/kms_color_helper.h |  4 ++--
 3 files changed, 29 insertions(+), 26 deletions(-)

diff --git a/tests/kms_color.c b/tests/kms_color.c
index 84a8eabe5484..5c4d884f4de8 100644
--- a/tests/kms_color.c
+++ b/tests/kms_color.c
@@ -321,7 +321,7 @@ static bool test_pipe_legacy_gamma(data_t *data,
 static bool test_pipe_legacy_gamma_reset(data_t *data,
 					 igt_plane_t *primary)
 {
-	const double ctm_identity[] = {
+	static const double ctm_identity[] = {
 		1.0, 0.0, 0.0,
 		0.0, 1.0, 0.0,
 		0.0, 0.0, 1.0,
@@ -454,11 +454,11 @@ end:
  */
 static bool test_pipe_ctm(data_t *data,
 			  igt_plane_t *primary,
-			  color_t *before,
-			  color_t *after,
-			  double *ctm_matrix)
+			  const color_t *before,
+			  const color_t *after,
+			  const double *ctm_matrix)
 {
-	const double ctm_identity[] = {
+	static const double ctm_identity[] = {
 		1.0, 0.0, 0.0,
 		0.0, 1.0, 0.0,
 		0.0, 0.0, 1.0,
@@ -566,17 +566,17 @@ static void test_pipe_limited_range_ctm(data_t *data,
 					igt_plane_t *primary)
 {
 	double limited_result = 235.0 / 255.0;
-	color_t red_green_blue_limited[] = {
+	static const color_t red_green_blue_limited[] = {
 		{ limited_result, 0.0, 0.0 },
 		{ 0.0, limited_result, 0.0 },
 		{ 0.0, 0.0, limited_result },
 	};
-	color_t red_green_blue_full[] = {
+	static const color_t red_green_blue_full[] = {
 		{ 0.5, 0.0, 0.0 },
 		{ 0.0, 0.5, 0.0 },
 		{ 0.0, 0.0, 0.5 },
 	};
-	double ctm[] = {
+	static const double ctm[] = {
 		1.0, 0.0, 0.0,
 		0.0, 1.0, 0.0,
 		0.0, 0.0, 1.0,
@@ -737,12 +737,12 @@ out:
 
 static void
 run_ctm_tests_for_pipe(data_t *data, enum pipe p,
-		       color_t *expected_colors,
-		       double *ctm,
+		       const color_t *expected_colors,
+		       const double *ctm,
 		       int iter)
 {
 	double delta;
-	color_t red_green_blue[] = {
+	static const color_t red_green_blue[] = {
 		{ 1.0, 0.0, 0.0 },
 		{ 0.0, 1.0, 0.0 },
 		{ 0.0, 0.0, 1.0 },
@@ -777,12 +777,15 @@ run_ctm_tests_for_pipe(data_t *data, enum pipe p,
 		 * for odd number of items in the LUTs.
 		 */
 		for (i = 0; i < iter; i++) {
-			expected_colors[0].r =
-				expected_colors[1].g =
-				expected_colors[2].b =
-				ctm[0] + delta * (i - (iter / 2));
+			float c = ctm[0] + delta * (i - (iter / 2));
+			color_t expected_colors_local[] = {
+				{ .r = c, },
+				{ .g = c, },
+				{ .b = c, },
+			};
+
 			if (test_pipe_ctm(data, data->primary, red_green_blue,
-					  expected_colors, ctm)) {
+					  expected_colors_local, ctm)) {
 				success = true;
 				break;
 			}
@@ -798,17 +801,17 @@ static void
 run_deep_color_tests_for_pipe(data_t *data, enum pipe p)
 {
 	igt_output_t *output;
-	color_t blue_green_blue[] = {
+	static const color_t blue_green_blue[] = {
 		{ 0.0, 0.0, 1.0 },
 		{ 0.0, 1.0, 0.0 },
 		{ 0.0, 0.0, 1.0 },
 	};
-	color_t red_green_blue[] = {
+	static const color_t red_green_blue[] = {
 		{ 1.0, 0.0, 0.0 },
 		{ 0.0, 1.0, 0.0 },
-		{ 0.0, 0.0, 1.0 }
+		{ 0.0, 0.0, 1.0 },
 	};
-	double ctm[] = {
+	static const double ctm[] = {
 		0.0, 0.0, 0.0,
 		0.0, 1.0, 0.0,
 		1.0, 0.0, 1.0,
@@ -923,7 +926,7 @@ static void
 run_tests_for_pipe(data_t *data)
 {
 	enum pipe pipe;
-	struct {
+	static const struct {
 		const char *name;
 		bool (*test_t)(data_t*, igt_plane_t*);
 		const char *desc;
@@ -945,7 +948,7 @@ run_tests_for_pipe(data_t *data)
 		  .desc = "Verify that setting the legacy gamma LUT resets the gamma LUT set through GAMMA_LUT property",
 		},
 	};
-	struct {
+	static const struct {
 		const char *name;
 		int iter;
 		color_t colors[3];
diff --git a/tests/kms_color_helper.c b/tests/kms_color_helper.c
index 2f9950f801e4..5089bc373343 100644
--- a/tests/kms_color_helper.c
+++ b/tests/kms_color_helper.c
@@ -54,7 +54,7 @@ uint64_t get_max_bpc(igt_output_t *output)
 
 void paint_gradient_rectangles(data_t *data,
 			       drmModeModeInfo *mode,
-			       color_t *colors,
+			       const color_t *colors,
 			       struct igt_fb *fb)
 {
 	cairo_t *cr = igt_get_cairo_ctx(data->drm_fd, fb);
@@ -90,7 +90,7 @@ void paint_gradient_rectangles(data_t *data,
 
 void paint_rectangles(data_t *data,
 		      drmModeModeInfo *mode,
-		      color_t *colors,
+		      const color_t *colors,
 		      struct igt_fb *fb)
 {
 	cairo_t *cr = igt_get_cairo_ctx(data->drm_fd, fb);
diff --git a/tests/kms_color_helper.h b/tests/kms_color_helper.h
index 78b97b00864f..23463b944b6f 100644
--- a/tests/kms_color_helper.h
+++ b/tests/kms_color_helper.h
@@ -74,11 +74,11 @@ bool panel_supports_deep_color(int fd, char *output_name);
 uint64_t get_max_bpc(igt_output_t *output);
 void paint_gradient_rectangles(data_t *data,
 			       drmModeModeInfo *mode,
-			       color_t *colors,
+			       const color_t *colors,
 			       struct igt_fb *fb);
 void paint_rectangles(data_t *data,
 		      drmModeModeInfo *mode,
-		      color_t *colors,
+		      const color_t *colors,
 		      struct igt_fb *fb);
 gamma_lut_t *alloc_lut(int lut_size);
 void free_lut(gamma_lut_t *gamma);
-- 
2.39.2

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

* [igt-dev] [PATCH i-g-t v2 4/9] tests/kms_color: Pass down the colors used to paint the fb
  2023-04-11 16:15 [igt-dev] [PATCH i-g-t v2 0/9] tests/kms_color: Improve CTM tests Ville Syrjala
                   ` (2 preceding siblings ...)
  2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 3/9] tests/kms_color: Make loads of stuff static const Ville Syrjala
@ 2023-04-11 16:15 ` Ville Syrjala
  2023-05-04 21:28   ` Shankar, Uma
  2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 5/9] tests/kms_color: Get rid of hand coded "expected_colors" Ville Syrjala
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 19+ messages in thread
From: Ville Syrjala @ 2023-04-11 16:15 UTC (permalink / raw)
  To: igt-dev

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Instead of assuming we always want RGB stripes in the fb let's
pass those colors down from the top. Will be needed to make
more interesting tests that mix colors from multiple channels.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/kms_color.c | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/tests/kms_color.c b/tests/kms_color.c
index 5c4d884f4de8..e3fe2aea4695 100644
--- a/tests/kms_color.c
+++ b/tests/kms_color.c
@@ -737,16 +737,12 @@ out:
 
 static void
 run_ctm_tests_for_pipe(data_t *data, enum pipe p,
+		       const color_t *fb_colors,
 		       const color_t *expected_colors,
 		       const double *ctm,
 		       int iter)
 {
 	double delta;
-	static const color_t red_green_blue[] = {
-		{ 1.0, 0.0, 0.0 },
-		{ 0.0, 1.0, 0.0 },
-		{ 0.0, 0.0, 1.0 },
-	};
 
 	test_setup(data, p);
 
@@ -767,7 +763,7 @@ run_ctm_tests_for_pipe(data_t *data, enum pipe p,
 		int i;
 
 		if (!iter)
-			success = test_pipe_ctm(data, data->primary, red_green_blue,
+			success = test_pipe_ctm(data, data->primary, fb_colors,
 						expected_colors, ctm);
 
 		/*
@@ -784,7 +780,7 @@ run_ctm_tests_for_pipe(data_t *data, enum pipe p,
 				{ .b = c, },
 			};
 
-			if (test_pipe_ctm(data, data->primary, red_green_blue,
+			if (test_pipe_ctm(data, data->primary, fb_colors,
 					  expected_colors_local, ctm)) {
 				success = true;
 				break;
@@ -948,14 +944,21 @@ run_tests_for_pipe(data_t *data)
 		  .desc = "Verify that setting the legacy gamma LUT resets the gamma LUT set through GAMMA_LUT property",
 		},
 	};
+	static const color_t colors_rgb[] = {
+		{ 1.0, 0.0, 0.0 },
+		{ 0.0, 1.0, 0.0 },
+		{ 0.0, 0.0, 1.0 },
+	};
 	static const struct {
 		const char *name;
 		int iter;
+		const color_t *fb_colors;
 		color_t colors[3];
 		double ctm[9];
 		const char *desc;
 	} ctm_tests[] = {
 		{ .name = "ctm-red-to-blue",
+		  .fb_colors = colors_rgb,
 		  .colors = {
 			  { 0.0, 0.0, 1.0 },
 			  { 0.0, 1.0, 0.0 },
@@ -969,6 +972,7 @@ run_tests_for_pipe(data_t *data)
 		  .desc = "Check the color transformation from red to blue",
 		},
 		{ .name = "ctm-green-to-red",
+		  .fb_colors = colors_rgb,
 		  .colors = {
 			  { 1.0, 0.0, 0.0 },
 			  { 1.0, 0.0, 0.0 },
@@ -982,6 +986,7 @@ run_tests_for_pipe(data_t *data)
 		  .desc = "Check the color transformation from green to red",
 		},
 		{ .name = "ctm-blue-to-red",
+		  .fb_colors = colors_rgb,
 		  .colors = {
 			  { 1.0, 0.0, 0.0 },
 			  { 0.0, 1.0, 0.0 },
@@ -995,6 +1000,7 @@ run_tests_for_pipe(data_t *data)
 		  .desc = "Check the color transformation from blue to red",
 		},
 		{ .name = "ctm-max",
+		  .fb_colors = colors_rgb,
 		  .colors = {
 			  { 1.0, 0.0, 0.0 },
 			  { 0.0, 1.0, 0.0 },
@@ -1007,6 +1013,7 @@ run_tests_for_pipe(data_t *data)
 		  .desc = "Check the color transformation for maximum transparency",
 		},
 		{ .name = "ctm-negative",
+		  .fb_colors = colors_rgb,
 		  .colors = {
 			  { 0.0, 0.0, 0.0 },
 			  { 0.0, 0.0, 0.0 },
@@ -1021,6 +1028,7 @@ run_tests_for_pipe(data_t *data)
 		},
 		{ .name = "ctm-0-25",
 		  .iter = 5,
+		  .fb_colors = colors_rgb,
 		  .ctm = {
 			  0.25, 0.0,  0.0,
 			  0.0,  0.25, 0.0,
@@ -1030,6 +1038,7 @@ run_tests_for_pipe(data_t *data)
 		},
 		{ .name = "ctm-0-50",
 		  .iter = 5,
+		  .fb_colors = colors_rgb,
 		  .ctm = {
 			  0.5,  0.0,  0.0,
 			  0.0,  0.5,  0.0,
@@ -1039,6 +1048,7 @@ run_tests_for_pipe(data_t *data)
 		},
 		{ .name = "ctm-0-75",
 		  .iter = 7,
+		  .fb_colors = colors_rgb,
 		  .ctm = {
 			  0.75, 0.0,  0.0,
 			  0.0,  0.75, 0.0,
@@ -1064,6 +1074,7 @@ run_tests_for_pipe(data_t *data)
 		igt_subtest_with_dynamic_f("%s", ctm_tests[i].name) {
 			for_each_pipe(&data->display, pipe) {
 				run_ctm_tests_for_pipe(data, pipe,
+						       ctm_tests[i].fb_colors,
 						       ctm_tests[i].colors,
 						       ctm_tests[i].ctm,
 						       ctm_tests[i].iter);
-- 
2.39.2

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

* [igt-dev] [PATCH i-g-t v2 5/9] tests/kms_color: Get rid of hand coded "expected_colors"
  2023-04-11 16:15 [igt-dev] [PATCH i-g-t v2 0/9] tests/kms_color: Improve CTM tests Ville Syrjala
                   ` (3 preceding siblings ...)
  2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 4/9] tests/kms_color: Pass down the colors used to paint the fb Ville Syrjala
@ 2023-04-11 16:15 ` Ville Syrjala
  2023-05-04 21:39   ` Shankar, Uma
  2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 6/9] tests/kms_color: Add and additional "signed" subtest Ville Syrjala
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 19+ messages in thread
From: Ville Syrjala @ 2023-04-11 16:15 UTC (permalink / raw)
  To: igt-dev

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Instead of specifying the expected colors by hand just apply
the ctm to the fb colors and let the computer do the work for
us.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/kms_color.c | 59 +++++++++++++++++------------------------------
 1 file changed, 21 insertions(+), 38 deletions(-)

diff --git a/tests/kms_color.c b/tests/kms_color.c
index e3fe2aea4695..d430ee12aaa3 100644
--- a/tests/kms_color.c
+++ b/tests/kms_color.c
@@ -735,10 +735,18 @@ out:
 	test_cleanup(data);
 }
 
+static void transform_color(color_t *color, const double *ctm, double offset)
+{
+	color_t tmp = *color;
+
+	color->r = ctm[0] * tmp.r + ctm[1] * tmp.g + ctm[2] * tmp.b + offset;
+	color->g = ctm[3] * tmp.r + ctm[4] * tmp.g + ctm[5] * tmp.b + offset;
+	color->b = ctm[6] * tmp.r + ctm[7] * tmp.g + ctm[8] * tmp.b + offset;
+}
+
 static void
 run_ctm_tests_for_pipe(data_t *data, enum pipe p,
 		       const color_t *fb_colors,
-		       const color_t *expected_colors,
 		       const double *ctm,
 		       int iter)
 {
@@ -758,14 +766,13 @@ run_ctm_tests_for_pipe(data_t *data, enum pipe p,
 	if (!pipe_output_combo_valid(data, p))
 		goto out;
 
+	if (!iter)
+		iter = 1;
+
 	igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(p), data->output->name) {
 		bool success = false;
 		int i;
 
-		if (!iter)
-			success = test_pipe_ctm(data, data->primary, fb_colors,
-						expected_colors, ctm);
-
 		/*
 		 * We tests a few values around the expected result because
 		 * it depends on the hardware we're dealing with, we can either
@@ -773,15 +780,18 @@ run_ctm_tests_for_pipe(data_t *data, enum pipe p,
 		 * for odd number of items in the LUTs.
 		 */
 		for (i = 0; i < iter; i++) {
-			float c = ctm[0] + delta * (i - (iter / 2));
-			color_t expected_colors_local[] = {
-				{ .r = c, },
-				{ .g = c, },
-				{ .b = c, },
+			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_local, ctm)) {
+					  expected_colors, ctm)) {
 				success = true;
 				break;
 			}
@@ -953,17 +963,11 @@ run_tests_for_pipe(data_t *data)
 		const char *name;
 		int iter;
 		const color_t *fb_colors;
-		color_t colors[3];
 		double ctm[9];
 		const char *desc;
 	} ctm_tests[] = {
 		{ .name = "ctm-red-to-blue",
 		  .fb_colors = colors_rgb,
-		  .colors = {
-			  { 0.0, 0.0, 1.0 },
-			  { 0.0, 1.0, 0.0 },
-			  { 0.0, 0.0, 1.0 },
-		  },
 		  .ctm = {
 			  0.0, 0.0, 0.0,
 			  0.0, 1.0, 0.0,
@@ -973,11 +977,6 @@ run_tests_for_pipe(data_t *data)
 		},
 		{ .name = "ctm-green-to-red",
 		  .fb_colors = colors_rgb,
-		  .colors = {
-			  { 1.0, 0.0, 0.0 },
-			  { 1.0, 0.0, 0.0 },
-			  { 0.0, 0.0, 1.0 },
-		  },
 		  .ctm = {
 			  1.0, 1.0, 0.0,
 			  0.0, 0.0, 0.0,
@@ -987,11 +986,6 @@ run_tests_for_pipe(data_t *data)
 		},
 		{ .name = "ctm-blue-to-red",
 		  .fb_colors = colors_rgb,
-		  .colors = {
-			  { 1.0, 0.0, 0.0 },
-			  { 0.0, 1.0, 0.0 },
-			  { 1.0, 0.0, 0.0 },
-		  },
 		  .ctm = {
 			  1.0, 0.0, 1.0,
 			  0.0, 1.0, 0.0,
@@ -1001,11 +995,6 @@ run_tests_for_pipe(data_t *data)
 		},
 		{ .name = "ctm-max",
 		  .fb_colors = colors_rgb,
-		  .colors = {
-			  { 1.0, 0.0, 0.0 },
-			  { 0.0, 1.0, 0.0 },
-			  { 0.0, 0.0, 1.0 },
-		  },
 		  .ctm = { 100.0, 0.0, 0.0,
 			  0.0, 100.0, 0.0,
 			  0.0, 0.0, 100.0,
@@ -1014,11 +1003,6 @@ run_tests_for_pipe(data_t *data)
 		},
 		{ .name = "ctm-negative",
 		  .fb_colors = colors_rgb,
-		  .colors = {
-			  { 0.0, 0.0, 0.0 },
-			  { 0.0, 0.0, 0.0 },
-			  { 0.0, 0.0, 0.0 },
-		  },
 		  .ctm = {
 			  -1.0,  0.0,  0.0,
 			   0.0, -1.0,  0.0,
@@ -1075,7 +1059,6 @@ run_tests_for_pipe(data_t *data)
 			for_each_pipe(&data->display, pipe) {
 				run_ctm_tests_for_pipe(data, pipe,
 						       ctm_tests[i].fb_colors,
-						       ctm_tests[i].colors,
 						       ctm_tests[i].ctm,
 						       ctm_tests[i].iter);
 			}
-- 
2.39.2

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

* [igt-dev] [PATCH i-g-t v2 6/9] tests/kms_color: Add and additional "signed" subtest
  2023-04-11 16:15 [igt-dev] [PATCH i-g-t v2 0/9] tests/kms_color: Improve CTM tests Ville Syrjala
                   ` (4 preceding siblings ...)
  2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 5/9] tests/kms_color: Get rid of hand coded "expected_colors" Ville Syrjala
@ 2023-04-11 16:15 ` Ville Syrjala
  2023-05-04 21:43   ` Shankar, Uma
  2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 7/9] tests/kms_color: Dump the CTM before/after color values Ville Syrjala
                   ` (3 subsequent siblings)
  9 siblings, 1 reply; 19+ messages in thread
From: Ville Syrjala @ 2023-04-11 16:15 UTC (permalink / raw)
  To: igt-dev

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

i915 CHV CSC code has a bug where it treats the hardware
CSC coefficient as sign-magnitude instead of the two's
complement value that it is. None of the current tests
manage to notice this.

Add a testcase that uses suitable negative coefficients
to catch the issue. With CHV's s4.12 coefficients the
-0.25 ends up as -7.75 and the results won't match.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/kms_color.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/tests/kms_color.c b/tests/kms_color.c
index d430ee12aaa3..35083122dfbf 100644
--- a/tests/kms_color.c
+++ b/tests/kms_color.c
@@ -959,6 +959,11 @@ run_tests_for_pipe(data_t *data)
 		{ 0.0, 1.0, 0.0 },
 		{ 0.0, 0.0, 1.0 },
 	};
+	static const color_t colors_cmy[] = {
+		{ 0.0, 1.0, 1.0 },
+		{ 1.0, 0.0, 1.0 },
+		{ 1.0, 1.0, 0.0 }
+	};
 	static const struct {
 		const char *name;
 		int iter;
@@ -1040,6 +1045,16 @@ run_tests_for_pipe(data_t *data)
 		  },
 		  .desc = "Check the color transformation for 0.75 transparency",
 		},
+		{ .name = "ctm-signed",
+		  .fb_colors = colors_cmy,
+		  .iter = 3,
+		  .ctm = {
+			  -0.25,  0.75,  0.75,
+			   0.75, -0.25,  0.75,
+			   0.75,  0.75, -0.25,
+		  },
+		  .desc = "Check the color transformation for correct signed handling",
+		},
 	};
 	int i;
 
-- 
2.39.2

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

* [igt-dev] [PATCH i-g-t v2 7/9] tests/kms_color: Dump the CTM before/after color values
  2023-04-11 16:15 [igt-dev] [PATCH i-g-t v2 0/9] tests/kms_color: Improve CTM tests Ville Syrjala
                   ` (5 preceding siblings ...)
  2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 6/9] tests/kms_color: Add and additional "signed" subtest Ville Syrjala
@ 2023-04-11 16:15 ` Ville Syrjala
  2023-05-04 21:44   ` Shankar, Uma
  2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 8/9] tests/kms_color: Move dynamic subtests up one level Ville Syrjala
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 19+ messages in thread
From: Ville Syrjala @ 2023-04-11 16:15 UTC (permalink / raw)
  To: igt-dev

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Include the before/after color values in the debug output
to help with diagnosing failures.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/kms_color.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tests/kms_color.c b/tests/kms_color.c
index 35083122dfbf..1ec097953c9d 100644
--- a/tests/kms_color.c
+++ b/tests/kms_color.c
@@ -511,6 +511,14 @@ static bool test_pipe_ctm(data_t *data,
 		set_gamma(data, primary->pipe, gamma_linear);
 	}
 
+	igt_debug("color before[0] %f,%f,%f\n", before[0].r, before[0].g, before[0].b);
+	igt_debug("color before[1] %f,%f,%f\n", before[1].r, before[1].g, before[1].b);
+	igt_debug("color before[2] %f,%f,%f\n", before[2].r, before[2].g, before[2].b);
+
+	igt_debug("color after[0] %f,%f,%f\n", after[0].r, after[0].g, after[0].b);
+	igt_debug("color after[1] %f,%f,%f\n", after[1].r, after[1].g, after[1].b);
+	igt_debug("color after[2] %f,%f,%f\n", after[2].r, after[2].g, after[2].b);
+
 	disable_ctm(primary->pipe);
 	igt_display_commit(&data->display);
 
-- 
2.39.2

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

* [igt-dev] [PATCH i-g-t v2 8/9] tests/kms_color: Move dynamic subtests up one level
  2023-04-11 16:15 [igt-dev] [PATCH i-g-t v2 0/9] tests/kms_color: Improve CTM tests Ville Syrjala
                   ` (6 preceding siblings ...)
  2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 7/9] tests/kms_color: Dump the CTM before/after color values Ville Syrjala
@ 2023-04-11 16:15 ` Ville Syrjala
  2023-05-04 21:46   ` Shankar, Uma
  2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 9/9] tests/intel-ci/fast-feedback: Run ctm tests Ville Syrjala
  2023-04-11 17:51 ` [igt-dev] ✗ Fi.CI.BAT: failure for tests/kms_color: Improve CTM tests (rev2) Patchwork
  9 siblings, 1 reply; 19+ messages in thread
From: Ville Syrjala @ 2023-04-11 16:15 UTC (permalink / raw)
  To: igt-dev

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Move the igt_dynamic_f() up one level so that the whole subtests
doesn't skip if some pipe is missing a suitable output. We want
to skip only the dynamic subtest.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/kms_color.c | 76 +++++++++++++++++++++++------------------------
 1 file changed, 38 insertions(+), 38 deletions(-)

diff --git a/tests/kms_color.c b/tests/kms_color.c
index 1ec097953c9d..e35dccea1a61 100644
--- a/tests/kms_color.c
+++ b/tests/kms_color.c
@@ -736,8 +736,7 @@ run_gamma_degamma_tests_for_pipe(data_t *data, enum pipe p,
 	if (!pipe_output_combo_valid(data, p))
 		goto out;
 
-	igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(p), data->output->name)
-		igt_assert(test_t(data, data->primary));
+	igt_assert(test_t(data, data->primary));
 
 out:
 	test_cleanup(data);
@@ -758,7 +757,9 @@ run_ctm_tests_for_pipe(data_t *data, enum pipe p,
 		       const double *ctm,
 		       int iter)
 {
+	bool success = false;
 	double delta;
+	int i;
 
 	test_setup(data, p);
 
@@ -777,35 +778,30 @@ run_ctm_tests_for_pipe(data_t *data, enum pipe p,
 	if (!iter)
 		iter = 1;
 
-	igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(p), data->output->name) {
-		bool success = false;
-		int i;
-
-		/*
-		 * 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;
-			}
+	/*
+	 * 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);
@@ -927,10 +923,10 @@ 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) {
-				prep_pipe(data, pipe);
-
-				igt_dynamic_f("pipe-%s", kmstest_pipe_name(pipe))
+				igt_dynamic_f("pipe-%s", kmstest_pipe_name(pipe)) {
+					prep_pipe(data, pipe);
 					tests[i].test_t(data, pipe);
+				}
 			}
 		}
 	}
@@ -1070,8 +1066,10 @@ 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) {
-				run_gamma_degamma_tests_for_pipe(data, pipe,
-								 gamma_degamma_tests[i].test_t);
+				igt_dynamic_f("pipe-%s", kmstest_pipe_name(pipe)) {
+					run_gamma_degamma_tests_for_pipe(data, pipe,
+									 gamma_degamma_tests[i].test_t);
+				}
 			}
 		}
 	}
@@ -1080,10 +1078,12 @@ 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) {
-				run_ctm_tests_for_pipe(data, pipe,
-						       ctm_tests[i].fb_colors,
-						       ctm_tests[i].ctm,
-						       ctm_tests[i].iter);
+				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);
+				}
 			}
 		}
 	}
-- 
2.39.2

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

* [igt-dev] [PATCH i-g-t v2 9/9] tests/intel-ci/fast-feedback: Run ctm tests
  2023-04-11 16:15 [igt-dev] [PATCH i-g-t v2 0/9] tests/kms_color: Improve CTM tests Ville Syrjala
                   ` (7 preceding siblings ...)
  2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 8/9] tests/kms_color: Move dynamic subtests up one level Ville Syrjala
@ 2023-04-11 16:15 ` Ville Syrjala
  2023-04-11 17:51 ` [igt-dev] ✗ Fi.CI.BAT: failure for tests/kms_color: Improve CTM tests (rev2) Patchwork
  9 siblings, 0 replies; 19+ messages in thread
From: Ville Syrjala @ 2023-04-11 16:15 UTC (permalink / raw)
  To: igt-dev

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

---
 tests/intel-ci/fast-feedback.testlist | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tests/intel-ci/fast-feedback.testlist b/tests/intel-ci/fast-feedback.testlist
index d9fcb62d6e78..33e825772c96 100644
--- a/tests/intel-ci/fast-feedback.testlist
+++ b/tests/intel-ci/fast-feedback.testlist
@@ -181,3 +181,14 @@ igt@gem_exec_suspend@basic-s0
 igt@gem_exec_suspend@basic-s3
 igt@kms_chamelium_hpd@common-hpd-after-suspend
 igt@kms_pipe_crc_basic@suspend-read-crc
+
+igt@kms_color@ctm-red-to-blue
+igt@kms_color@ctm-green-to-red
+igt@kms_color@ctm-blue-to-red
+igt@kms_color@ctm-max
+igt@kms_color@ctm-negative
+igt@kms_color@ctm-0-25
+igt@kms_color@ctm-0-50
+igt@kms_color@ctm-0-75
+igt@kms_color@ctm-signed
+igt@kms_color@invalid-ctm-matrix-sizes
-- 
2.39.2

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

* [igt-dev] ✗ Fi.CI.BAT: failure for tests/kms_color: Improve CTM tests (rev2)
  2023-04-11 16:15 [igt-dev] [PATCH i-g-t v2 0/9] tests/kms_color: Improve CTM tests Ville Syrjala
                   ` (8 preceding siblings ...)
  2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 9/9] tests/intel-ci/fast-feedback: Run ctm tests Ville Syrjala
@ 2023-04-11 17:51 ` Patchwork
  9 siblings, 0 replies; 19+ messages in thread
From: Patchwork @ 2023-04-11 17:51 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: igt-dev

[-- Attachment #1: Type: text/plain, Size: 12630 bytes --]

== Series Details ==

Series: tests/kms_color: Improve CTM tests (rev2)
URL   : https://patchwork.freedesktop.org/series/116300/
State : failure

== Summary ==

CI Bug Log - changes from IGT_7250 -> IGTPW_8780
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with IGTPW_8780 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_8780, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8780/index.html

Participating hosts (36 -> 35)
------------------------------

  Missing    (1): fi-snb-2520m 

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in IGTPW_8780:

### IGT changes ###

#### Possible regressions ####

  * igt@kms_color@ctm-max@pipe-b (NEW):
    - bat-dg1-7:          NOTRUN -> [SKIP][1] +35 similar issues
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8780/bat-dg1-7/igt@kms_color@ctm-max@pipe-b.html

  * igt@kms_color@ctm-max@pipe-c (NEW):
    - fi-bsw-n3050:       NOTRUN -> [DMESG-WARN][2] +6 similar issues
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8780/fi-bsw-n3050/igt@kms_color@ctm-max@pipe-c.html

  * {igt@kms_color@ctm-signed@pipe-c} (NEW):
    - fi-bsw-n3050:       NOTRUN -> [DMESG-FAIL][3]
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8780/fi-bsw-n3050/igt@kms_color@ctm-signed@pipe-c.html

  
New tests
---------

  New tests have been introduced between IGT_7250 and IGTPW_8780:

### New IGT tests (37) ###

  * igt@kms_color@ctm-0-25@pipe-a:
    - Statuses : 21 pass(s) 9 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-0-25@pipe-b:
    - Statuses : 21 pass(s) 9 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-0-25@pipe-c:
    - Statuses : 1 dmesg-warn(s) 21 pass(s) 6 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-0-25@pipe-d:
    - Statuses : 7 pass(s) 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-0-50@pipe-a:
    - Statuses : 21 pass(s) 9 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-0-50@pipe-b:
    - Statuses : 21 pass(s) 9 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-0-50@pipe-c:
    - Statuses : 1 dmesg-warn(s) 21 pass(s) 6 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-0-50@pipe-d:
    - Statuses : 7 pass(s) 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-0-75@pipe-a:
    - Statuses : 21 pass(s) 9 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-0-75@pipe-b:
    - Statuses : 21 pass(s) 9 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-0-75@pipe-c:
    - Statuses : 1 dmesg-warn(s) 21 pass(s) 6 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-0-75@pipe-d:
    - Statuses : 7 pass(s) 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-blue-to-red@pipe-a:
    - Statuses : 21 pass(s) 9 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-blue-to-red@pipe-b:
    - Statuses : 21 pass(s) 9 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-blue-to-red@pipe-c:
    - Statuses : 1 dmesg-warn(s) 21 pass(s) 6 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-blue-to-red@pipe-d:
    - Statuses : 7 pass(s) 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-green-to-red@pipe-a:
    - Statuses : 21 pass(s) 9 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-green-to-red@pipe-b:
    - Statuses : 21 pass(s) 9 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-green-to-red@pipe-c:
    - Statuses : 1 dmesg-warn(s) 21 pass(s) 6 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-green-to-red@pipe-d:
    - Statuses : 7 pass(s) 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-max@pipe-a:
    - Statuses : 21 pass(s) 9 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-max@pipe-b:
    - Statuses : 21 pass(s) 9 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-max@pipe-c:
    - Statuses : 1 dmesg-warn(s) 21 pass(s) 6 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-max@pipe-d:
    - Statuses : 7 pass(s) 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-negative@pipe-a:
    - Statuses : 21 pass(s) 9 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-negative@pipe-b:
    - Statuses : 21 pass(s) 9 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-negative@pipe-c:
    - Statuses : 1 dmesg-warn(s) 21 pass(s) 6 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-negative@pipe-d:
    - Statuses : 7 pass(s) 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-red-to-blue@pipe-a:
    - Statuses : 21 pass(s) 9 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-red-to-blue@pipe-b:
    - Statuses : 21 pass(s) 9 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-red-to-blue@pipe-c:
    - Statuses : 22 pass(s) 6 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-red-to-blue@pipe-d:
    - Statuses : 7 pass(s) 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-signed:
    - Statuses : 1 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-signed@pipe-a:
    - Statuses : 21 pass(s) 9 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-signed@pipe-b:
    - Statuses : 21 pass(s) 9 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-signed@pipe-c:
    - Statuses : 1 dmesg-fail(s) 21 pass(s) 6 skip(s)
    - Exec time: [0.0] s

  * igt@kms_color@ctm-signed@pipe-d:
    - Statuses : 7 pass(s) 1 skip(s)
    - Exec time: [0.0] s

  

Known issues
------------

  Here are the changes found in IGTPW_8780 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_suspend@basic-s0@lmem0:
    - bat-dg2-11:         [PASS][4] -> [INCOMPLETE][5] ([i915#6311])
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7250/bat-dg2-11/igt@gem_exec_suspend@basic-s0@lmem0.html
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8780/bat-dg2-11/igt@gem_exec_suspend@basic-s0@lmem0.html

  * igt@gem_exec_suspend@basic-s3@smem:
    - bat-rpls-1:         NOTRUN -> [ABORT][6] ([i915#6687] / [i915#7978])
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8780/bat-rpls-1/igt@gem_exec_suspend@basic-s3@smem.html

  * igt@i915_selftest@live@migrate:
    - bat-adlp-9:         [PASS][7] -> [DMESG-FAIL][8] ([i915#7699])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7250/bat-adlp-9/igt@i915_selftest@live@migrate.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8780/bat-adlp-9/igt@i915_selftest@live@migrate.html
    - bat-dg2-11:         [PASS][9] -> [DMESG-WARN][10] ([i915#7699])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7250/bat-dg2-11/igt@i915_selftest@live@migrate.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8780/bat-dg2-11/igt@i915_selftest@live@migrate.html

  * igt@i915_selftest@live@slpc:
    - bat-rpls-1:         NOTRUN -> [DMESG-FAIL][11] ([i915#6367])
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8780/bat-rpls-1/igt@i915_selftest@live@slpc.html

  * igt@kms_chamelium_hpd@common-hpd-after-suspend:
    - bat-rplp-1:         NOTRUN -> [SKIP][12] ([i915#7828])
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8780/bat-rplp-1/igt@kms_chamelium_hpd@common-hpd-after-suspend.html
    - bat-dg1-7:          NOTRUN -> [SKIP][13] ([i915#7828])
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8780/bat-dg1-7/igt@kms_chamelium_hpd@common-hpd-after-suspend.html

  * igt@kms_color@ctm-0-25:
    - bat-atsm-1:         NOTRUN -> [SKIP][14] ([i915#6078]) +9 similar issues
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8780/bat-atsm-1/igt@kms_color@ctm-0-25.html

  * igt@kms_color@ctm-0-25@pipe-b (NEW):
    - {bat-kbl-2}:        NOTRUN -> [SKIP][15] ([fdo#109271]) +26 similar issues
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8780/bat-kbl-2/igt@kms_color@ctm-0-25@pipe-b.html

  * igt@kms_color@ctm-0-50@pipe-b (NEW):
    - fi-bsw-n3050:       NOTRUN -> [SKIP][16] ([fdo#109271]) +17 similar issues
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8780/fi-bsw-n3050/igt@kms_color@ctm-0-50@pipe-b.html

  * igt@kms_color@ctm-blue-to-red@pipe-c (NEW):
    - fi-bsw-nick:        NOTRUN -> [SKIP][17] ([fdo#109271]) +26 similar issues
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8780/fi-bsw-nick/igt@kms_color@ctm-blue-to-red@pipe-c.html
    - fi-kbl-guc:         NOTRUN -> [SKIP][18] ([fdo#109271]) +26 similar issues
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8780/fi-kbl-guc/igt@kms_color@ctm-blue-to-red@pipe-c.html

  * igt@kms_color@ctm-green-to-red@pipe-b (NEW):
    - fi-ilk-650:         NOTRUN -> [SKIP][19] ([fdo#109271]) +19 similar issues
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8780/fi-ilk-650/igt@kms_color@ctm-green-to-red@pipe-b.html

  * igt@kms_color@ctm-green-to-red@pipe-c (NEW):
    - fi-kbl-8809g:       NOTRUN -> [SKIP][20] ([fdo#109271]) +26 similar issues
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8780/fi-kbl-8809g/igt@kms_color@ctm-green-to-red@pipe-c.html

  * {igt@kms_color@ctm-signed@pipe-a} (NEW):
    - fi-kbl-x1275:       NOTRUN -> [SKIP][21] ([fdo#109271]) +26 similar issues
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8780/fi-kbl-x1275/igt@kms_color@ctm-signed@pipe-a.html

  * {igt@kms_color@ctm-signed@pipe-b} (NEW):
    - fi-elk-e7500:       NOTRUN -> [SKIP][22] ([fdo#109271]) +19 similar issues
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8780/fi-elk-e7500/igt@kms_color@ctm-signed@pipe-b.html

  * igt@kms_pipe_crc_basic@read-crc:
    - bat-dg2-11:         NOTRUN -> [SKIP][23] ([i915#5354])
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8780/bat-dg2-11/igt@kms_pipe_crc_basic@read-crc.html

  * igt@kms_pipe_crc_basic@suspend-read-crc:
    - bat-dg1-7:          NOTRUN -> [SKIP][24] ([i915#1845] / [i915#4078])
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8780/bat-dg1-7/igt@kms_pipe_crc_basic@suspend-read-crc.html

  
#### Possible fixes ####

  * igt@i915_selftest@live@hangcheck:
    - bat-dg1-7:          [ABORT][25] ([i915#4983]) -> [PASS][26]
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7250/bat-dg1-7/igt@i915_selftest@live@hangcheck.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8780/bat-dg1-7/igt@i915_selftest@live@hangcheck.html

  * igt@i915_selftest@live@requests:
    - bat-rplp-1:         [ABORT][27] ([i915#7913]) -> [PASS][28]
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7250/bat-rplp-1/igt@i915_selftest@live@requests.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8780/bat-rplp-1/igt@i915_selftest@live@requests.html

  * igt@i915_selftest@live@reset:
    - bat-rpls-1:         [ABORT][29] ([i915#4983]) -> [PASS][30]
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_7250/bat-rpls-1/igt@i915_selftest@live@reset.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8780/bat-rpls-1/igt@i915_selftest@live@reset.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
  [i915#4078]: https://gitlab.freedesktop.org/drm/intel/issues/4078
  [i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
  [i915#5354]: https://gitlab.freedesktop.org/drm/intel/issues/5354
  [i915#6078]: https://gitlab.freedesktop.org/drm/intel/issues/6078
  [i915#6311]: https://gitlab.freedesktop.org/drm/intel/issues/6311
  [i915#6367]: https://gitlab.freedesktop.org/drm/intel/issues/6367
  [i915#6687]: https://gitlab.freedesktop.org/drm/intel/issues/6687
  [i915#7699]: https://gitlab.freedesktop.org/drm/intel/issues/7699
  [i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
  [i915#7913]: https://gitlab.freedesktop.org/drm/intel/issues/7913
  [i915#7978]: https://gitlab.freedesktop.org/drm/intel/issues/7978


Build changes
-------------

  * CI: CI-20190529 -> None
  * IGT: IGT_7250 -> IGTPW_8780

  CI-20190529: 20190529
  CI_DRM_12990: 43444a1de6ae4f1258bc1cf677558de3c582a93d @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_8780: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8780/index.html
  IGT_7250: 2da179d399d83a6859a89176d83b7ec1d71fe27a @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git


Testlist changes
----------------

+igt@kms_color@ctm-signed

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8780/index.html

[-- Attachment #2: Type: text/html, Size: 15638 bytes --]

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

* Re: [igt-dev] [PATCH i-g-t v2 1/9] tests/kms_color: Use legacy LUT for chopping off the lsbs
  2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 1/9] tests/kms_color: Use legacy LUT for chopping off the lsbs Ville Syrjala
@ 2023-05-04 21:21   ` Shankar, Uma
  0 siblings, 0 replies; 19+ messages in thread
From: Shankar, Uma @ 2023-05-04 21:21 UTC (permalink / raw)
  To: Ville Syrjala, igt-dev@lists.freedesktop.org



> -----Original Message-----
> From: igt-dev <igt-dev-bounces@lists.freedesktop.org> On Behalf Of Ville Syrjala
> Sent: Tuesday, April 11, 2023 9:46 PM
> To: igt-dev@lists.freedesktop.org
> Subject: [igt-dev] [PATCH i-g-t v2 1/9] tests/kms_color: Use legacy LUT for chopping
> off the lsbs
> 
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Trying to use an interpolated gamma mode (as is the case currently on eg. icl/tgl) for
> chopping off the lsbs doesn't really work. Use the legacy LUT instead. Also get rid of
> the degamma LUT as that can't even be enabled alognside the legacy LUT on split
> gamma i915 platforms (ivb-skl).

Looks Good to me.
Reviewed-by: Uma Shankar <uma.shankar@intel.com>

> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  tests/kms_color.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/tests/kms_color.c b/tests/kms_color.c index
> cd03c1354c0a..369dc8057d83 100644
> --- a/tests/kms_color.c
> +++ b/tests/kms_color.c
> @@ -504,13 +504,10 @@ static bool test_pipe_ctm(data_t *data,
>  	 * rounding issues and inaccuracies leading to crc mismatch.
>  	 */
>  	if (is_i915_device(data->drm_fd) && memcmp(before, after,
> sizeof(color_t))) {
> -		igt_require(igt_pipe_obj_has_prop(primary->pipe,
> IGT_CRTC_DEGAMMA_LUT));
>  		igt_require(igt_pipe_obj_has_prop(primary->pipe,
> IGT_CRTC_GAMMA_LUT));
> 
> -		degamma_linear = generate_table(data->degamma_lut_size, 1.0);
> -		gamma_linear = generate_table(data->gamma_lut_size, 1.0);
> +		gamma_linear = generate_table(256, 1.0);
> 
> -		set_degamma(data, primary->pipe, degamma_linear);
>  		set_gamma(data, primary->pipe, gamma_linear);
>  	}
> 
> --
> 2.39.2


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

* Re: [igt-dev] [PATCH i-g-t v2 2/9] tests/kms_color: Use named initializers
  2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 2/9] tests/kms_color: Use named initializers Ville Syrjala
@ 2023-05-04 21:23   ` Shankar, Uma
  0 siblings, 0 replies; 19+ messages in thread
From: Shankar, Uma @ 2023-05-04 21:23 UTC (permalink / raw)
  To: Ville Syrjala, igt-dev@lists.freedesktop.org



> -----Original Message-----
> From: igt-dev <igt-dev-bounces@lists.freedesktop.org> On Behalf Of Ville Syrjala
> Sent: Tuesday, April 11, 2023 9:46 PM
> To: igt-dev@lists.freedesktop.org
> Subject: [igt-dev] [PATCH i-g-t v2 2/9] tests/kms_color: Use named initializers
> 
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Use named initializers to make it actually possible to figure out what is happening.
> And sprinkle some missing commas around while at it.

Looks Good to me.
Reviewed-by: Uma Shankar <uma.shankar@intel.com>

> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  tests/kms_color.c | 202 +++++++++++++++++++++++++++-------------------
>  1 file changed, 118 insertions(+), 84 deletions(-)
> 
> diff --git a/tests/kms_color.c b/tests/kms_color.c index
> 369dc8057d83..84a8eabe5484 100644
> --- a/tests/kms_color.c
> +++ b/tests/kms_color.c
> @@ -35,7 +35,7 @@ static bool test_pipe_degamma(data_t *data,
>  	color_t red_green_blue[] = {
>  		{ 1.0, 0.0, 0.0 },
>  		{ 0.0, 1.0, 0.0 },
> -		{ 0.0, 0.0, 1.0 }
> +		{ 0.0, 0.0, 1.0 },
>  	};
>  	drmModeModeInfo *mode = data->mode;
>  	struct igt_fb fb_modeset, fb;
> @@ -127,7 +127,7 @@ static bool test_pipe_gamma(data_t *data,
>  	color_t red_green_blue[] = {
>  		{ 1.0, 0.0, 0.0 },
>  		{ 0.0, 1.0, 0.0 },
> -		{ 0.0, 0.0, 1.0 }
> +		{ 0.0, 0.0, 1.0 },
>  	};
>  	drmModeModeInfo *mode = data->mode;
>  	struct igt_fb fb_modeset, fb;
> @@ -215,7 +215,7 @@ static bool test_pipe_legacy_gamma(data_t *data,
>  	color_t red_green_blue[] = {
>  		{ 1.0, 0.0, 0.0 },
>  		{ 0.0, 1.0, 0.0 },
> -		{ 0.0, 0.0, 1.0 }
> +		{ 0.0, 0.0, 1.0 },
>  	};
>  	drmModeCrtc *kms_crtc;
>  	uint32_t i, legacy_lut_size;
> @@ -324,7 +324,7 @@ static bool test_pipe_legacy_gamma_reset(data_t *data,
>  	const double ctm_identity[] = {
>  		1.0, 0.0, 0.0,
>  		0.0, 1.0, 0.0,
> -		0.0, 0.0, 1.0
> +		0.0, 0.0, 1.0,
>  	};
>  	drmModeCrtc *kms_crtc;
>  	gamma_lut_t *degamma_linear = NULL, *gamma_zero; @@ -461,7 +461,7
> @@ static bool test_pipe_ctm(data_t *data,
>  	const double ctm_identity[] = {
>  		1.0, 0.0, 0.0,
>  		0.0, 1.0, 0.0,
> -		0.0, 0.0, 1.0
> +		0.0, 0.0, 1.0,
>  	};
>  	gamma_lut_t *degamma_linear = NULL, *gamma_linear = NULL;
>  	igt_output_t *output = data->output;
> @@ -569,16 +569,18 @@ static void test_pipe_limited_range_ctm(data_t *data,
>  	color_t red_green_blue_limited[] = {
>  		{ limited_result, 0.0, 0.0 },
>  		{ 0.0, limited_result, 0.0 },
> -		{ 0.0, 0.0, limited_result }
> +		{ 0.0, 0.0, limited_result },
>  	};
>  	color_t red_green_blue_full[] = {
>  		{ 0.5, 0.0, 0.0 },
>  		{ 0.0, 0.5, 0.0 },
> -		{ 0.0, 0.0, 0.5 }
> +		{ 0.0, 0.0, 0.5 },
> +	};
> +	double ctm[] = {
> +		1.0, 0.0, 0.0,
> +		0.0, 1.0, 0.0,
> +		0.0, 0.0, 1.0,
>  	};
> -	double ctm[] = { 1.0, 0.0, 0.0,
> -			0.0, 1.0, 0.0,
> -			0.0, 0.0, 1.0 };
>  	gamma_lut_t *degamma_linear, *gamma_linear;
>  	igt_output_t *output;
>  	bool has_broadcast_rgb_output = false; @@ -743,7 +745,7 @@
> run_ctm_tests_for_pipe(data_t *data, enum pipe p,
>  	color_t red_green_blue[] = {
>  		{ 1.0, 0.0, 0.0 },
>  		{ 0.0, 1.0, 0.0 },
> -		{ 0.0, 0.0, 1.0 }
> +		{ 0.0, 0.0, 1.0 },
>  	};
> 
>  	test_setup(data, p);
> @@ -799,16 +801,18 @@ run_deep_color_tests_for_pipe(data_t *data, enum pipe
> p)
>  	color_t blue_green_blue[] = {
>  		{ 0.0, 0.0, 1.0 },
>  		{ 0.0, 1.0, 0.0 },
> -		{ 0.0, 0.0, 1.0 }
> +		{ 0.0, 0.0, 1.0 },
>  	};
>  	color_t red_green_blue[] = {
>  		{ 1.0, 0.0, 0.0 },
>  		{ 0.0, 1.0, 0.0 },
>  		{ 0.0, 0.0, 1.0 }
>  	};
> -	double ctm[] = { 0.0, 0.0, 0.0,
> -			 0.0, 1.0, 0.0,
> -			 1.0, 0.0, 1.0 };
> +	double ctm[] = {
> +		0.0, 0.0, 0.0,
> +		0.0, 1.0, 0.0,
> +		1.0, 0.0, 1.0,
> +	};
> 
>  	if (is_i915_device(data->drm_fd))
>  		igt_require_f((intel_display_ver(data->devid) >= 11), @@ -924,17
> +928,22 @@ run_tests_for_pipe(data_t *data)
>  		bool (*test_t)(data_t*, igt_plane_t*);
>  		const char *desc;
>  	} gamma_degamma_tests[] = {
> -		{ "degamma", test_pipe_degamma,
> -		  "Verify that degamma LUT transformation works correctly" },
> -
> -		{ "gamma", test_pipe_gamma,
> -		  "Verify that gamma LUT transformation works correctly" },
> -
> -		{ "legacy-gamma", test_pipe_legacy_gamma,
> -		  "Verify that legacy gamma LUT transformation works correctly" },
> -
> -		{ "legacy-gamma-reset", test_pipe_legacy_gamma_reset,
> -		  "Verify that setting the legacy gamma LUT resets the gamma LUT
> set through GAMMA_LUT property" },
> +		{ .name = "degamma",
> +		  .test_t = test_pipe_degamma,
> +		  .desc = "Verify that degamma LUT transformation works
> correctly",
> +		},
> +		{ .name = "gamma",
> +		  .test_t = test_pipe_gamma,
> +		  .desc = "Verify that gamma LUT transformation works correctly",
> +		},
> +		{ .name = "legacy-gamma",
> +		  .test_t = test_pipe_legacy_gamma,
> +		  .desc = "Verify that legacy gamma LUT transformation works
> correctly",
> +		},
> +		{ .name = "legacy-gamma-reset",
> +		  .test_t = test_pipe_legacy_gamma_reset,
> +		  .desc = "Verify that setting the legacy gamma LUT resets the
> gamma LUT set through GAMMA_LUT property",
> +		},
>  	};
>  	struct {
>  		const char *name;
> @@ -943,71 +952,96 @@ run_tests_for_pipe(data_t *data)
>  		double ctm[9];
>  		const char *desc;
>  	} ctm_tests[] = {
> -		{ "ctm-red-to-blue", 0,
> -			{{ 0.0, 0.0, 1.0 },
> -			 { 0.0, 1.0, 0.0 },
> -			 { 0.0, 0.0, 1.0 }},
> -		  { 0.0, 0.0, 0.0,
> -		    0.0, 1.0, 0.0,
> -		    1.0, 0.0, 1.0 },
> -		  "Check the color transformation from red to blue"
> +		{ .name = "ctm-red-to-blue",
> +		  .colors = {
> +			  { 0.0, 0.0, 1.0 },
> +			  { 0.0, 1.0, 0.0 },
> +			  { 0.0, 0.0, 1.0 },
> +		  },
> +		  .ctm = {
> +			  0.0, 0.0, 0.0,
> +			  0.0, 1.0, 0.0,
> +			  1.0, 0.0, 1.0,
> +		  },
> +		  .desc = "Check the color transformation from red to blue",
>  		},
> -		{ "ctm-green-to-red", 0,
> -			{{ 1.0, 0.0, 0.0 },
> -			 { 1.0, 0.0, 0.0 },
> -			 { 0.0, 0.0, 1.0 }},
> -		  { 1.0, 1.0, 0.0,
> -		    0.0, 0.0, 0.0,
> -		    0.0, 0.0, 1.0 },
> -		  "Check the color transformation from green to red"
> +		{ .name = "ctm-green-to-red",
> +		  .colors = {
> +			  { 1.0, 0.0, 0.0 },
> +			  { 1.0, 0.0, 0.0 },
> +			  { 0.0, 0.0, 1.0 },
> +		  },
> +		  .ctm = {
> +			  1.0, 1.0, 0.0,
> +			  0.0, 0.0, 0.0,
> +			  0.0, 0.0, 1.0,
> +		  },
> +		  .desc = "Check the color transformation from green to red",
>  		},
> -		{ "ctm-blue-to-red", 0,
> -			{{ 1.0, 0.0, 0.0 },
> -			 { 0.0, 1.0, 0.0 },
> -			 { 1.0, 0.0, 0.0 }},
> -		  { 1.0, 0.0, 1.0,
> -		    0.0, 1.0, 0.0,
> -		    0.0, 0.0, 0.0 },
> -		  "Check the color transformation from blue to red"
> +		{ .name = "ctm-blue-to-red",
> +		  .colors = {
> +			  { 1.0, 0.0, 0.0 },
> +			  { 0.0, 1.0, 0.0 },
> +			  { 1.0, 0.0, 0.0 },
> +		  },
> +		  .ctm = {
> +			  1.0, 0.0, 1.0,
> +			  0.0, 1.0, 0.0,
> +			  0.0, 0.0, 0.0,
> +		  },
> +		  .desc = "Check the color transformation from blue to red",
>  		},
> -		{ "ctm-max", 0,
> -			{{ 1.0, 0.0, 0.0 },
> -			 { 0.0, 1.0, 0.0 },
> -			 { 0.0, 0.0, 1.0 }},
> -		  { 100.0, 0.0, 0.0,
> -		    0.0, 100.0, 0.0,
> -		    0.0, 0.0, 100.0 },
> -		  "Check the color transformation for maximum transparency"
> +		{ .name = "ctm-max",
> +		  .colors = {
> +			  { 1.0, 0.0, 0.0 },
> +			  { 0.0, 1.0, 0.0 },
> +			  { 0.0, 0.0, 1.0 },
> +		  },
> +		  .ctm = { 100.0, 0.0, 0.0,
> +			  0.0, 100.0, 0.0,
> +			  0.0, 0.0, 100.0,
> +		  },
> +		  .desc = "Check the color transformation for maximum
> transparency",
>  		},
> -		{ "ctm-negative", 0,
> -			{{ 0.0, 0.0, 0.0 },
> -			 { 0.0, 0.0, 0.0 },
> -			 { 0.0, 0.0, 0.0 }},
> -		  { -1.0, 0.0, 0.0,
> -		    0.0, -1.0, 0.0,
> -		    0.0, 0.0, -1.0 },
> -		  "Check the color transformation for negative transparency"
> +		{ .name = "ctm-negative",
> +		  .colors = {
> +			  { 0.0, 0.0, 0.0 },
> +			  { 0.0, 0.0, 0.0 },
> +			  { 0.0, 0.0, 0.0 },
> +		  },
> +		  .ctm = {
> +			  -1.0,  0.0,  0.0,
> +			   0.0, -1.0,  0.0,
> +			   0.0,  0.0, -1.0,
> +		  },
> +		  .desc = "Check the color transformation for negative
> transparency",
>  		},
> -		{ "ctm-0-25", 5,
> -			{{ 0.0, }, { 0.0, }, { 0.0, }},
> -		  { 0.25, 0.0,  0.0,
> -		    0.0,  0.25, 0.0,
> -		    0.0,  0.0,  0.25 },
> -		  "Check the color transformation for 0.25 transparency"
> +		{ .name = "ctm-0-25",
> +		  .iter = 5,
> +		  .ctm = {
> +			  0.25, 0.0,  0.0,
> +			  0.0,  0.25, 0.0,
> +			  0.0,  0.0,  0.25,
> +		  },
> +		  .desc = "Check the color transformation for 0.25 transparency",
>  		},
> -		{ "ctm-0-50", 5,
> -			{{ 0.0, }, { 0.0, }, { 0.0, }},
> -		  { 0.5,  0.0,  0.0,
> -		    0.0,  0.5,  0.0,
> -		    0.0,  0.0,  0.5 },
> -		  "Check the color transformation for 0.5 transparency"
> +		{ .name = "ctm-0-50",
> +		  .iter = 5,
> +		  .ctm = {
> +			  0.5,  0.0,  0.0,
> +			  0.0,  0.5,  0.0,
> +			  0.0,  0.0,  0.5,
> +		  },
> +		  .desc = "Check the color transformation for 0.5 transparency",
>  		},
> -		{ "ctm-0-75", 7,
> -			{{ 0.0, }, { 0.0, }, { 0.0, }},
> -		  { 0.75, 0.0,  0.0,
> -		    0.0,  0.75, 0.0,
> -		    0.0,  0.0,  0.75 },
> -		  "Check the color transformation for 0.75 transparency"
> +		{ .name = "ctm-0-75",
> +		  .iter = 7,
> +		  .ctm = {
> +			  0.75, 0.0,  0.0,
> +			  0.0,  0.75, 0.0,
> +			  0.0,  0.0,  0.75,
> +		  },
> +		  .desc = "Check the color transformation for 0.75 transparency",
>  		},
>  	};
>  	int i;
> --
> 2.39.2


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

* Re: [igt-dev] [PATCH i-g-t v2 3/9] tests/kms_color: Make loads of stuff static const
  2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 3/9] tests/kms_color: Make loads of stuff static const Ville Syrjala
@ 2023-05-04 21:26   ` Shankar, Uma
  0 siblings, 0 replies; 19+ messages in thread
From: Shankar, Uma @ 2023-05-04 21:26 UTC (permalink / raw)
  To: Ville Syrjala, igt-dev@lists.freedesktop.org



> -----Original Message-----
> From: igt-dev <igt-dev-bounces@lists.freedesktop.org> On Behalf Of Ville Syrjala
> Sent: Tuesday, April 11, 2023 9:46 PM
> To: igt-dev@lists.freedesktop.org
> Subject: [igt-dev] [PATCH i-g-t v2 3/9] tests/kms_color: Make loads of stuff static
> const
> 
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Huge swaths of the data used in the test can be made static const.
> The one slightly tricky part is 'expected_colors' which is being mutated in the ctm
> tests. But we can just use an on stack variable for that.

Looks Good to me.
Reviewed-by: Uma Shankar <uma.shankar@intel.com>

> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  tests/kms_color.c        | 47 +++++++++++++++++++++-------------------
>  tests/kms_color_helper.c |  4 ++--
>  tests/kms_color_helper.h |  4 ++--
>  3 files changed, 29 insertions(+), 26 deletions(-)
> 
> diff --git a/tests/kms_color.c b/tests/kms_color.c index
> 84a8eabe5484..5c4d884f4de8 100644
> --- a/tests/kms_color.c
> +++ b/tests/kms_color.c
> @@ -321,7 +321,7 @@ static bool test_pipe_legacy_gamma(data_t *data,  static
> bool test_pipe_legacy_gamma_reset(data_t *data,
>  					 igt_plane_t *primary)
>  {
> -	const double ctm_identity[] = {
> +	static const double ctm_identity[] = {
>  		1.0, 0.0, 0.0,
>  		0.0, 1.0, 0.0,
>  		0.0, 0.0, 1.0,
> @@ -454,11 +454,11 @@ end:
>   */
>  static bool test_pipe_ctm(data_t *data,
>  			  igt_plane_t *primary,
> -			  color_t *before,
> -			  color_t *after,
> -			  double *ctm_matrix)
> +			  const color_t *before,
> +			  const color_t *after,
> +			  const double *ctm_matrix)
>  {
> -	const double ctm_identity[] = {
> +	static const double ctm_identity[] = {
>  		1.0, 0.0, 0.0,
>  		0.0, 1.0, 0.0,
>  		0.0, 0.0, 1.0,
> @@ -566,17 +566,17 @@ static void test_pipe_limited_range_ctm(data_t *data,
>  					igt_plane_t *primary)
>  {
>  	double limited_result = 235.0 / 255.0;
> -	color_t red_green_blue_limited[] = {
> +	static const color_t red_green_blue_limited[] = {
>  		{ limited_result, 0.0, 0.0 },
>  		{ 0.0, limited_result, 0.0 },
>  		{ 0.0, 0.0, limited_result },
>  	};
> -	color_t red_green_blue_full[] = {
> +	static const color_t red_green_blue_full[] = {
>  		{ 0.5, 0.0, 0.0 },
>  		{ 0.0, 0.5, 0.0 },
>  		{ 0.0, 0.0, 0.5 },
>  	};
> -	double ctm[] = {
> +	static const double ctm[] = {
>  		1.0, 0.0, 0.0,
>  		0.0, 1.0, 0.0,
>  		0.0, 0.0, 1.0,
> @@ -737,12 +737,12 @@ out:
> 
>  static void
>  run_ctm_tests_for_pipe(data_t *data, enum pipe p,
> -		       color_t *expected_colors,
> -		       double *ctm,
> +		       const color_t *expected_colors,
> +		       const double *ctm,
>  		       int iter)
>  {
>  	double delta;
> -	color_t red_green_blue[] = {
> +	static const color_t red_green_blue[] = {
>  		{ 1.0, 0.0, 0.0 },
>  		{ 0.0, 1.0, 0.0 },
>  		{ 0.0, 0.0, 1.0 },
> @@ -777,12 +777,15 @@ run_ctm_tests_for_pipe(data_t *data, enum pipe p,
>  		 * for odd number of items in the LUTs.
>  		 */
>  		for (i = 0; i < iter; i++) {
> -			expected_colors[0].r =
> -				expected_colors[1].g =
> -				expected_colors[2].b =
> -				ctm[0] + delta * (i - (iter / 2));
> +			float c = ctm[0] + delta * (i - (iter / 2));
> +			color_t expected_colors_local[] = {
> +				{ .r = c, },
> +				{ .g = c, },
> +				{ .b = c, },
> +			};
> +
>  			if (test_pipe_ctm(data, data->primary, red_green_blue,
> -					  expected_colors, ctm)) {
> +					  expected_colors_local, ctm)) {
>  				success = true;
>  				break;
>  			}
> @@ -798,17 +801,17 @@ static void
>  run_deep_color_tests_for_pipe(data_t *data, enum pipe p)  {
>  	igt_output_t *output;
> -	color_t blue_green_blue[] = {
> +	static const color_t blue_green_blue[] = {
>  		{ 0.0, 0.0, 1.0 },
>  		{ 0.0, 1.0, 0.0 },
>  		{ 0.0, 0.0, 1.0 },
>  	};
> -	color_t red_green_blue[] = {
> +	static const color_t red_green_blue[] = {
>  		{ 1.0, 0.0, 0.0 },
>  		{ 0.0, 1.0, 0.0 },
> -		{ 0.0, 0.0, 1.0 }
> +		{ 0.0, 0.0, 1.0 },
>  	};
> -	double ctm[] = {
> +	static const double ctm[] = {
>  		0.0, 0.0, 0.0,
>  		0.0, 1.0, 0.0,
>  		1.0, 0.0, 1.0,
> @@ -923,7 +926,7 @@ static void
>  run_tests_for_pipe(data_t *data)
>  {
>  	enum pipe pipe;
> -	struct {
> +	static const struct {
>  		const char *name;
>  		bool (*test_t)(data_t*, igt_plane_t*);
>  		const char *desc;
> @@ -945,7 +948,7 @@ run_tests_for_pipe(data_t *data)
>  		  .desc = "Verify that setting the legacy gamma LUT resets the
> gamma LUT set through GAMMA_LUT property",
>  		},
>  	};
> -	struct {
> +	static const struct {
>  		const char *name;
>  		int iter;
>  		color_t colors[3];
> diff --git a/tests/kms_color_helper.c b/tests/kms_color_helper.c index
> 2f9950f801e4..5089bc373343 100644
> --- a/tests/kms_color_helper.c
> +++ b/tests/kms_color_helper.c
> @@ -54,7 +54,7 @@ uint64_t get_max_bpc(igt_output_t *output)
> 
>  void paint_gradient_rectangles(data_t *data,
>  			       drmModeModeInfo *mode,
> -			       color_t *colors,
> +			       const color_t *colors,
>  			       struct igt_fb *fb)
>  {
>  	cairo_t *cr = igt_get_cairo_ctx(data->drm_fd, fb); @@ -90,7 +90,7 @@ void
> paint_gradient_rectangles(data_t *data,
> 
>  void paint_rectangles(data_t *data,
>  		      drmModeModeInfo *mode,
> -		      color_t *colors,
> +		      const color_t *colors,
>  		      struct igt_fb *fb)
>  {
>  	cairo_t *cr = igt_get_cairo_ctx(data->drm_fd, fb); diff --git
> a/tests/kms_color_helper.h b/tests/kms_color_helper.h index
> 78b97b00864f..23463b944b6f 100644
> --- a/tests/kms_color_helper.h
> +++ b/tests/kms_color_helper.h
> @@ -74,11 +74,11 @@ bool panel_supports_deep_color(int fd, char
> *output_name);  uint64_t get_max_bpc(igt_output_t *output);  void
> paint_gradient_rectangles(data_t *data,
>  			       drmModeModeInfo *mode,
> -			       color_t *colors,
> +			       const color_t *colors,
>  			       struct igt_fb *fb);
>  void paint_rectangles(data_t *data,
>  		      drmModeModeInfo *mode,
> -		      color_t *colors,
> +		      const color_t *colors,
>  		      struct igt_fb *fb);
>  gamma_lut_t *alloc_lut(int lut_size);
>  void free_lut(gamma_lut_t *gamma);
> --
> 2.39.2


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

* Re: [igt-dev] [PATCH i-g-t v2 4/9] tests/kms_color: Pass down the colors used to paint the fb
  2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 4/9] tests/kms_color: Pass down the colors used to paint the fb Ville Syrjala
@ 2023-05-04 21:28   ` Shankar, Uma
  0 siblings, 0 replies; 19+ messages in thread
From: Shankar, Uma @ 2023-05-04 21:28 UTC (permalink / raw)
  To: Ville Syrjala, igt-dev@lists.freedesktop.org



> -----Original Message-----
> From: igt-dev <igt-dev-bounces@lists.freedesktop.org> On Behalf Of Ville Syrjala
> Sent: Tuesday, April 11, 2023 9:46 PM
> To: igt-dev@lists.freedesktop.org
> Subject: [igt-dev] [PATCH i-g-t v2 4/9] tests/kms_color: Pass down the colors used to
> paint the fb
> 
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Instead of assuming we always want RGB stripes in the fb let's pass those colors
> down from the top. Will be needed to make more interesting tests that mix colors
> from multiple channels.

Looks Good to me.
Reviewed-by: Uma Shankar <uma.shankar@intel.com>

> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  tests/kms_color.c | 25 ++++++++++++++++++-------
>  1 file changed, 18 insertions(+), 7 deletions(-)
> 
> diff --git a/tests/kms_color.c b/tests/kms_color.c index
> 5c4d884f4de8..e3fe2aea4695 100644
> --- a/tests/kms_color.c
> +++ b/tests/kms_color.c
> @@ -737,16 +737,12 @@ out:
> 
>  static void
>  run_ctm_tests_for_pipe(data_t *data, enum pipe p,
> +		       const color_t *fb_colors,
>  		       const color_t *expected_colors,
>  		       const double *ctm,
>  		       int iter)
>  {
>  	double delta;
> -	static const color_t red_green_blue[] = {
> -		{ 1.0, 0.0, 0.0 },
> -		{ 0.0, 1.0, 0.0 },
> -		{ 0.0, 0.0, 1.0 },
> -	};
> 
>  	test_setup(data, p);
> 
> @@ -767,7 +763,7 @@ run_ctm_tests_for_pipe(data_t *data, enum pipe p,
>  		int i;
> 
>  		if (!iter)
> -			success = test_pipe_ctm(data, data->primary,
> red_green_blue,
> +			success = test_pipe_ctm(data, data->primary, fb_colors,
>  						expected_colors, ctm);
> 
>  		/*
> @@ -784,7 +780,7 @@ run_ctm_tests_for_pipe(data_t *data, enum pipe p,
>  				{ .b = c, },
>  			};
> 
> -			if (test_pipe_ctm(data, data->primary, red_green_blue,
> +			if (test_pipe_ctm(data, data->primary, fb_colors,
>  					  expected_colors_local, ctm)) {
>  				success = true;
>  				break;
> @@ -948,14 +944,21 @@ run_tests_for_pipe(data_t *data)
>  		  .desc = "Verify that setting the legacy gamma LUT resets the
> gamma LUT set through GAMMA_LUT property",
>  		},
>  	};
> +	static const color_t colors_rgb[] = {
> +		{ 1.0, 0.0, 0.0 },
> +		{ 0.0, 1.0, 0.0 },
> +		{ 0.0, 0.0, 1.0 },
> +	};
>  	static const struct {
>  		const char *name;
>  		int iter;
> +		const color_t *fb_colors;
>  		color_t colors[3];
>  		double ctm[9];
>  		const char *desc;
>  	} ctm_tests[] = {
>  		{ .name = "ctm-red-to-blue",
> +		  .fb_colors = colors_rgb,
>  		  .colors = {
>  			  { 0.0, 0.0, 1.0 },
>  			  { 0.0, 1.0, 0.0 },
> @@ -969,6 +972,7 @@ run_tests_for_pipe(data_t *data)
>  		  .desc = "Check the color transformation from red to blue",
>  		},
>  		{ .name = "ctm-green-to-red",
> +		  .fb_colors = colors_rgb,
>  		  .colors = {
>  			  { 1.0, 0.0, 0.0 },
>  			  { 1.0, 0.0, 0.0 },
> @@ -982,6 +986,7 @@ run_tests_for_pipe(data_t *data)
>  		  .desc = "Check the color transformation from green to red",
>  		},
>  		{ .name = "ctm-blue-to-red",
> +		  .fb_colors = colors_rgb,
>  		  .colors = {
>  			  { 1.0, 0.0, 0.0 },
>  			  { 0.0, 1.0, 0.0 },
> @@ -995,6 +1000,7 @@ run_tests_for_pipe(data_t *data)
>  		  .desc = "Check the color transformation from blue to red",
>  		},
>  		{ .name = "ctm-max",
> +		  .fb_colors = colors_rgb,
>  		  .colors = {
>  			  { 1.0, 0.0, 0.0 },
>  			  { 0.0, 1.0, 0.0 },
> @@ -1007,6 +1013,7 @@ run_tests_for_pipe(data_t *data)
>  		  .desc = "Check the color transformation for maximum
> transparency",
>  		},
>  		{ .name = "ctm-negative",
> +		  .fb_colors = colors_rgb,
>  		  .colors = {
>  			  { 0.0, 0.0, 0.0 },
>  			  { 0.0, 0.0, 0.0 },
> @@ -1021,6 +1028,7 @@ run_tests_for_pipe(data_t *data)
>  		},
>  		{ .name = "ctm-0-25",
>  		  .iter = 5,
> +		  .fb_colors = colors_rgb,
>  		  .ctm = {
>  			  0.25, 0.0,  0.0,
>  			  0.0,  0.25, 0.0,
> @@ -1030,6 +1038,7 @@ run_tests_for_pipe(data_t *data)
>  		},
>  		{ .name = "ctm-0-50",
>  		  .iter = 5,
> +		  .fb_colors = colors_rgb,
>  		  .ctm = {
>  			  0.5,  0.0,  0.0,
>  			  0.0,  0.5,  0.0,
> @@ -1039,6 +1048,7 @@ run_tests_for_pipe(data_t *data)
>  		},
>  		{ .name = "ctm-0-75",
>  		  .iter = 7,
> +		  .fb_colors = colors_rgb,
>  		  .ctm = {
>  			  0.75, 0.0,  0.0,
>  			  0.0,  0.75, 0.0,
> @@ -1064,6 +1074,7 @@ run_tests_for_pipe(data_t *data)
>  		igt_subtest_with_dynamic_f("%s", ctm_tests[i].name) {
>  			for_each_pipe(&data->display, pipe) {
>  				run_ctm_tests_for_pipe(data, pipe,
> +						       ctm_tests[i].fb_colors,
>  						       ctm_tests[i].colors,
>  						       ctm_tests[i].ctm,
>  						       ctm_tests[i].iter);
> --
> 2.39.2


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

* Re: [igt-dev] [PATCH i-g-t v2 5/9] tests/kms_color: Get rid of hand coded "expected_colors"
  2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 5/9] tests/kms_color: Get rid of hand coded "expected_colors" Ville Syrjala
@ 2023-05-04 21:39   ` Shankar, Uma
  0 siblings, 0 replies; 19+ messages in thread
From: Shankar, Uma @ 2023-05-04 21:39 UTC (permalink / raw)
  To: Ville Syrjala, igt-dev@lists.freedesktop.org



> -----Original Message-----
> From: igt-dev <igt-dev-bounces@lists.freedesktop.org> On Behalf Of Ville Syrjala
> Sent: Tuesday, April 11, 2023 9:46 PM
> To: igt-dev@lists.freedesktop.org
> Subject: [igt-dev] [PATCH i-g-t v2 5/9] tests/kms_color: Get rid of hand coded
> "expected_colors"
> 
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Instead of specifying the expected colors by hand just apply the ctm to the fb colors
> and let the computer do the work for us.

Looks Good to me.
Reviewed-by: Uma Shankar <uma.shankar@intel.com>

> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  tests/kms_color.c | 59 +++++++++++++++++------------------------------
>  1 file changed, 21 insertions(+), 38 deletions(-)
> 
> diff --git a/tests/kms_color.c b/tests/kms_color.c index
> e3fe2aea4695..d430ee12aaa3 100644
> --- a/tests/kms_color.c
> +++ b/tests/kms_color.c
> @@ -735,10 +735,18 @@ out:
>  	test_cleanup(data);
>  }
> 
> +static void transform_color(color_t *color, const double *ctm, double
> +offset) {
> +	color_t tmp = *color;
> +
> +	color->r = ctm[0] * tmp.r + ctm[1] * tmp.g + ctm[2] * tmp.b + offset;
> +	color->g = ctm[3] * tmp.r + ctm[4] * tmp.g + ctm[5] * tmp.b + offset;
> +	color->b = ctm[6] * tmp.r + ctm[7] * tmp.g + ctm[8] * tmp.b + offset;
> +}
> +
>  static void
>  run_ctm_tests_for_pipe(data_t *data, enum pipe p,
>  		       const color_t *fb_colors,
> -		       const color_t *expected_colors,
>  		       const double *ctm,
>  		       int iter)
>  {
> @@ -758,14 +766,13 @@ run_ctm_tests_for_pipe(data_t *data, enum pipe p,
>  	if (!pipe_output_combo_valid(data, p))
>  		goto out;
> 
> +	if (!iter)
> +		iter = 1;
> +
>  	igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(p), data->output->name) {
>  		bool success = false;
>  		int i;
> 
> -		if (!iter)
> -			success = test_pipe_ctm(data, data->primary, fb_colors,
> -						expected_colors, ctm);
> -
>  		/*
>  		 * We tests a few values around the expected result because
>  		 * it depends on the hardware we're dealing with, we can either @@
> -773,15 +780,18 @@ run_ctm_tests_for_pipe(data_t *data, enum pipe p,
>  		 * for odd number of items in the LUTs.
>  		 */
>  		for (i = 0; i < iter; i++) {
> -			float c = ctm[0] + delta * (i - (iter / 2));
> -			color_t expected_colors_local[] = {
> -				{ .r = c, },
> -				{ .g = c, },
> -				{ .b = c, },
> +			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_local, ctm)) {
> +					  expected_colors, ctm)) {
>  				success = true;
>  				break;
>  			}
> @@ -953,17 +963,11 @@ run_tests_for_pipe(data_t *data)
>  		const char *name;
>  		int iter;
>  		const color_t *fb_colors;
> -		color_t colors[3];
>  		double ctm[9];
>  		const char *desc;
>  	} ctm_tests[] = {
>  		{ .name = "ctm-red-to-blue",
>  		  .fb_colors = colors_rgb,
> -		  .colors = {
> -			  { 0.0, 0.0, 1.0 },
> -			  { 0.0, 1.0, 0.0 },
> -			  { 0.0, 0.0, 1.0 },
> -		  },
>  		  .ctm = {
>  			  0.0, 0.0, 0.0,
>  			  0.0, 1.0, 0.0,
> @@ -973,11 +977,6 @@ run_tests_for_pipe(data_t *data)
>  		},
>  		{ .name = "ctm-green-to-red",
>  		  .fb_colors = colors_rgb,
> -		  .colors = {
> -			  { 1.0, 0.0, 0.0 },
> -			  { 1.0, 0.0, 0.0 },
> -			  { 0.0, 0.0, 1.0 },
> -		  },
>  		  .ctm = {
>  			  1.0, 1.0, 0.0,
>  			  0.0, 0.0, 0.0,
> @@ -987,11 +986,6 @@ run_tests_for_pipe(data_t *data)
>  		},
>  		{ .name = "ctm-blue-to-red",
>  		  .fb_colors = colors_rgb,
> -		  .colors = {
> -			  { 1.0, 0.0, 0.0 },
> -			  { 0.0, 1.0, 0.0 },
> -			  { 1.0, 0.0, 0.0 },
> -		  },
>  		  .ctm = {
>  			  1.0, 0.0, 1.0,
>  			  0.0, 1.0, 0.0,
> @@ -1001,11 +995,6 @@ run_tests_for_pipe(data_t *data)
>  		},
>  		{ .name = "ctm-max",
>  		  .fb_colors = colors_rgb,
> -		  .colors = {
> -			  { 1.0, 0.0, 0.0 },
> -			  { 0.0, 1.0, 0.0 },
> -			  { 0.0, 0.0, 1.0 },
> -		  },
>  		  .ctm = { 100.0, 0.0, 0.0,
>  			  0.0, 100.0, 0.0,
>  			  0.0, 0.0, 100.0,
> @@ -1014,11 +1003,6 @@ run_tests_for_pipe(data_t *data)
>  		},
>  		{ .name = "ctm-negative",
>  		  .fb_colors = colors_rgb,
> -		  .colors = {
> -			  { 0.0, 0.0, 0.0 },
> -			  { 0.0, 0.0, 0.0 },
> -			  { 0.0, 0.0, 0.0 },
> -		  },
>  		  .ctm = {
>  			  -1.0,  0.0,  0.0,
>  			   0.0, -1.0,  0.0,
> @@ -1075,7 +1059,6 @@ run_tests_for_pipe(data_t *data)
>  			for_each_pipe(&data->display, pipe) {
>  				run_ctm_tests_for_pipe(data, pipe,
>  						       ctm_tests[i].fb_colors,
> -						       ctm_tests[i].colors,
>  						       ctm_tests[i].ctm,
>  						       ctm_tests[i].iter);
>  			}
> --
> 2.39.2


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

* Re: [igt-dev] [PATCH i-g-t v2 6/9] tests/kms_color: Add and additional "signed" subtest
  2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 6/9] tests/kms_color: Add and additional "signed" subtest Ville Syrjala
@ 2023-05-04 21:43   ` Shankar, Uma
  0 siblings, 0 replies; 19+ messages in thread
From: Shankar, Uma @ 2023-05-04 21:43 UTC (permalink / raw)
  To: Ville Syrjala, igt-dev@lists.freedesktop.org



> -----Original Message-----
> From: igt-dev <igt-dev-bounces@lists.freedesktop.org> On Behalf Of Ville Syrjala
> Sent: Tuesday, April 11, 2023 9:46 PM
> To: igt-dev@lists.freedesktop.org
> Subject: [igt-dev] [PATCH i-g-t v2 6/9] tests/kms_color: Add and additional "signed"
> subtest

Nit: s/and/an

> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> i915 CHV CSC code has a bug where it treats the hardware CSC coefficient as sign-
> magnitude instead of the two's complement value that it is. None of the current
> tests manage to notice this.
> 
> Add a testcase that uses suitable negative coefficients to catch the issue. With CHV's
> s4.12 coefficients the
> -0.25 ends up as -7.75 and the results won't match.

Looks Good to me.
Reviewed-by: Uma Shankar <uma.shankar@intel.com>

> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  tests/kms_color.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/tests/kms_color.c b/tests/kms_color.c index
> d430ee12aaa3..35083122dfbf 100644
> --- a/tests/kms_color.c
> +++ b/tests/kms_color.c
> @@ -959,6 +959,11 @@ run_tests_for_pipe(data_t *data)
>  		{ 0.0, 1.0, 0.0 },
>  		{ 0.0, 0.0, 1.0 },
>  	};
> +	static const color_t colors_cmy[] = {
> +		{ 0.0, 1.0, 1.0 },
> +		{ 1.0, 0.0, 1.0 },
> +		{ 1.0, 1.0, 0.0 }
> +	};
>  	static const struct {
>  		const char *name;
>  		int iter;
> @@ -1040,6 +1045,16 @@ run_tests_for_pipe(data_t *data)
>  		  },
>  		  .desc = "Check the color transformation for 0.75 transparency",
>  		},
> +		{ .name = "ctm-signed",
> +		  .fb_colors = colors_cmy,
> +		  .iter = 3,
> +		  .ctm = {
> +			  -0.25,  0.75,  0.75,
> +			   0.75, -0.25,  0.75,
> +			   0.75,  0.75, -0.25,
> +		  },
> +		  .desc = "Check the color transformation for correct signed
> handling",
> +		},
>  	};
>  	int i;
> 
> --
> 2.39.2


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

* Re: [igt-dev] [PATCH i-g-t v2 7/9] tests/kms_color: Dump the CTM before/after color values
  2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 7/9] tests/kms_color: Dump the CTM before/after color values Ville Syrjala
@ 2023-05-04 21:44   ` Shankar, Uma
  0 siblings, 0 replies; 19+ messages in thread
From: Shankar, Uma @ 2023-05-04 21:44 UTC (permalink / raw)
  To: Ville Syrjala, igt-dev@lists.freedesktop.org



> -----Original Message-----
> From: igt-dev <igt-dev-bounces@lists.freedesktop.org> On Behalf Of Ville Syrjala
> Sent: Tuesday, April 11, 2023 9:46 PM
> To: igt-dev@lists.freedesktop.org
> Subject: [igt-dev] [PATCH i-g-t v2 7/9] tests/kms_color: Dump the CTM before/after
> color values
> 
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Include the before/after color values in the debug output to help with diagnosing
> failures.

Looks Good to me.
Reviewed-by: Uma Shankar <uma.shankar@intel.com>

> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  tests/kms_color.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/tests/kms_color.c b/tests/kms_color.c index
> 35083122dfbf..1ec097953c9d 100644
> --- a/tests/kms_color.c
> +++ b/tests/kms_color.c
> @@ -511,6 +511,14 @@ static bool test_pipe_ctm(data_t *data,
>  		set_gamma(data, primary->pipe, gamma_linear);
>  	}
> 
> +	igt_debug("color before[0] %f,%f,%f\n", before[0].r, before[0].g,
> before[0].b);
> +	igt_debug("color before[1] %f,%f,%f\n", before[1].r, before[1].g,
> before[1].b);
> +	igt_debug("color before[2] %f,%f,%f\n", before[2].r, before[2].g,
> +before[2].b);
> +
> +	igt_debug("color after[0] %f,%f,%f\n", after[0].r, after[0].g, after[0].b);
> +	igt_debug("color after[1] %f,%f,%f\n", after[1].r, after[1].g, after[1].b);
> +	igt_debug("color after[2] %f,%f,%f\n", after[2].r, after[2].g,
> +after[2].b);
> +
>  	disable_ctm(primary->pipe);
>  	igt_display_commit(&data->display);
> 
> --
> 2.39.2


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

* Re: [igt-dev] [PATCH i-g-t v2 8/9] tests/kms_color: Move dynamic subtests up one level
  2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 8/9] tests/kms_color: Move dynamic subtests up one level Ville Syrjala
@ 2023-05-04 21:46   ` Shankar, Uma
  0 siblings, 0 replies; 19+ messages in thread
From: Shankar, Uma @ 2023-05-04 21:46 UTC (permalink / raw)
  To: Ville Syrjala, igt-dev@lists.freedesktop.org



> -----Original Message-----
> From: igt-dev <igt-dev-bounces@lists.freedesktop.org> On Behalf Of Ville Syrjala
> Sent: Tuesday, April 11, 2023 9:46 PM
> To: igt-dev@lists.freedesktop.org
> Subject: [igt-dev] [PATCH i-g-t v2 8/9] tests/kms_color: Move dynamic subtests up
> one level
> 
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Move the igt_dynamic_f() up one level so that the whole subtests doesn't skip if
> some pipe is missing a suitable output. We want to skip only the dynamic subtest.

Looks Good to me.
Reviewed-by: Uma Shankar <uma.shankar@intel.com>

> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  tests/kms_color.c | 76 +++++++++++++++++++++++------------------------
>  1 file changed, 38 insertions(+), 38 deletions(-)
> 
> diff --git a/tests/kms_color.c b/tests/kms_color.c index
> 1ec097953c9d..e35dccea1a61 100644
> --- a/tests/kms_color.c
> +++ b/tests/kms_color.c
> @@ -736,8 +736,7 @@ run_gamma_degamma_tests_for_pipe(data_t *data, enum
> pipe p,
>  	if (!pipe_output_combo_valid(data, p))
>  		goto out;
> 
> -	igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(p), data->output->name)
> -		igt_assert(test_t(data, data->primary));
> +	igt_assert(test_t(data, data->primary));
> 
>  out:
>  	test_cleanup(data);
> @@ -758,7 +757,9 @@ run_ctm_tests_for_pipe(data_t *data, enum pipe p,
>  		       const double *ctm,
>  		       int iter)
>  {
> +	bool success = false;
>  	double delta;
> +	int i;
> 
>  	test_setup(data, p);
> 
> @@ -777,35 +778,30 @@ run_ctm_tests_for_pipe(data_t *data, enum pipe p,
>  	if (!iter)
>  		iter = 1;
> 
> -	igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(p), data->output->name) {
> -		bool success = false;
> -		int i;
> -
> -		/*
> -		 * 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;
> -			}
> +	/*
> +	 * 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);
> @@ -927,10 +923,10 @@ 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) {
> -				prep_pipe(data, pipe);
> -
> -				igt_dynamic_f("pipe-%s",
> kmstest_pipe_name(pipe))
> +				igt_dynamic_f("pipe-%s",
> kmstest_pipe_name(pipe)) {
> +					prep_pipe(data, pipe);
>  					tests[i].test_t(data, pipe);
> +				}
>  			}
>  		}
>  	}
> @@ -1070,8 +1066,10 @@ 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) {
> -				run_gamma_degamma_tests_for_pipe(data, pipe,
> -
> gamma_degamma_tests[i].test_t);
> +				igt_dynamic_f("pipe-%s",
> kmstest_pipe_name(pipe)) {
> +
> 	run_gamma_degamma_tests_for_pipe(data, pipe,
> +
> gamma_degamma_tests[i].test_t);
> +				}
>  			}
>  		}
>  	}
> @@ -1080,10 +1078,12 @@ 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) {
> -				run_ctm_tests_for_pipe(data, pipe,
> -						       ctm_tests[i].fb_colors,
> -						       ctm_tests[i].ctm,
> -						       ctm_tests[i].iter);
> +				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);
> +				}
>  			}
>  		}
>  	}
> --
> 2.39.2


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

end of thread, other threads:[~2023-05-04 21:46 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-11 16:15 [igt-dev] [PATCH i-g-t v2 0/9] tests/kms_color: Improve CTM tests Ville Syrjala
2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 1/9] tests/kms_color: Use legacy LUT for chopping off the lsbs Ville Syrjala
2023-05-04 21:21   ` Shankar, Uma
2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 2/9] tests/kms_color: Use named initializers Ville Syrjala
2023-05-04 21:23   ` Shankar, Uma
2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 3/9] tests/kms_color: Make loads of stuff static const Ville Syrjala
2023-05-04 21:26   ` Shankar, Uma
2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 4/9] tests/kms_color: Pass down the colors used to paint the fb Ville Syrjala
2023-05-04 21:28   ` Shankar, Uma
2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 5/9] tests/kms_color: Get rid of hand coded "expected_colors" Ville Syrjala
2023-05-04 21:39   ` Shankar, Uma
2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 6/9] tests/kms_color: Add and additional "signed" subtest Ville Syrjala
2023-05-04 21:43   ` Shankar, Uma
2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 7/9] tests/kms_color: Dump the CTM before/after color values Ville Syrjala
2023-05-04 21:44   ` Shankar, Uma
2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 8/9] tests/kms_color: Move dynamic subtests up one level Ville Syrjala
2023-05-04 21:46   ` Shankar, Uma
2023-04-11 16:15 ` [igt-dev] [PATCH i-g-t v2 9/9] tests/intel-ci/fast-feedback: Run ctm tests Ville Syrjala
2023-04-11 17:51 ` [igt-dev] ✗ Fi.CI.BAT: failure for tests/kms_color: Improve CTM tests (rev2) Patchwork

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