[igt-dev] [PATCH i-g-t 3/3] tests/kms_cursor_crc: Test maximum cursor size

Lyude Paul lyude at redhat.com
Wed Mar 24 20:19:00 UTC 2021


On Wed, 2021-03-24 at 20:17 +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> 
> Run the standard set of tests using the max cursor size
> if the other tests didn't already cover it.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> ---
>  tests/kms_cursor_crc.c | 29 ++++++++++++++++++++++++-----
>  1 file changed, 24 insertions(+), 5 deletions(-)
> 
> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
> index 5f3eeaa0c5ac..525e6952f1a5 100644
> --- a/tests/kms_cursor_crc.c
> +++ b/tests/kms_cursor_crc.c
> @@ -666,32 +666,49 @@ 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(w != h || w > 512 || h > 512 ||
> +                                   !is_power_of_two(w) ||
> !is_power_of_two(h));

IMO I think we should use igt_require_f() here so we can print a message
explaining this is covered by other tests. Other then that, this whole patch
series is:

Reviewed-by: Lyude Paul <lyude at redhat.com>
> +               }
>                 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 +777,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;

-- 
Sincerely,
   Lyude Paul (she/her)
   Software Engineer at Red Hat
   
Note: I deal with a lot of emails and have a lot of bugs on my plate. If you've
asked me a question, are waiting for a review/merge on a patch, etc. and I
haven't responded in a while, please feel free to send me another email to check
on my status. I don't bite!



More information about the igt-dev mailing list