From: Gustavo Sousa <gustavo.sousa@intel.com>
To: Violet Monti <violet.monti@intel.com>, <intel-xe@lists.freedesktop.org>
Cc: Violet Monti <violet.monti@intel.com>
Subject: Re: [PATCH 3/4] drm/xe/rtp: Add OOB WAs rule checking
Date: Mon, 18 May 2026 17:54:26 -0300 [thread overview]
Message-ID: <87zf1wqvzx.fsf@intel.com> (raw)
In-Reply-To: <20260513212129.691628-9-violet.monti@intel.com>
Same comments from previous patch about commit title and body applies
here.
Violet Monti <violet.monti@intel.com> writes:
> This commit builds on the implementation of the GT WA testing, increasing
> the scope of testing to include the OOB workaround list. The added test
> checks for workarounds with an engine_class rule, and raises an expectation
> failure if any are found. Unlike the GT workarounds, there are no flags
> within this workaround list, so all engine_class rules will fail.
>
> This test prevents future implementation of rules that would apply an
> engine_class rule without an active engine in context, preventing rule
> errors or mishaps.
>
> Signed-off-by: Violet Monti <violet.monti@intel.com>
> ---
> drivers/gpu/drm/xe/tests/xe_rtp_tables_test.c | 20 +++++++++++++++++++
> drivers/gpu/drm/xe/xe_wa.c | 2 +-
> drivers/gpu/drm/xe/xe_wa.h | 1 +
> 3 files changed, 22 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/xe/tests/xe_rtp_tables_test.c b/drivers/gpu/drm/xe/tests/xe_rtp_tables_test.c
> index 100cac379b08..eae3262775bb 100644
> --- a/drivers/gpu/drm/xe/tests/xe_rtp_tables_test.c
> +++ b/drivers/gpu/drm/xe/tests/xe_rtp_tables_test.c
> @@ -24,6 +24,18 @@ static void xe_rtp_table_gt_test(struct kunit *test)
> }
> }
>
> +static void xe_rtp_table_oob_test(struct kunit *test)
> +{
> + const struct xe_rtp_entry *param = test->param_value;
> +
> + for (int i = 0; i < param->n_rules; i++) {
> + KUNIT_EXPECT_NE_MSG(test, param->rules[i].match_type,
> + XE_RTP_MATCH_ENGINE_CLASS,
> + "OOB_WA %s has an engine class rule",
> + param->name);
Like with the previous patch, I think we could simplify by using
something like
KUNIT_EXPECT_NE(test, param->rules[i].match_type,
XE_RTP_MATCH_ENGINE_CLASS)
> + }
> +}
> +
> static int xe_rtp_table_test_init(struct kunit *test)
> {
> struct xe_device *xe;
> @@ -61,8 +73,16 @@ static void rtp_table_gt_test_desc(const struct xe_rtp_entry_sr *t, char *desc)
>
> RTP_KUNIT_ARRAY_PARAM(rtp_table_gt, gt_was, rtp_table_gt_test_desc);
>
> +static void rtp_table_oob_test_desc(const struct xe_rtp_entry *t, char *desc)
> +{
> + strscpy(desc, t->name, KUNIT_PARAM_DESC_SIZE);
> +}
> +
> +RTP_KUNIT_ARRAY_PARAM(rtp_table_oob, oob_was, rtp_table_oob_test_desc);
> +
> static struct kunit_case xe_rtp_table_tests[] = {
> KUNIT_CASE_PARAM(xe_rtp_table_gt_test, rtp_table_gt_gen_params),
> + KUNIT_CASE_PARAM(xe_rtp_table_oob_test, rtp_table_oob_gen_params),
Yeah. It is unfortunate that we need 2 different functions here. I think
in the future we could try to have a single way of expressing RTP entries
instead of having two different struct types (xe_rtp_entry vs
xe_rtp_entry_sr). That would allow us to unify code specific for
processing rules in those entries.
--
Gustavo Sousa
> {}
> };
>
> diff --git a/drivers/gpu/drm/xe/xe_wa.c b/drivers/gpu/drm/xe/xe_wa.c
> index 285072fe0a47..5744bd3f8be9 100644
> --- a/drivers/gpu/drm/xe/xe_wa.c
> +++ b/drivers/gpu/drm/xe/xe_wa.c
> @@ -802,7 +802,7 @@ static const struct xe_rtp_entry oob_was_entries[] = {
>
> static_assert(ARRAY_SIZE(oob_was_entries) == _XE_WA_OOB_COUNT);
>
> -static __maybe_unused const struct xe_rtp_table oob_was = {
> +VISIBLE_IF_KUNIT __maybe_unused const struct xe_rtp_table oob_was = {
> .entries = oob_was_entries,
> .n_entries = ARRAY_SIZE(oob_was_entries),
> };
> diff --git a/drivers/gpu/drm/xe/xe_wa.h b/drivers/gpu/drm/xe/xe_wa.h
> index 17dff615e507..7ac6d365b65f 100644
> --- a/drivers/gpu/drm/xe/xe_wa.h
> +++ b/drivers/gpu/drm/xe/xe_wa.h
> @@ -27,6 +27,7 @@ int xe_wa_gt_dump(struct xe_gt *gt, struct drm_printer *p);
>
> #if IS_ENABLED(CONFIG_DRM_XE_KUNIT_TEST)
> extern VISIBLE_IF_KUNIT const struct xe_rtp_table_sr gt_was;
> +extern VISIBLE_IF_KUNIT __maybe_unused const struct xe_rtp_table oob_was;
> #endif
>
> /**
> --
> 2.43.0
next prev parent reply other threads:[~2026-05-18 20:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-13 21:21 [PATCH 0/4] drm/xe/rtp: WA table context testing Violet Monti
2026-05-13 21:21 ` [PATCH 1/4] drm/xe/rtp: Add struct types for RTP tables Violet Monti
2026-05-13 21:21 ` [PATCH 2/4] drm/xe/rtp: Add GT WAs rule checking Violet Monti
2026-05-18 20:20 ` Gustavo Sousa
2026-05-18 20:44 ` Gustavo Sousa
2026-05-18 22:14 ` Violet Monti
2026-05-13 21:21 ` [PATCH 3/4] drm/xe/rtp: Add OOB " Violet Monti
2026-05-18 20:54 ` Gustavo Sousa [this message]
2026-05-18 22:24 ` Violet Monti
2026-05-13 21:21 ` [PATCH 4/4] drm/xe/rtp: Add Device OOB WA checks Violet Monti
2026-05-13 21:28 ` ✗ CI.checkpatch: warning for drm/xe/rtp: WA table context testing Patchwork
2026-05-13 21:29 ` ✓ CI.KUnit: success " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zf1wqvzx.fsf@intel.com \
--to=gustavo.sousa@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=violet.monti@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.