tests/kms_color: Improve CTM tests
v2 cover tests/kms_color: Improve CTM tests
From: Ville Syrjälä <[email protected]>
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(-)
Signature · 1 line
2.39.2
PATCH v2 1/9 tests/kms_color: Use legacy LUT for chopping off the lsbs
From: Ville Syrjälä <[email protected]>
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).
--- tests/kms_color.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
tests/kms_color.c +1 -4
@@ -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); }
Signature · 1 line
2.39.2
Re: [igt-dev] [PATCH i-g-t v2 1/9] tests/kms_color: Use legacy LUT for chopping off the lsbs
Quoted 9 lines
-----Original Message-----
From: igt-dev <[email protected]> On Behalf Of Ville Syrjala
Sent: Tuesday, April 11, 2023 9:46 PM
To: [email protected]
Subject: [igt-dev] [PATCH i-g-t v2 1/9] tests/kms_color: Use legacy LUT for chopping off the lsbs
Quoted 6 lines
From: Ville Syrjälä <[email protected]>
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.
Quoted 29 lines
Signed-off-by Ville Syrjälä <[email protected]>--- tests/kms_color.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)tests/kms_color.c index renamed from tests/kms_color.c +0
-0
cd03c1354c0a..369dc8057d83100644tests/kms_color.c +1
-4@@ -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);tests/kms_color.c +0
-1set_gamma (data, primary->pipe, gamma_linear); } --2.39.2
PATCH v2 2/9 tests/kms_color: Use named initializers
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
Use named initializers to make it actually possible to figure out what is happening. And sprinkle some missing commas around while at it.
--- tests/kms_color.c | 202 +++++++++++++++++++++++++++------------------- 1 file changed, 118 insertions(+), 84 deletions(-)
tests/kms_color.c +118 -84
@@ -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;
Signature · 1 line
2.39.2
Re: [igt-dev] [PATCH i-g-t v2 2/9] tests/kms_color: Use named initializers
Quoted 8 lines
-----Original Message-----
From: igt-dev <[email protected]> On Behalf Of Ville Syrjala
Sent: Tuesday, April 11, 2023 9:46 PM
To: [email protected]
Subject: [igt-dev] [PATCH i-g-t v2 2/9] tests/kms_color: Use named initializers
Quoted 4 lines
From: Ville Syrjälä <[email protected]>
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.
Quoted 308 lines
Signed-off-by Ville Syrjälä <[email protected]>--- tests/kms_color.c | 202 +++++++++++++++++++++++++++------------------- 1 file changed, 118 insertions(+), 84 deletions(-)tests/kms_color.c index renamed from tests/kms_color.c +0
-0
369dc8057d83..84a8eabe5484100644tests/kms_color.c +4
-4@@ -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,
tests/kms_color.c +8
-6const 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,
tests/kms_color.c +7
-5color_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))tests/kms_color.c +1
-11igt_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 LUTset through
GAMMA_LUTproperty" },tests/kms_color.c +3
-0+ { .name = "degamma", + .test_t = test_pipe_degamma, + .desc = "Verify that degamma LUT transformation workscorrectly",
tests/kms_color.c +8
-0+ }, + { .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 workscorrectly",
tests/kms_color.c +4
-0+ }, + { .name = "legacy-gamma-reset", + .test_t = test_pipe_legacy_gamma_reset, + .desc = "Verify that setting the legacy gamma LUT resets thegamma LUT set through
GAMMA_LUTproperty",tests/kms_color.c +84
-58+ }, };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", },tests/kms_color.c +0
-1};int i; --2.39.2
PATCH v2 3/9 tests/kms_color: Make loads of stuff static const
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
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.
--- tests/kms_color.c | 47 +++++++++++++++++++++------------------- tests/kms_color_helper.c | 4 ++-- tests/kms_color_helper.h | 4 ++-- 3 files changed, 29 insertions(+), 26 deletions(-)
tests/kms_color.c +25 -22
@@ -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];
tests/kms_color_helper.c +2 -2
@@ -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);
tests/kms_color_helper.h +2 -2
@@ -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);
Signature · 1 line
2.39.2
Re: [igt-dev] [PATCH i-g-t v2 3/9] tests/kms_color: Make loads of stuff static const
Quoted 9 lines
-----Original Message-----
From: igt-dev <[email protected]> On Behalf Of Ville Syrjala
Sent: Tuesday, April 11, 2023 9:46 PM
To: [email protected]
Subject: [igt-dev] [PATCH i-g-t v2 3/9] tests/kms_color: Make loads of stuff static const
Quoted 5 lines
From: Ville Syrjälä <[email protected]>
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.
Quoted 176 lines
Signed-off-by Ville Syrjälä <[email protected]>--- tests/kms_color.c | 47 +++++++++++++++++++++------------------- tests/kms_color_helper.c | 4 ++-- tests/kms_color_helper.h | 4 ++-- 3 files changed, 29 insertions(+), 26 deletions(-)tests/kms_color.c index renamed from tests/kms_color.c +0
-0
84a8eabe5484..5c4d884f4de8100644tests/kms_color.c +25
-22@@ -321,7 +321,7 @@ static bool test_pipe_legacy_gamma(data_t *data, staticbool 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;tests/kms_color.c +0
-0color_t colors[3 ];tests/kms_color_helper.c index renamed from tests/kms_color_helper.c +0
-0
2f9950f801e4..5089bc373343100644tests/kms_color_helper.c +1
-1@@ -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 @@ voidpaint_gradient_rectangles(data_t *data,
void paint_rectangles(data_t *data,
tests/kms_color_helper.c +1
-1drmModeModeInfo *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.hb/tests/kms_color_helper.hindex78b97b00864f..23463b944b6f100644tests/kms_color_helper.h +2
-3@@ -74,11 +74,11 @@ bool panel_supports_deep_color(int fd, char *output_name); uint64_t get_max_bpc(igt_output_t *output); voidpaint_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
PATCH v2 4/9 tests/kms_color: Pass down the colors used to paint the fb
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
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.
--- tests/kms_color.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-)
tests/kms_color.c +18 -7
@@ -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);
Signature · 1 line
2.39.2
Re: [igt-dev] [PATCH i-g-t v2 4/9] tests/kms_color: Pass down the colors used to paint the fb
Quoted 9 lines
-----Original Message-----
From: igt-dev <[email protected]> On Behalf Of Ville Syrjala
Sent: Tuesday, April 11, 2023 9:46 PM
To: [email protected]
Subject: [igt-dev] [PATCH i-g-t v2 4/9] tests/kms_color: Pass down the colors used to paint the fb
Quoted 5 lines
From: Ville Syrjälä <[email protected]>
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.
Quoted 136 lines
Signed-off-by Ville Syrjälä <[email protected]>--- tests/kms_color.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-)tests/kms_color.c index renamed from tests/kms_color.c +0
-0
5c4d884f4de8..e3fe2aea4695100644tests/kms_color.c +2
-6@@ -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);tests/kms_color.c +8
-1/* @@ -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 },tests/kms_color.c +4
-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 },tests/kms_color.c +4
-1{ 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
PATCH v2 5/9 tests/kms_color: Get rid of hand coded "expected_colors"
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
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.
--- tests/kms_color.c | 59 +++++++++++++++++------------------------------ 1 file changed, 21 insertions(+), 38 deletions(-)
tests/kms_color.c +21 -38
@@ -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); }
Signature · 1 line
2.39.2
Re: [igt-dev] [PATCH i-g-t v2 5/9] tests/kms_color: Get rid of hand coded "expected_colors"
Quoted 9 lines
-----Original Message-----
From: igt-dev <[email protected]> On Behalf Of Ville Syrjala
Sent: Tuesday, April 11, 2023 9:46 PM
To: [email protected]
Subject: [igt-dev] [PATCH i-g-t v2 5/9] tests/kms_color: Get rid of hand coded "expected_colors"
Quoted 4 lines
From: Ville Syrjälä <[email protected]>
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.
Quoted 151 lines
Signed-off-by Ville Syrjälä <[email protected]>--- tests/kms_color.c | 59 +++++++++++++++++------------------------------ 1 file changed, 21 insertions(+), 38 deletions(-)tests/kms_color.c index renamed from tests/kms_color.c +0
-0
e3fe2aea4695..d430ee12aaa3100644tests/kms_color.c +17
-11@@ -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)));
tests/kms_color.c +1
-0+ transform_color(&expected_colors[1], ctm, delta * (i - (iter/ 2)));
tests/kms_color.c +1
-0+ transform_color(&expected_colors[2], ctm, delta * (i - (iter/ 2)));
tests/kms_color.c +2
-29+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
PATCH v2 6/9 tests/kms_color: Add and additional "signed" subtest
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
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.
--- tests/kms_color.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
tests/kms_color.c +15 -0
@@ -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;
Signature · 1 line
2.39.2
Re: [igt-dev] [PATCH i-g-t v2 6/9] tests/kms_color: Add and additional "signed" subtest
Quoted 8 lines
-----Original Message-----
From: igt-dev <[email protected]> On Behalf Of Ville Syrjala
Sent: Tuesday, April 11, 2023 9:46 PM
To: [email protected]
Subject: [igt-dev] [PATCH i-g-t v2 6/9] tests/kms_color: Add and additional "signed" subtest
Nit: s/and/an
Quoted 9 lines
From: Ville Syrjälä <[email protected]>
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.
Quoted 41 lines
Signed-off-by Ville Syrjälä <[email protected]>--- tests/kms_color.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)tests/kms_color.c index renamed from tests/kms_color.c +0
-0
d430ee12aaa3..35083122dfbf100644tests/kms_color.c +15
-1@@ -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
PATCH v2 7/9 tests/kms_color: Dump the CTM before/after color values
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
Include the before/after color values in the debug output to help with diagnosing failures.
--- tests/kms_color.c | 8 ++++++++ 1 file changed, 8 insertions(+)
tests/kms_color.c +8 -0
@@ -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);
Signature · 1 line
2.39.2
Re: [igt-dev] [PATCH i-g-t v2 7/9] tests/kms_color: Dump the CTM before/after color values
Quoted 9 lines
-----Original Message-----
From: igt-dev <[email protected]> On Behalf Of Ville Syrjala
Sent: Tuesday, April 11, 2023 9:46 PM
To: [email protected]
Subject: [igt-dev] [PATCH i-g-t v2 7/9] tests/kms_color: Dump the CTM before/after color values
Quoted 4 lines
From: Ville Syrjälä <[email protected]>
Include the before/after color values in the debug output to help with diagnosing failures.
Looks Good to me.
Quoted 30 lines
Signed-off-by Ville Syrjälä <[email protected]>--- tests/kms_color.c | 8 ++++++++ 1 file changed, 8 insertions(+)tests/kms_color.c index renamed from tests/kms_color.c +0
-0
35083122dfbf..1ec097953c9d100644tests/kms_color.c +10
-1@@ -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
PATCH v2 8/9 tests/kms_color: Move dynamic subtests up one level
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
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.
--- tests/kms_color.c | 76 +++++++++++++++++++++++------------------------ 1 file changed, 38 insertions(+), 38 deletions(-)
tests/kms_color.c +38 -38
@@ -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); + } } } }
Signature · 1 line
2.39.2
Re: [igt-dev] [PATCH i-g-t v2 8/9] tests/kms_color: Move dynamic subtests up one level
Quoted 9 lines
-----Original Message-----
From: igt-dev <[email protected]> On Behalf Of Ville Syrjala
Sent: Tuesday, April 11, 2023 9:46 PM
To: [email protected]
Subject: [igt-dev] [PATCH i-g-t v2 8/9] tests/kms_color: Move dynamic subtests up one level
Quoted 4 lines
From: Ville Syrjälä <[email protected]>
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.
Quoted 145 lines
Signed-off-by Ville Syrjälä <[email protected]>--- tests/kms_color.c | 76 +++++++++++++++++++++++------------------------ 1 file changed, 38 insertions(+), 38 deletions(-)tests/kms_color.c index renamed from tests/kms_color.c +0
-0
1ec097953c9d..e35dccea1a61100644tests/kms_color.c +1
-2@@ -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:tests/kms_color.c +24
-27test_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:
tests/kms_color.c +3
-3test_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); + } }tests/kms_color.c +2
-2} }@@ -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);tests/kms_color.c +7
-4+ } } } }@@ -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
PATCH v2 9/9 tests/intel-ci/fast-feedback: Run ctm tests
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
--- tests/intel-ci/fast-feedback.testlist | 11 +++++++++++ 1 file changed, 11 insertions(+)
tests/intel-ci/fast-feedback.testlist +11 -0
@@ -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
Signature · 1 line
2.39.2
Patchwork
CI[igt-dev] ✗ Fi.CI.BAT: failure for tests/kms_color: Improve CTM tests (rev2)
In reply to Ville Syrjala== Series Details ==
== 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@[email protected]
* 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@[email protected]
* {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@[email protected]
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@[email protected]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8780/bat-dg2-11/igt@gem_exec_suspend@[email protected]
* 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@[email protected]
* 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@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8780/bat-adlp-9/igt@i915_selftest@[email protected]
- 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@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8780/bat-dg2-11/igt@i915_selftest@[email protected]
* 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@[email protected]
* 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@[email protected]
- bat-dg1-7: NOTRUN -> [SKIP][13] ([i915#7828])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8780/bat-dg1-7/igt@[email protected]
* 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@[email protected]
* 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@[email protected]
* 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@[email protected]
* 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@[email protected]
- 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@[email protected]
* 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@[email protected]
* 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@[email protected]
* {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@[email protected]
* {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@[email protected]
* 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@[email protected]
* 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@[email protected]
#### 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@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8780/bat-dg1-7/igt@i915_selftest@[email protected]
* 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@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8780/bat-rplp-1/igt@i915_selftest@[email protected]
* 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@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_8780/bat-rpls-1/igt@i915_selftest@[email protected]
{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