Skip to content

Commit ddbe5ae

Browse files
committed
drm/xe/kunit: Drop custom struct platform_test_case
Custom struct platform_test_case definition in xe_wa is now almost identical to generic struct xe_pci_fake_data defintiion except the .name member, which could be generated by xe_pci_fake_data_desc(). Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Link: https://lore.kernel.org/r/20250829171922.572-5-michal.wajdeczko@intel.com
1 parent b1ee655 commit ddbe5ae

File tree

1 file changed

+4
-27
lines changed

1 file changed

+4
-27
lines changed

drivers/gpu/drm/xe/tests/xe_wa_test.c

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,8 @@
1515
#include "xe_tuning.h"
1616
#include "xe_wa.h"
1717

18-
struct platform_test_case {
19-
const char *name;
20-
enum xe_platform platform;
21-
enum xe_subplatform subplatform;
22-
u32 graphics_verx100;
23-
u32 media_verx100;
24-
struct xe_step_info step;
25-
};
26-
2718
#define PLATFORM_CASE(platform__, graphics_step__) \
2819
{ \
29-
.name = #platform__ " (" #graphics_step__ ")", \
3020
.platform = XE_ ## platform__, \
3121
.subplatform = XE_SUBPLATFORM_NONE, \
3222
.step = { .graphics = STEP_ ## graphics_step__ } \
@@ -35,7 +25,6 @@ struct platform_test_case {
3525

3626
#define SUBPLATFORM_CASE(platform__, subplatform__, graphics_step__) \
3727
{ \
38-
.name = #platform__ "_" #subplatform__ " (" #graphics_step__ ")", \
3928
.platform = XE_ ## platform__, \
4029
.subplatform = XE_SUBPLATFORM_ ## platform__ ## _ ## subplatform__, \
4130
.step = { .graphics = STEP_ ## graphics_step__ } \
@@ -44,7 +33,6 @@ struct platform_test_case {
4433
#define GMDID_CASE(platform__, graphics_verx100__, graphics_step__, \
4534
media_verx100__, media_step__) \
4635
{ \
47-
.name = #platform__ " (g:" #graphics_step__ ", m:" #media_step__ ")",\
4836
.platform = XE_ ## platform__, \
4937
.subplatform = XE_SUBPLATFORM_NONE, \
5038
.graphics_verx100 = graphics_verx100__, \
@@ -53,7 +41,7 @@ struct platform_test_case {
5341
.media = STEP_ ## media_step__ } \
5442
}
5543

56-
static const struct platform_test_case cases[] = {
44+
static const struct xe_pci_fake_data cases[] = {
5745
PLATFORM_CASE(TIGERLAKE, B0),
5846
PLATFORM_CASE(DG1, A0),
5947
PLATFORM_CASE(DG1, B0),
@@ -78,23 +66,12 @@ static const struct platform_test_case cases[] = {
7866
GMDID_CASE(PANTHERLAKE, 3000, A0, 3000, A0),
7967
};
8068

81-
static void platform_desc(const struct platform_test_case *t, char *desc)
82-
{
83-
strscpy(desc, t->name, KUNIT_PARAM_DESC_SIZE);
84-
}
85-
86-
KUNIT_ARRAY_PARAM(platform, cases, platform_desc);
69+
KUNIT_ARRAY_PARAM(platform, cases, xe_pci_fake_data_desc);
8770

8871
static int xe_wa_test_init(struct kunit *test)
8972
{
90-
const struct platform_test_case *param = test->param_value;
91-
struct xe_pci_fake_data data = {
92-
.platform = param->platform,
93-
.subplatform = param->subplatform,
94-
.graphics_verx100 = param->graphics_verx100,
95-
.media_verx100 = param->media_verx100,
96-
.step = param->step,
97-
};
73+
const struct xe_pci_fake_data *param = test->param_value;
74+
struct xe_pci_fake_data data = *param;
9875
struct xe_device *xe;
9976
struct device *dev;
10077
int ret;

0 commit comments

Comments
 (0)