[Intel-xe] [PATCH 3/3] drm/xe/kunit: Test WAs for MTL and LNL

Lucas De Marchi lucas.demarchi at intel.com
Mon Nov 20 18:30:03 UTC 2023


On Fri, Nov 17, 2023 at 04:31:35PM -0800, Matt Roper wrote:
>On Fri, Nov 17, 2023 at 03:14:11PM -0800, Lucas De Marchi wrote:
>> Now that the kunit infra has proper support for GMD_ID platforms, add a
>> few variants of MTL and LNL.
>>
>> Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
>> ---
>>  drivers/gpu/drm/xe/tests/xe_wa_test.c | 34 ++++++++++++++++++++++++++-
>>  1 file changed, 33 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/xe/tests/xe_wa_test.c b/drivers/gpu/drm/xe/tests/xe_wa_test.c
>> index 9185e520af58..458ad725802d 100644
>> --- a/drivers/gpu/drm/xe/tests/xe_wa_test.c
>> +++ b/drivers/gpu/drm/xe/tests/xe_wa_test.c
>> @@ -18,6 +18,8 @@ struct platform_test_case {
>>  	const char *name;
>>  	enum xe_platform platform;
>>  	enum xe_subplatform subplatform;
>> +	u32 graphics_verx100;
>> +	u32 media_verx100;
>>  	struct xe_step_info step;
>>  };
>>
>> @@ -38,6 +40,18 @@ struct platform_test_case {
>>  		.step = { .graphics = STEP_ ## graphics_step__ }			\
>>  	}
>>
>> +#define GMDID_CASE(platform__, graphics_verx100__, graphics_step__,		\
>> +		   media_verx100__, media_step__)				\
>> +	{									\
>> +		.name = #platform__ " (g:" #graphics_step__ ", m:" #media_step__ ")",\
>> +		.platform = XE_ ## platform__,					\
>> +		.subplatform = XE_SUBPLATFORM_NONE,				\
>> +		.graphics_verx100 = graphics_verx100__,				\
>> +		.media_verx100 = media_verx100__,				\
>> +		.step = { .graphics = STEP_ ## graphics_step__,			\
>> +			   .media = STEP_ ## media_step__ }			\
>> +	}
>> +
>>  static const struct platform_test_case cases[] = {
>>  	PLATFORM_CASE(TIGERLAKE, B0),
>>  	PLATFORM_CASE(DG1, A0),
>> @@ -63,6 +77,10 @@ static const struct platform_test_case cases[] = {
>>  	PLATFORM_CASE(PVC, B0),
>>  	PLATFORM_CASE(PVC, B1),
>>  	PLATFORM_CASE(PVC, C0),
>> +	GMDID_CASE(METEORLAKE, 1270, A0, 1300, A0),
>> +	GMDID_CASE(METEORLAKE, 1271, A0, 1300, A0),
>> +	GMDID_CASE(LUNARLAKE, 2004, A0, 2000, A0),
>> +	GMDID_CASE(LUNARLAKE, 2004, B0, 2000, A0),
>>  };
>>
>>  static void platform_desc(const struct platform_test_case *t, char *desc)
>> @@ -78,11 +96,24 @@ static int xe_wa_test_init(struct kunit *test)
>>  	struct xe_pci_fake_data data = {
>>  		.platform = param->platform,
>>  		.subplatform = param->subplatform,
>> +		.graphics_verx100 = param->graphics_verx100,
>> +		.media_verx100 = param->media_verx100,
>> +		.graphics_step = param->step.graphics,
>> +		.media_step = param->step.media,
>>  	};
>>  	struct xe_device *xe;
>>  	struct device *dev;
>>  	int ret;
>>
>> +	/*
>> +	 * Make sure graphics/media version are only ever set together - only
>> +	 * GMDID platforms should have that
>> +	 */
>> +	if (param->graphics_verx100) {
>> +		KUNIT_ASSERT_TRUE(test, param->media_verx100);
>> +		KUNIT_ASSERT_TRUE(test, param->step.media > STEP_NONE);
>> +	}
>
>This is true for now (MTL / LNL), but what if a future platform is like
>PVC and doesn't have any media at all?

what I tried to handle here is a wrong use of GMDID_CASE(), but failed
miserably.

>
>It seems like the opposite is more useful to test (if media version is
>set, then make sure graphics is also set) since it seems less likely
>that we'd have a "media only" platform with no graphics.

yeah, maybe as a separate patch...

thanks
Lucas De Marchi

>
>
>Matt
>
>> +
>>  	dev = drm_kunit_helper_alloc_device(test);
>>  	KUNIT_ASSERT_NOT_ERR_OR_NULL(test, dev);
>>
>> @@ -95,7 +126,8 @@ static int xe_wa_test_init(struct kunit *test)
>>  	ret = xe_pci_fake_device_init(xe);
>>  	KUNIT_ASSERT_EQ(test, ret, 0);
>>
>> -	xe->info.step = param->step;
>> +	if (!param->graphics_verx100)
>> +		xe->info.step = param->step;
>>
>>  	/* TODO: init hw engines for engine/LRC WAs */
>>  	xe->drm.dev = dev;
>> --
>> 2.40.1
>>
>
>-- 
>Matt Roper
>Graphics Software Engineer
>Linux GPU Platform Enablement
>Intel Corporation


More information about the Intel-xe mailing list