summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMelissa Wen <mwen@igalia.com>2022-05-30 10:20:45 -0100
committerRodrigo Siqueira <Rodrigo.Siqueira@amd.com>2022-05-30 14:35:11 -0400
commitde4c6076a0f38ad3522b08931748f59d59a925ce (patch)
tree0740c14e83feeba44f82f793e34f986d6bf4e988
parent0759259260a5f0b8121f51627a949cdfe516bb4a (diff)
test/kms_plane_alpha_blend: clearer validation for coverage-7efc
Inspired by previous change in alpha-7efc[1], get a clearer validation for the swappable property of plane_alpha and fg.alpha in the coverage blend formula. Get rid of the 8-increment alpha loop by refactoring coverage-7efc to a one-shot assert format, avoiding doubts related to bit precision and rounding issue. [1] Commit f9efaee9565f ("tests/kms_plane_alpha_blend: refactor alpha-7efc for clearer validation") v2: - add commit reference to alpha-7efc change Signed-off-by: Melissa Wen <mwen@igalia.com> Reviewed-by: Sung Joon Kim <sungkim@amd.com>
-rw-r--r--tests/kms_plane_alpha_blend.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/tests/kms_plane_alpha_blend.c b/tests/kms_plane_alpha_blend.c
index 8e54dfd6..bd064d1e 100644
--- a/tests/kms_plane_alpha_blend.c
+++ b/tests/kms_plane_alpha_blend.c
@@ -413,27 +413,24 @@ static void coverage_7efc(data_t *data, enum pipe pipe, igt_plane_t *plane)
{
igt_display_t *display = &data->display;
igt_crc_t ref_crc = {}, crc = {};
- int i;
igt_require(igt_plane_try_prop_enum(plane, IGT_PLANE_PIXEL_BLEND_MODE, "Coverage"));
igt_display_commit2(display, COMMIT_ATOMIC);
igt_pipe_crc_start(data->pipe_crc);
/* for coverage, plane alpha and fb alpha should be swappable, so swap fb and alpha */
- for (i = 0; i < 256; i += 8) {
- igt_plane_set_prop_value(plane, IGT_PLANE_ALPHA, ((i/2) << 8) | (i/2));
- igt_plane_set_fb(plane, &data->argb_fb_cov_fc);
- igt_display_commit2(display, COMMIT_ATOMIC);
+ igt_plane_set_prop_value(plane, IGT_PLANE_ALPHA, 0x7e7e);
+ igt_plane_set_fb(plane, &data->argb_fb_cov_fc);
+ igt_display_commit2(display, COMMIT_ATOMIC);
- igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &ref_crc);
+ igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &ref_crc);
- igt_plane_set_prop_value(plane, IGT_PLANE_ALPHA, (i << 8) | i);
- igt_plane_set_fb(plane, &data->argb_fb_cov_7e);
- igt_display_commit2(display, COMMIT_ATOMIC);
+ igt_plane_set_prop_value(plane, IGT_PLANE_ALPHA, 0xfcfc);
+ igt_plane_set_fb(plane, &data->argb_fb_cov_7e);
+ igt_display_commit2(display, COMMIT_ATOMIC);
- igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &crc);
- igt_assert_crc_equal(&ref_crc, &crc);
- }
+ igt_pipe_crc_get_current(display->drm_fd, data->pipe_crc, &crc);
+ igt_assert_crc_equal(&ref_crc, &crc);
igt_pipe_crc_stop(data->pipe_crc);
}
@@ -537,7 +534,8 @@ static void run_subtests(data_t *data, enum pipe pipe)
igt_subtest_f("pipe-%s-alpha-7efc", kmstest_pipe_name(pipe))
run_test_on_pipe_planes(data, pipe, false, true, alpha_7efc);
- igt_describe("Tests pipe coverage blending properties.");
+ igt_describe("Uses alpha values 0x7e and 0xfc to validate fg.alpha and "
+ "plane_alpha are swappable on coverage blend mode.");
igt_subtest_f("pipe-%s-coverage-7efc", kmstest_pipe_name(pipe))
run_test_on_pipe_planes(data, pipe, true, true, coverage_7efc);