diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2021-03-24 18:19:50 +0200 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2021-03-30 19:58:10 +0300 |
commit | 1a50676e8a906a517cc8b7a0c79aee6a93ea8299 (patch) | |
tree | 285f27a4afe54610b9602ab0820042eac8028bc1 /tests/kms_cursor_crc.c | |
parent | 9fde7d9e4cedeb668bc5cc75ea73d2c842143d41 (diff) |
tests/kms_cursor_crc: Test maximum cursor size
Run the standard set of tests using the max cursor size
if the other tests didn't already cover it.
v2: Use igt_require_f() to explain why the max-size tests skips (Lyude)
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'tests/kms_cursor_crc.c')
-rw-r--r-- | tests/kms_cursor_crc.c | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c index 5f3eeaa0..2619e15e 100644 --- a/tests/kms_cursor_crc.c +++ b/tests/kms_cursor_crc.c @@ -666,32 +666,51 @@ static void test_rapid_movement(data_t *data) static void run_size_tests(data_t *data, enum pipe pipe, int w, int h) { + char name[16]; + + if (w == 0 && h == 0) + strcpy(name, "max-size"); + else + snprintf(name, sizeof(name), "%dx%d", w, h); + igt_fixture { + if (w == 0 && h == 0) { + w = data->cursor_max_w; + h = data->cursor_max_h; + /* + * No point in doing the "max-size" test if + * it was already covered by the other tests. + */ + igt_require_f(w != h || w > 512 || h > 512 || + !is_power_of_two(w) || !is_power_of_two(h), + "Cursor max size %dx%d already covered by other tests\n", + w, h); + } create_cursor_fb(data, w, h); require_cursor_size(data, w, h); } /* Using created cursor FBs to test cursor support */ igt_describe("Check if a given-size cursor is well-positioned inside the screen."); - igt_subtest_f("pipe-%s-cursor%dx%donscreen", kmstest_pipe_name(pipe), w, h) + igt_subtest_f("pipe-%s-cursor-%s-onscreen", kmstest_pipe_name(pipe), name) run_test(data, test_crc_onscreen, w, h); igt_describe("Check if a given-size cursor is well-positioned outside the " "screen."); - igt_subtest_f("pipe-%s-cursor%dx%doffscreen", kmstest_pipe_name(pipe), w, h) + igt_subtest_f("pipe-%s-cursor-%s-offscreen", kmstest_pipe_name(pipe), name) run_test(data, test_crc_offscreen, w, h); igt_describe("Check the smooth and pixel-by-pixel given-size cursor " "movements on horizontal, vertical and diagonal."); - igt_subtest_f("pipe-%s-cursor%dx%dsliding", kmstest_pipe_name(pipe), w, h) + igt_subtest_f("pipe-%s-cursor-%s-sliding", kmstest_pipe_name(pipe), name) run_test(data, test_crc_sliding, w, h); igt_describe("Check random placement of a cursor with given size."); - igt_subtest_f("pipe-%s-cursor%dx%drandom", kmstest_pipe_name(pipe), w, h) + igt_subtest_f("pipe-%s-cursor-%s-random", kmstest_pipe_name(pipe), name) run_test(data, test_crc_random, w, h); igt_describe("Check the rapid update of given-size cursor movements."); - igt_subtest_f("pipe-%s-cursor%dx%drapid-movement", kmstest_pipe_name(pipe), w, h) + igt_subtest_f("pipe-%s-cursor-%s-rapid-movement", kmstest_pipe_name(pipe), name) run_test(data, test_rapid_movement, w, h); igt_fixture @@ -760,6 +779,8 @@ static void run_tests_on_pipe(data_t *data, enum pipe pipe) igt_subtest_group run_size_tests(data, pipe, w, h); } + + run_size_tests(data, pipe, 0, 0); } static data_t data; |