Commit 8356b979 authored by Arthur Grillo's avatar Arthur Grillo Committed by Maíra Canal

drm/test: Add test cases for drm_rect_rotate_inv()

Insert a parameterized test for the drm_rect_rotate_inv() to ensure its
correctness and prevent future regressions. The test covers all rotation
modes.

It uses the same test cases from drm_test_rect_rotate().
Signed-off-by: default avatarArthur Grillo <arthurgrillo@riseup.net>
Reviewed-by: default avatarMaíra Canal <mcanal@igalia.com>
Signed-off-by: default avatarMaíra Canal <mairacanal@riseup.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20230418230146.461129-6-arthurgrillo@riseup.net
parent b5d88ec0
...@@ -496,6 +496,16 @@ static void drm_test_rect_rotate(struct kunit *test) ...@@ -496,6 +496,16 @@ static void drm_test_rect_rotate(struct kunit *test)
drm_rect_compare(test, &r, &params->expected); drm_rect_compare(test, &r, &params->expected);
} }
static void drm_test_rect_rotate_inv(struct kunit *test)
{
const struct drm_rect_rotate_case *params = test->param_value;
struct drm_rect r = params->expected;
drm_rect_rotate_inv(&r, params->width, params->height, params->rotation);
drm_rect_compare(test, &r, &params->rect);
}
static struct kunit_case drm_rect_tests[] = { static struct kunit_case drm_rect_tests[] = {
KUNIT_CASE(drm_test_rect_clip_scaled_div_by_zero), KUNIT_CASE(drm_test_rect_clip_scaled_div_by_zero),
KUNIT_CASE(drm_test_rect_clip_scaled_not_clipped), KUNIT_CASE(drm_test_rect_clip_scaled_not_clipped),
...@@ -505,6 +515,7 @@ static struct kunit_case drm_rect_tests[] = { ...@@ -505,6 +515,7 @@ static struct kunit_case drm_rect_tests[] = {
KUNIT_CASE_PARAM(drm_test_rect_calc_hscale, drm_rect_scale_gen_params), KUNIT_CASE_PARAM(drm_test_rect_calc_hscale, drm_rect_scale_gen_params),
KUNIT_CASE_PARAM(drm_test_rect_calc_vscale, drm_rect_scale_gen_params), KUNIT_CASE_PARAM(drm_test_rect_calc_vscale, drm_rect_scale_gen_params),
KUNIT_CASE_PARAM(drm_test_rect_rotate, drm_rect_rotate_gen_params), KUNIT_CASE_PARAM(drm_test_rect_rotate, drm_rect_rotate_gen_params),
KUNIT_CASE_PARAM(drm_test_rect_rotate_inv, drm_rect_rotate_gen_params),
{ } { }
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment