Commit 961bcdf9 authored by Maíra Canal's avatar Maíra Canal

drm/tests: Change "igt_" prefix to "drm_test_"

With the introduction of KUnit, IGT is no longer the only option to run
the DRM unit tests, as the tests can be run through kunit-tool or on
real hardware with CONFIG_KUNIT.

Therefore, remove the "igt_" prefix from the tests and replace it with
the "drm_test_" prefix, making the tests' names independent from the tool
used.
Signed-off-by: default avatarMaíra Canal <mairacanal@riseup.net>
Acked-by: default avatarDavid Gow <davidgow@google.com>
Acked-by: default avatarMaxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20220911191756.203118-2-mairacanal@riseup.net
parent b167259a
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include "../lib/drm_random.h" #include "../lib/drm_random.h"
#define IGT_TIMEOUT(name__) \ #define TIMEOUT(name__) \
unsigned long name__ = jiffies + MAX_SCHEDULE_TIMEOUT unsigned long name__ = jiffies + MAX_SCHEDULE_TIMEOUT
static unsigned int random_seed; static unsigned int random_seed;
...@@ -24,7 +24,7 @@ static inline u64 get_size(int order, u64 chunk_size) ...@@ -24,7 +24,7 @@ static inline u64 get_size(int order, u64 chunk_size)
} }
__printf(2, 3) __printf(2, 3)
static bool __igt_timeout(unsigned long timeout, const char *fmt, ...) static bool __timeout(unsigned long timeout, const char *fmt, ...)
{ {
va_list va; va_list va;
...@@ -43,7 +43,7 @@ static bool __igt_timeout(unsigned long timeout, const char *fmt, ...) ...@@ -43,7 +43,7 @@ static bool __igt_timeout(unsigned long timeout, const char *fmt, ...)
return true; return true;
} }
static void __igt_dump_block(struct kunit *test, struct drm_buddy *mm, static void __dump_block(struct kunit *test, struct drm_buddy *mm,
struct drm_buddy_block *block, bool buddy) struct drm_buddy_block *block, bool buddy)
{ {
kunit_err(test, "block info: header=%llx, state=%u, order=%d, offset=%llx size=%llx root=%d buddy=%d\n", kunit_err(test, "block info: header=%llx, state=%u, order=%d, offset=%llx size=%llx root=%d buddy=%d\n",
...@@ -52,19 +52,19 @@ static void __igt_dump_block(struct kunit *test, struct drm_buddy *mm, ...@@ -52,19 +52,19 @@ static void __igt_dump_block(struct kunit *test, struct drm_buddy *mm,
drm_buddy_block_size(mm, block), !block->parent, buddy); drm_buddy_block_size(mm, block), !block->parent, buddy);
} }
static void igt_dump_block(struct kunit *test, struct drm_buddy *mm, static void dump_block(struct kunit *test, struct drm_buddy *mm,
struct drm_buddy_block *block) struct drm_buddy_block *block)
{ {
struct drm_buddy_block *buddy; struct drm_buddy_block *buddy;
__igt_dump_block(test, mm, block, false); __dump_block(test, mm, block, false);
buddy = drm_get_buddy(block); buddy = drm_get_buddy(block);
if (buddy) if (buddy)
__igt_dump_block(test, mm, buddy, true); __dump_block(test, mm, buddy, true);
} }
static int igt_check_block(struct kunit *test, struct drm_buddy *mm, static int check_block(struct kunit *test, struct drm_buddy *mm,
struct drm_buddy_block *block) struct drm_buddy_block *block)
{ {
struct drm_buddy_block *buddy; struct drm_buddy_block *buddy;
...@@ -137,7 +137,7 @@ static int igt_check_block(struct kunit *test, struct drm_buddy *mm, ...@@ -137,7 +137,7 @@ static int igt_check_block(struct kunit *test, struct drm_buddy *mm,
return err; return err;
} }
static int igt_check_blocks(struct kunit *test, struct drm_buddy *mm, static int check_blocks(struct kunit *test, struct drm_buddy *mm,
struct list_head *blocks, u64 expected_size, bool is_contiguous) struct list_head *blocks, u64 expected_size, bool is_contiguous)
{ {
struct drm_buddy_block *block; struct drm_buddy_block *block;
...@@ -150,7 +150,7 @@ static int igt_check_blocks(struct kunit *test, struct drm_buddy *mm, ...@@ -150,7 +150,7 @@ static int igt_check_blocks(struct kunit *test, struct drm_buddy *mm,
total = 0; total = 0;
list_for_each_entry(block, blocks, link) { list_for_each_entry(block, blocks, link) {
err = igt_check_block(test, mm, block); err = check_block(test, mm, block);
if (!drm_buddy_block_is_allocated(block)) { if (!drm_buddy_block_is_allocated(block)) {
kunit_err(test, "block not allocated\n"); kunit_err(test, "block not allocated\n");
...@@ -190,16 +190,16 @@ static int igt_check_blocks(struct kunit *test, struct drm_buddy *mm, ...@@ -190,16 +190,16 @@ static int igt_check_blocks(struct kunit *test, struct drm_buddy *mm,
if (prev) { if (prev) {
kunit_err(test, "prev block, dump:\n"); kunit_err(test, "prev block, dump:\n");
igt_dump_block(test, mm, prev); dump_block(test, mm, prev);
} }
kunit_err(test, "bad block, dump:\n"); kunit_err(test, "bad block, dump:\n");
igt_dump_block(test, mm, block); dump_block(test, mm, block);
return err; return err;
} }
static int igt_check_mm(struct kunit *test, struct drm_buddy *mm) static int check_mm(struct kunit *test, struct drm_buddy *mm)
{ {
struct drm_buddy_block *root; struct drm_buddy_block *root;
struct drm_buddy_block *prev; struct drm_buddy_block *prev;
...@@ -233,7 +233,7 @@ static int igt_check_mm(struct kunit *test, struct drm_buddy *mm) ...@@ -233,7 +233,7 @@ static int igt_check_mm(struct kunit *test, struct drm_buddy *mm)
break; break;
} }
err = igt_check_block(test, mm, root); err = check_block(test, mm, root);
if (!drm_buddy_block_is_free(root)) { if (!drm_buddy_block_is_free(root)) {
kunit_err(test, "root not free\n"); kunit_err(test, "root not free\n");
...@@ -289,18 +289,18 @@ static int igt_check_mm(struct kunit *test, struct drm_buddy *mm) ...@@ -289,18 +289,18 @@ static int igt_check_mm(struct kunit *test, struct drm_buddy *mm)
if (prev) { if (prev) {
kunit_err(test, "prev root(%u), dump:\n", i - 1); kunit_err(test, "prev root(%u), dump:\n", i - 1);
igt_dump_block(test, mm, prev); dump_block(test, mm, prev);
} }
if (root) { if (root) {
kunit_err(test, "bad root(%u), dump:\n", i); kunit_err(test, "bad root(%u), dump:\n", i);
igt_dump_block(test, mm, root); dump_block(test, mm, root);
} }
return err; return err;
} }
static void igt_mm_config(u64 *size, u64 *chunk_size) static void mm_config(u64 *size, u64 *chunk_size)
{ {
DRM_RND_STATE(prng, random_seed); DRM_RND_STATE(prng, random_seed);
u32 s, ms; u32 s, ms;
...@@ -321,7 +321,7 @@ static void igt_mm_config(u64 *size, u64 *chunk_size) ...@@ -321,7 +321,7 @@ static void igt_mm_config(u64 *size, u64 *chunk_size)
*size = (u64)s << 12; *size = (u64)s << 12;
} }
static void igt_buddy_alloc_pathological(struct kunit *test) static void drm_test_buddy_alloc_pathological(struct kunit *test)
{ {
u64 mm_size, size, start = 0; u64 mm_size, size, start = 0;
struct drm_buddy_block *block; struct drm_buddy_block *block;
...@@ -402,7 +402,7 @@ static void igt_buddy_alloc_pathological(struct kunit *test) ...@@ -402,7 +402,7 @@ static void igt_buddy_alloc_pathological(struct kunit *test)
drm_buddy_fini(&mm); drm_buddy_fini(&mm);
} }
static void igt_buddy_alloc_smoke(struct kunit *test) static void drm_test_buddy_alloc_smoke(struct kunit *test)
{ {
u64 mm_size, chunk_size, start = 0; u64 mm_size, chunk_size, start = 0;
unsigned long flags = 0; unsigned long flags = 0;
...@@ -411,9 +411,9 @@ static void igt_buddy_alloc_smoke(struct kunit *test) ...@@ -411,9 +411,9 @@ static void igt_buddy_alloc_smoke(struct kunit *test)
int i; int i;
DRM_RND_STATE(prng, random_seed); DRM_RND_STATE(prng, random_seed);
IGT_TIMEOUT(end_time); TIMEOUT(end_time);
igt_mm_config(&mm_size, &chunk_size); mm_config(&mm_size, &chunk_size);
KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_init(&mm, mm_size, chunk_size), KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_init(&mm, mm_size, chunk_size),
"buddy_init failed\n"); "buddy_init failed\n");
...@@ -430,7 +430,7 @@ static void igt_buddy_alloc_smoke(struct kunit *test) ...@@ -430,7 +430,7 @@ static void igt_buddy_alloc_smoke(struct kunit *test)
LIST_HEAD(tmp); LIST_HEAD(tmp);
int order, err; int order, err;
KUNIT_ASSERT_FALSE_MSG(test, igt_check_mm(test, &mm), KUNIT_ASSERT_FALSE_MSG(test, check_mm(test, &mm),
"pre-mm check failed, abort\n"); "pre-mm check failed, abort\n");
order = max_order; order = max_order;
...@@ -466,19 +466,19 @@ static void igt_buddy_alloc_smoke(struct kunit *test) ...@@ -466,19 +466,19 @@ static void igt_buddy_alloc_smoke(struct kunit *test)
total += drm_buddy_block_size(&mm, block); total += drm_buddy_block_size(&mm, block);
if (__igt_timeout(end_time, NULL)) { if (__timeout(end_time, NULL)) {
timeout = true; timeout = true;
break; break;
} }
} while (total < mm.size); } while (total < mm.size);
if (!err) if (!err)
err = igt_check_blocks(test, &mm, &blocks, total, false); err = check_blocks(test, &mm, &blocks, total, false);
drm_buddy_free_list(&mm, &blocks); drm_buddy_free_list(&mm, &blocks);
if (!err) { if (!err) {
KUNIT_EXPECT_FALSE_MSG(test, igt_check_mm(test, &mm), KUNIT_EXPECT_FALSE_MSG(test, check_mm(test, &mm),
"post-mm check failed\n"); "post-mm check failed\n");
} }
...@@ -492,7 +492,7 @@ static void igt_buddy_alloc_smoke(struct kunit *test) ...@@ -492,7 +492,7 @@ static void igt_buddy_alloc_smoke(struct kunit *test)
drm_buddy_fini(&mm); drm_buddy_fini(&mm);
} }
static void igt_buddy_alloc_pessimistic(struct kunit *test) static void drm_test_buddy_alloc_pessimistic(struct kunit *test)
{ {
u64 mm_size, size, start = 0; u64 mm_size, size, start = 0;
struct drm_buddy_block *block, *bn; struct drm_buddy_block *block, *bn;
...@@ -587,7 +587,7 @@ static void igt_buddy_alloc_pessimistic(struct kunit *test) ...@@ -587,7 +587,7 @@ static void igt_buddy_alloc_pessimistic(struct kunit *test)
drm_buddy_fini(&mm); drm_buddy_fini(&mm);
} }
static void igt_buddy_alloc_optimistic(struct kunit *test) static void drm_test_buddy_alloc_optimistic(struct kunit *test)
{ {
u64 mm_size, size, start = 0; u64 mm_size, size, start = 0;
struct drm_buddy_block *block; struct drm_buddy_block *block;
...@@ -633,7 +633,7 @@ static void igt_buddy_alloc_optimistic(struct kunit *test) ...@@ -633,7 +633,7 @@ static void igt_buddy_alloc_optimistic(struct kunit *test)
drm_buddy_fini(&mm); drm_buddy_fini(&mm);
} }
static void igt_buddy_alloc_range(struct kunit *test) static void drm_test_buddy_alloc_range(struct kunit *test)
{ {
unsigned long flags = DRM_BUDDY_RANGE_ALLOCATION; unsigned long flags = DRM_BUDDY_RANGE_ALLOCATION;
u64 offset, size, rem, chunk_size, end; u64 offset, size, rem, chunk_size, end;
...@@ -641,12 +641,12 @@ static void igt_buddy_alloc_range(struct kunit *test) ...@@ -641,12 +641,12 @@ static void igt_buddy_alloc_range(struct kunit *test)
struct drm_buddy mm; struct drm_buddy mm;
LIST_HEAD(blocks); LIST_HEAD(blocks);
igt_mm_config(&size, &chunk_size); mm_config(&size, &chunk_size);
KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_init(&mm, size, chunk_size), KUNIT_ASSERT_FALSE_MSG(test, drm_buddy_init(&mm, size, chunk_size),
"buddy_init failed"); "buddy_init failed");
KUNIT_ASSERT_FALSE_MSG(test, igt_check_mm(test, &mm), KUNIT_ASSERT_FALSE_MSG(test, check_mm(test, &mm),
"pre-mm check failed, abort!"); "pre-mm check failed, abort!");
rem = mm.size; rem = mm.size;
...@@ -671,7 +671,7 @@ static void igt_buddy_alloc_range(struct kunit *test) ...@@ -671,7 +671,7 @@ static void igt_buddy_alloc_range(struct kunit *test)
"alloc_range start offset mismatch, found=%llx, expected=%llx\n", "alloc_range start offset mismatch, found=%llx, expected=%llx\n",
drm_buddy_block_offset(block), offset); drm_buddy_block_offset(block), offset);
KUNIT_ASSERT_FALSE(test, igt_check_blocks(test, &mm, &tmp, size, true)); KUNIT_ASSERT_FALSE(test, check_blocks(test, &mm, &tmp, size, true));
list_splice_tail(&tmp, &blocks); list_splice_tail(&tmp, &blocks);
...@@ -686,12 +686,12 @@ static void igt_buddy_alloc_range(struct kunit *test) ...@@ -686,12 +686,12 @@ static void igt_buddy_alloc_range(struct kunit *test)
drm_buddy_free_list(&mm, &blocks); drm_buddy_free_list(&mm, &blocks);
KUNIT_EXPECT_FALSE_MSG(test, igt_check_mm(test, &mm), "post-mm check failed\n"); KUNIT_EXPECT_FALSE_MSG(test, check_mm(test, &mm), "post-mm check failed\n");
drm_buddy_fini(&mm); drm_buddy_fini(&mm);
} }
static void igt_buddy_alloc_limit(struct kunit *test) static void drm_test_buddy_alloc_limit(struct kunit *test)
{ {
u64 size = U64_MAX, start = 0; u64 size = U64_MAX, start = 0;
struct drm_buddy_block *block; struct drm_buddy_block *block;
...@@ -735,12 +735,12 @@ static int drm_buddy_init_test(struct kunit *test) ...@@ -735,12 +735,12 @@ static int drm_buddy_init_test(struct kunit *test)
} }
static struct kunit_case drm_buddy_tests[] = { static struct kunit_case drm_buddy_tests[] = {
KUNIT_CASE(igt_buddy_alloc_limit), KUNIT_CASE(drm_test_buddy_alloc_limit),
KUNIT_CASE(igt_buddy_alloc_range), KUNIT_CASE(drm_test_buddy_alloc_range),
KUNIT_CASE(igt_buddy_alloc_optimistic), KUNIT_CASE(drm_test_buddy_alloc_optimistic),
KUNIT_CASE(igt_buddy_alloc_pessimistic), KUNIT_CASE(drm_test_buddy_alloc_pessimistic),
KUNIT_CASE(igt_buddy_alloc_smoke), KUNIT_CASE(drm_test_buddy_alloc_smoke),
KUNIT_CASE(igt_buddy_alloc_pathological), KUNIT_CASE(drm_test_buddy_alloc_pathological),
{} {}
}; };
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include "../display/drm_dp_mst_topology_internal.h" #include "../display/drm_dp_mst_topology_internal.h"
static void igt_dp_mst_calc_pbn_mode(struct kunit *test) static void drm_test_dp_mst_calc_pbn_mode(struct kunit *test)
{ {
int pbn, i; int pbn, i;
const struct { const struct {
...@@ -177,7 +177,7 @@ sideband_msg_req_encode_decode(struct drm_dp_sideband_msg_req_body *in) ...@@ -177,7 +177,7 @@ sideband_msg_req_encode_decode(struct drm_dp_sideband_msg_req_body *in)
return result; return result;
} }
static void igt_dp_mst_sideband_msg_req_decode(struct kunit *test) static void drm_test_dp_mst_sideband_msg_req_decode(struct kunit *test)
{ {
struct drm_dp_sideband_msg_req_body in = { 0 }; struct drm_dp_sideband_msg_req_body in = { 0 };
u8 data[] = { 0xff, 0x0, 0xdd }; u8 data[] = { 0xff, 0x0, 0xdd };
...@@ -271,8 +271,8 @@ static void igt_dp_mst_sideband_msg_req_decode(struct kunit *test) ...@@ -271,8 +271,8 @@ static void igt_dp_mst_sideband_msg_req_decode(struct kunit *test)
} }
static struct kunit_case drm_dp_mst_helper_tests[] = { static struct kunit_case drm_dp_mst_helper_tests[] = {
KUNIT_CASE(igt_dp_mst_calc_pbn_mode), KUNIT_CASE(drm_test_dp_mst_calc_pbn_mode),
KUNIT_CASE(igt_dp_mst_sideband_msg_req_decode), KUNIT_CASE(drm_test_dp_mst_sideband_msg_req_decode),
{ } { }
}; };
......
...@@ -192,7 +192,7 @@ static void convert_xrgb8888_case_desc(struct convert_xrgb8888_case *t, ...@@ -192,7 +192,7 @@ static void convert_xrgb8888_case_desc(struct convert_xrgb8888_case *t,
KUNIT_ARRAY_PARAM(convert_xrgb8888, convert_xrgb8888_cases, KUNIT_ARRAY_PARAM(convert_xrgb8888, convert_xrgb8888_cases,
convert_xrgb8888_case_desc); convert_xrgb8888_case_desc);
static void xrgb8888_to_rgb332_test(struct kunit *test) static void drm_test_fb_xrgb8888_to_rgb332(struct kunit *test)
{ {
const struct convert_xrgb8888_case *params = test->param_value; const struct convert_xrgb8888_case *params = test->param_value;
const struct convert_to_rgb332_result *result = &params->rgb332_result; const struct convert_to_rgb332_result *result = &params->rgb332_result;
...@@ -222,7 +222,7 @@ static void xrgb8888_to_rgb332_test(struct kunit *test) ...@@ -222,7 +222,7 @@ static void xrgb8888_to_rgb332_test(struct kunit *test)
KUNIT_EXPECT_EQ(test, memcmp(buf, result->expected, dst_size), 0); KUNIT_EXPECT_EQ(test, memcmp(buf, result->expected, dst_size), 0);
} }
static void xrgb8888_to_rgb565_test(struct kunit *test) static void drm_test_fb_xrgb8888_to_rgb565(struct kunit *test)
{ {
const struct convert_xrgb8888_case *params = test->param_value; const struct convert_xrgb8888_case *params = test->param_value;
const struct convert_to_rgb565_result *result = &params->rgb565_result; const struct convert_to_rgb565_result *result = &params->rgb565_result;
...@@ -256,8 +256,8 @@ static void xrgb8888_to_rgb565_test(struct kunit *test) ...@@ -256,8 +256,8 @@ static void xrgb8888_to_rgb565_test(struct kunit *test)
} }
static struct kunit_case drm_format_helper_test_cases[] = { static struct kunit_case drm_format_helper_test_cases[] = {
KUNIT_CASE_PARAM(xrgb8888_to_rgb332_test, convert_xrgb8888_gen_params), KUNIT_CASE_PARAM(drm_test_fb_xrgb8888_to_rgb332, convert_xrgb8888_gen_params),
KUNIT_CASE_PARAM(xrgb8888_to_rgb565_test, convert_xrgb8888_gen_params), KUNIT_CASE_PARAM(drm_test_fb_xrgb8888_to_rgb565, convert_xrgb8888_gen_params),
{} {}
}; };
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include <drm/drm_fourcc.h> #include <drm/drm_fourcc.h>
static void drm_format_block_width_invalid(struct kunit *test) static void drm_test_format_block_width_invalid(struct kunit *test)
{ {
const struct drm_format_info *info = NULL; const struct drm_format_info *info = NULL;
...@@ -18,7 +18,7 @@ static void drm_format_block_width_invalid(struct kunit *test) ...@@ -18,7 +18,7 @@ static void drm_format_block_width_invalid(struct kunit *test)
KUNIT_EXPECT_EQ(test, drm_format_info_block_width(info, 1), 0); KUNIT_EXPECT_EQ(test, drm_format_info_block_width(info, 1), 0);
} }
static void drm_format_block_width_one_plane(struct kunit *test) static void drm_test_format_block_width_one_plane(struct kunit *test)
{ {
const struct drm_format_info *info = drm_format_info(DRM_FORMAT_XRGB4444); const struct drm_format_info *info = drm_format_info(DRM_FORMAT_XRGB4444);
...@@ -29,7 +29,7 @@ static void drm_format_block_width_one_plane(struct kunit *test) ...@@ -29,7 +29,7 @@ static void drm_format_block_width_one_plane(struct kunit *test)
KUNIT_EXPECT_EQ(test, drm_format_info_block_width(info, -1), 0); KUNIT_EXPECT_EQ(test, drm_format_info_block_width(info, -1), 0);
} }
static void drm_format_block_width_two_plane(struct kunit *test) static void drm_test_format_block_width_two_plane(struct kunit *test)
{ {
const struct drm_format_info *info = drm_format_info(DRM_FORMAT_NV12); const struct drm_format_info *info = drm_format_info(DRM_FORMAT_NV12);
...@@ -41,7 +41,7 @@ static void drm_format_block_width_two_plane(struct kunit *test) ...@@ -41,7 +41,7 @@ static void drm_format_block_width_two_plane(struct kunit *test)
KUNIT_EXPECT_EQ(test, drm_format_info_block_width(info, -1), 0); KUNIT_EXPECT_EQ(test, drm_format_info_block_width(info, -1), 0);
} }
static void drm_format_block_width_three_plane(struct kunit *test) static void drm_test_format_block_width_three_plane(struct kunit *test)
{ {
const struct drm_format_info *info = drm_format_info(DRM_FORMAT_YUV422); const struct drm_format_info *info = drm_format_info(DRM_FORMAT_YUV422);
...@@ -54,7 +54,7 @@ static void drm_format_block_width_three_plane(struct kunit *test) ...@@ -54,7 +54,7 @@ static void drm_format_block_width_three_plane(struct kunit *test)
KUNIT_EXPECT_EQ(test, drm_format_info_block_width(info, -1), 0); KUNIT_EXPECT_EQ(test, drm_format_info_block_width(info, -1), 0);
} }
static void drm_format_block_width_tiled(struct kunit *test) static void drm_test_format_block_width_tiled(struct kunit *test)
{ {
const struct drm_format_info *info = drm_format_info(DRM_FORMAT_X0L0); const struct drm_format_info *info = drm_format_info(DRM_FORMAT_X0L0);
...@@ -65,7 +65,7 @@ static void drm_format_block_width_tiled(struct kunit *test) ...@@ -65,7 +65,7 @@ static void drm_format_block_width_tiled(struct kunit *test)
KUNIT_EXPECT_EQ(test, drm_format_info_block_width(info, -1), 0); KUNIT_EXPECT_EQ(test, drm_format_info_block_width(info, -1), 0);
} }
static void drm_format_block_height_invalid(struct kunit *test) static void drm_test_format_block_height_invalid(struct kunit *test)
{ {
const struct drm_format_info *info = NULL; const struct drm_format_info *info = NULL;
...@@ -74,7 +74,7 @@ static void drm_format_block_height_invalid(struct kunit *test) ...@@ -74,7 +74,7 @@ static void drm_format_block_height_invalid(struct kunit *test)
KUNIT_EXPECT_EQ(test, drm_format_info_block_height(info, 1), 0); KUNIT_EXPECT_EQ(test, drm_format_info_block_height(info, 1), 0);
} }
static void drm_format_block_height_one_plane(struct kunit *test) static void drm_test_format_block_height_one_plane(struct kunit *test)
{ {
const struct drm_format_info *info = drm_format_info(DRM_FORMAT_XRGB4444); const struct drm_format_info *info = drm_format_info(DRM_FORMAT_XRGB4444);
...@@ -85,7 +85,7 @@ static void drm_format_block_height_one_plane(struct kunit *test) ...@@ -85,7 +85,7 @@ static void drm_format_block_height_one_plane(struct kunit *test)
KUNIT_EXPECT_EQ(test, drm_format_info_block_height(info, 1), 0); KUNIT_EXPECT_EQ(test, drm_format_info_block_height(info, 1), 0);
} }
static void drm_format_block_height_two_plane(struct kunit *test) static void drm_test_format_block_height_two_plane(struct kunit *test)
{ {
const struct drm_format_info *info = drm_format_info(DRM_FORMAT_NV12); const struct drm_format_info *info = drm_format_info(DRM_FORMAT_NV12);
...@@ -97,7 +97,7 @@ static void drm_format_block_height_two_plane(struct kunit *test) ...@@ -97,7 +97,7 @@ static void drm_format_block_height_two_plane(struct kunit *test)
KUNIT_EXPECT_EQ(test, drm_format_info_block_height(info, -1), 0); KUNIT_EXPECT_EQ(test, drm_format_info_block_height(info, -1), 0);
} }
static void drm_format_block_height_three_plane(struct kunit *test) static void drm_test_format_block_height_three_plane(struct kunit *test)
{ {
const struct drm_format_info *info = drm_format_info(DRM_FORMAT_YUV422); const struct drm_format_info *info = drm_format_info(DRM_FORMAT_YUV422);
...@@ -110,7 +110,7 @@ static void drm_format_block_height_three_plane(struct kunit *test) ...@@ -110,7 +110,7 @@ static void drm_format_block_height_three_plane(struct kunit *test)
KUNIT_EXPECT_EQ(test, drm_format_info_block_height(info, -1), 0); KUNIT_EXPECT_EQ(test, drm_format_info_block_height(info, -1), 0);
} }
static void drm_format_block_height_tiled(struct kunit *test) static void drm_test_format_block_height_tiled(struct kunit *test)
{ {
const struct drm_format_info *info = drm_format_info(DRM_FORMAT_X0L0); const struct drm_format_info *info = drm_format_info(DRM_FORMAT_X0L0);
...@@ -121,7 +121,7 @@ static void drm_format_block_height_tiled(struct kunit *test) ...@@ -121,7 +121,7 @@ static void drm_format_block_height_tiled(struct kunit *test)
KUNIT_EXPECT_EQ(test, drm_format_info_block_height(info, -1), 0); KUNIT_EXPECT_EQ(test, drm_format_info_block_height(info, -1), 0);
} }
static void drm_format_min_pitch_invalid(struct kunit *test) static void drm_test_format_min_pitch_invalid(struct kunit *test)
{ {
const struct drm_format_info *info = NULL; const struct drm_format_info *info = NULL;
...@@ -130,7 +130,7 @@ static void drm_format_min_pitch_invalid(struct kunit *test) ...@@ -130,7 +130,7 @@ static void drm_format_min_pitch_invalid(struct kunit *test)
KUNIT_EXPECT_EQ(test, drm_format_info_min_pitch(info, 1, 0), 0); KUNIT_EXPECT_EQ(test, drm_format_info_min_pitch(info, 1, 0), 0);
} }
static void drm_format_min_pitch_one_plane_8bpp(struct kunit *test) static void drm_test_format_min_pitch_one_plane_8bpp(struct kunit *test)
{ {
const struct drm_format_info *info = drm_format_info(DRM_FORMAT_RGB332); const struct drm_format_info *info = drm_format_info(DRM_FORMAT_RGB332);
...@@ -153,7 +153,7 @@ static void drm_format_min_pitch_one_plane_8bpp(struct kunit *test) ...@@ -153,7 +153,7 @@ static void drm_format_min_pitch_one_plane_8bpp(struct kunit *test)
(uint64_t)(UINT_MAX - 1)); (uint64_t)(UINT_MAX - 1));
} }
static void drm_format_min_pitch_one_plane_16bpp(struct kunit *test) static void drm_test_format_min_pitch_one_plane_16bpp(struct kunit *test)
{ {
const struct drm_format_info *info = drm_format_info(DRM_FORMAT_XRGB4444); const struct drm_format_info *info = drm_format_info(DRM_FORMAT_XRGB4444);
...@@ -176,7 +176,7 @@ static void drm_format_min_pitch_one_plane_16bpp(struct kunit *test) ...@@ -176,7 +176,7 @@ static void drm_format_min_pitch_one_plane_16bpp(struct kunit *test)
(uint64_t)(UINT_MAX - 1) * 2); (uint64_t)(UINT_MAX - 1) * 2);
} }
static void drm_format_min_pitch_one_plane_24bpp(struct kunit *test) static void drm_test_format_min_pitch_one_plane_24bpp(struct kunit *test)
{ {
const struct drm_format_info *info = drm_format_info(DRM_FORMAT_RGB888); const struct drm_format_info *info = drm_format_info(DRM_FORMAT_RGB888);
...@@ -199,7 +199,7 @@ static void drm_format_min_pitch_one_plane_24bpp(struct kunit *test) ...@@ -199,7 +199,7 @@ static void drm_format_min_pitch_one_plane_24bpp(struct kunit *test)
(uint64_t)(UINT_MAX - 1) * 3); (uint64_t)(UINT_MAX - 1) * 3);
} }
static void drm_format_min_pitch_one_plane_32bpp(struct kunit *test) static void drm_test_format_min_pitch_one_plane_32bpp(struct kunit *test)
{ {
const struct drm_format_info *info = drm_format_info(DRM_FORMAT_ABGR8888); const struct drm_format_info *info = drm_format_info(DRM_FORMAT_ABGR8888);
...@@ -222,7 +222,7 @@ static void drm_format_min_pitch_one_plane_32bpp(struct kunit *test) ...@@ -222,7 +222,7 @@ static void drm_format_min_pitch_one_plane_32bpp(struct kunit *test)
(uint64_t)(UINT_MAX - 1) * 4); (uint64_t)(UINT_MAX - 1) * 4);
} }
static void drm_format_min_pitch_two_plane(struct kunit *test) static void drm_test_format_min_pitch_two_plane(struct kunit *test)
{ {
const struct drm_format_info *info = drm_format_info(DRM_FORMAT_NV12); const struct drm_format_info *info = drm_format_info(DRM_FORMAT_NV12);
...@@ -257,7 +257,7 @@ static void drm_format_min_pitch_two_plane(struct kunit *test) ...@@ -257,7 +257,7 @@ static void drm_format_min_pitch_two_plane(struct kunit *test)
(uint64_t)(UINT_MAX - 1)); (uint64_t)(UINT_MAX - 1));
} }
static void drm_format_min_pitch_three_plane_8bpp(struct kunit *test) static void drm_test_format_min_pitch_three_plane_8bpp(struct kunit *test)
{ {
const struct drm_format_info *info = drm_format_info(DRM_FORMAT_YUV422); const struct drm_format_info *info = drm_format_info(DRM_FORMAT_YUV422);
...@@ -304,7 +304,7 @@ static void drm_format_min_pitch_three_plane_8bpp(struct kunit *test) ...@@ -304,7 +304,7 @@ static void drm_format_min_pitch_three_plane_8bpp(struct kunit *test)
(uint64_t)(UINT_MAX - 1) / 2); (uint64_t)(UINT_MAX - 1) / 2);
} }
static void drm_format_min_pitch_tiled(struct kunit *test) static void drm_test_format_min_pitch_tiled(struct kunit *test)
{ {
const struct drm_format_info *info = drm_format_info(DRM_FORMAT_X0L2); const struct drm_format_info *info = drm_format_info(DRM_FORMAT_X0L2);
...@@ -328,24 +328,24 @@ static void drm_format_min_pitch_tiled(struct kunit *test) ...@@ -328,24 +328,24 @@ static void drm_format_min_pitch_tiled(struct kunit *test)
} }
static struct kunit_case drm_format_tests[] = { static struct kunit_case drm_format_tests[] = {
KUNIT_CASE(drm_format_block_width_invalid), KUNIT_CASE(drm_test_format_block_width_invalid),
KUNIT_CASE(drm_format_block_width_one_plane), KUNIT_CASE(drm_test_format_block_width_one_plane),
KUNIT_CASE(drm_format_block_width_two_plane), KUNIT_CASE(drm_test_format_block_width_two_plane),
KUNIT_CASE(drm_format_block_width_three_plane), KUNIT_CASE(drm_test_format_block_width_three_plane),
KUNIT_CASE(drm_format_block_width_tiled), KUNIT_CASE(drm_test_format_block_width_tiled),
KUNIT_CASE(drm_format_block_height_invalid), KUNIT_CASE(drm_test_format_block_height_invalid),
KUNIT_CASE(drm_format_block_height_one_plane), KUNIT_CASE(drm_test_format_block_height_one_plane),
KUNIT_CASE(drm_format_block_height_two_plane), KUNIT_CASE(drm_test_format_block_height_two_plane),
KUNIT_CASE(drm_format_block_height_three_plane), KUNIT_CASE(drm_test_format_block_height_three_plane),
KUNIT_CASE(drm_format_block_height_tiled), KUNIT_CASE(drm_test_format_block_height_tiled),
KUNIT_CASE(drm_format_min_pitch_invalid), KUNIT_CASE(drm_test_format_min_pitch_invalid),
KUNIT_CASE(drm_format_min_pitch_one_plane_8bpp), KUNIT_CASE(drm_test_format_min_pitch_one_plane_8bpp),
KUNIT_CASE(drm_format_min_pitch_one_plane_16bpp), KUNIT_CASE(drm_test_format_min_pitch_one_plane_16bpp),
KUNIT_CASE(drm_format_min_pitch_one_plane_24bpp), KUNIT_CASE(drm_test_format_min_pitch_one_plane_24bpp),
KUNIT_CASE(drm_format_min_pitch_one_plane_32bpp), KUNIT_CASE(drm_test_format_min_pitch_one_plane_32bpp),
KUNIT_CASE(drm_format_min_pitch_two_plane), KUNIT_CASE(drm_test_format_min_pitch_two_plane),
KUNIT_CASE(drm_format_min_pitch_three_plane_8bpp), KUNIT_CASE(drm_test_format_min_pitch_three_plane_8bpp),
KUNIT_CASE(drm_format_min_pitch_tiled), KUNIT_CASE(drm_test_format_min_pitch_tiled),
{} {}
}; };
......
This diff is collapsed.
...@@ -73,7 +73,7 @@ static bool check_crtc_eq(struct drm_plane_state *plane_state, ...@@ -73,7 +73,7 @@ static bool check_crtc_eq(struct drm_plane_state *plane_state,
return true; return true;
} }
static void igt_check_plane_state(struct kunit *test) static void drm_test_check_plane_state(struct kunit *test)
{ {
int ret; int ret;
...@@ -223,7 +223,7 @@ static void igt_check_plane_state(struct kunit *test) ...@@ -223,7 +223,7 @@ static void igt_check_plane_state(struct kunit *test)
} }
static struct kunit_case drm_plane_helper_test[] = { static struct kunit_case drm_plane_helper_test[] = {
KUNIT_CASE(igt_check_plane_state), KUNIT_CASE(drm_test_check_plane_state),
{} {}
}; };
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include <drm/drm_rect.h> #include <drm/drm_rect.h>
static void igt_drm_rect_clip_scaled_div_by_zero(struct kunit *test) static void drm_test_rect_clip_scaled_div_by_zero(struct kunit *test)
{ {
struct drm_rect src, dst, clip; struct drm_rect src, dst, clip;
bool visible; bool visible;
...@@ -35,7 +35,7 @@ static void igt_drm_rect_clip_scaled_div_by_zero(struct kunit *test) ...@@ -35,7 +35,7 @@ static void igt_drm_rect_clip_scaled_div_by_zero(struct kunit *test)
KUNIT_EXPECT_FALSE_MSG(test, drm_rect_visible(&src), "Source should not be visible\n"); KUNIT_EXPECT_FALSE_MSG(test, drm_rect_visible(&src), "Source should not be visible\n");
} }
static void igt_drm_rect_clip_scaled_not_clipped(struct kunit *test) static void drm_test_rect_clip_scaled_not_clipped(struct kunit *test)
{ {
struct drm_rect src, dst, clip; struct drm_rect src, dst, clip;
bool visible; bool visible;
...@@ -83,7 +83,7 @@ static void igt_drm_rect_clip_scaled_not_clipped(struct kunit *test) ...@@ -83,7 +83,7 @@ static void igt_drm_rect_clip_scaled_not_clipped(struct kunit *test)
KUNIT_EXPECT_TRUE_MSG(test, drm_rect_visible(&src), "Source should be visible\n"); KUNIT_EXPECT_TRUE_MSG(test, drm_rect_visible(&src), "Source should be visible\n");
} }
static void igt_drm_rect_clip_scaled_clipped(struct kunit *test) static void drm_test_rect_clip_scaled_clipped(struct kunit *test)
{ {
struct drm_rect src, dst, clip; struct drm_rect src, dst, clip;
bool visible; bool visible;
...@@ -173,7 +173,7 @@ static void igt_drm_rect_clip_scaled_clipped(struct kunit *test) ...@@ -173,7 +173,7 @@ static void igt_drm_rect_clip_scaled_clipped(struct kunit *test)
KUNIT_EXPECT_TRUE_MSG(test, drm_rect_visible(&src), "Source should be visible\n"); KUNIT_EXPECT_TRUE_MSG(test, drm_rect_visible(&src), "Source should be visible\n");
} }
static void igt_drm_rect_clip_scaled_signed_vs_unsigned(struct kunit *test) static void drm_test_rect_clip_scaled_signed_vs_unsigned(struct kunit *test)
{ {
struct drm_rect src, dst, clip; struct drm_rect src, dst, clip;
bool visible; bool visible;
...@@ -197,10 +197,10 @@ static void igt_drm_rect_clip_scaled_signed_vs_unsigned(struct kunit *test) ...@@ -197,10 +197,10 @@ static void igt_drm_rect_clip_scaled_signed_vs_unsigned(struct kunit *test)
} }
static struct kunit_case drm_rect_tests[] = { static struct kunit_case drm_rect_tests[] = {
KUNIT_CASE(igt_drm_rect_clip_scaled_div_by_zero), KUNIT_CASE(drm_test_rect_clip_scaled_div_by_zero),
KUNIT_CASE(igt_drm_rect_clip_scaled_not_clipped), KUNIT_CASE(drm_test_rect_clip_scaled_not_clipped),
KUNIT_CASE(igt_drm_rect_clip_scaled_clipped), KUNIT_CASE(drm_test_rect_clip_scaled_clipped),
KUNIT_CASE(igt_drm_rect_clip_scaled_signed_vs_unsigned), KUNIT_CASE(drm_test_rect_clip_scaled_signed_vs_unsigned),
{ } { }
}; };
......
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