Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Gustavo Sousa <gustavo.sousa@intel.com>
To: Matt Roper <matthew.d.roper@intel.com>, <intel-xe@lists.freedesktop.org>
Cc: Violet Monti <violet.monti@intel.com>,
	Matt Roper <matthew.d.roper@intel.com>
Subject: Re: [PATCH v2 5/5] drm/xe/rtp: Add kunit tests to exercise FIELD_SET_FUNC action
Date: Wed, 17 Jun 2026 17:13:30 -0300	[thread overview]
Message-ID: <87ik7h0vth.fsf@intel.com> (raw)
In-Reply-To: <20260617-rtp_with_dynamic_vals-v2-5-3f4cb34c2ea1@intel.com>

Matt Roper <matthew.d.roper@intel.com> writes:

> Add a couple additional tests to the RTP kunit suite that ensure
> FIELD_SET_FUNC() actions are evaluated properly and the values properly
> consolidate/conflict with values coming from other literal SET/FIELD_SET
> rules.
>
> Suggested-by: Gustavo Sousa <gustavo.sousa@intel.com>
> Signed-off-by: Matt Roper <matthew.d.roper@intel.com>

Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>

> ---
>  drivers/gpu/drm/xe/tests/xe_rtp_test.c | 52 ++++++++++++++++++++++++++++++++++
>  1 file changed, 52 insertions(+)
>
> diff --git a/drivers/gpu/drm/xe/tests/xe_rtp_test.c b/drivers/gpu/drm/xe/tests/xe_rtp_test.c
> index 3d0688d058d9..367811621880 100644
> --- a/drivers/gpu/drm/xe/tests/xe_rtp_test.c
> +++ b/drivers/gpu/drm/xe/tests/xe_rtp_test.c
> @@ -280,6 +280,11 @@ static void xe_rtp_rules_tests(struct kunit *test)
>  	KUNIT_EXPECT_EQ(test, err, param->expected_err);
>  }
>  
> +static u32 bits_2_3_set(struct xe_gt *gt, struct xe_hw_engine *hwe)
> +{
> +	return REG_BIT(2) | REG_BIT(3);
> +}
> +
>  static const struct rtp_to_sr_test_case rtp_to_sr_cases[] = {
>  	{
>  		.name = "coalesce-same-reg",
> @@ -300,6 +305,29 @@ static const struct rtp_to_sr_test_case rtp_to_sr_cases[] = {
>  			},
>  		),
>  	},
> +	{
> +		.name = "coalesce-same-reg-literal-and-func",
> +		.expected_reg = REGULAR_REG1,
> +		.expected_set_bits = REG_BIT(0) | REG_BIT(1) | REG_BIT(2) | REG_BIT(3),
> +		.expected_clr_bits = REG_BIT(0) | REG_BIT(1) | REG_BIT(2) | REG_BIT(3),
> +		.expected_active = BIT(0) | BIT(1),
> +		.expected_count_sr_entries = 1,
> +		/* Different bits on the same register: create a single entry */
> +		.table = XE_RTP_TABLE_SR(
> +			{ XE_RTP_NAME("basic-1"),
> +			  XE_RTP_RULES(FUNC(match_yes)),
> +			  XE_RTP_ACTIONS(FIELD_SET(REGULAR_REG1,
> +						   REG_BIT(0) | REG_BIT(1),
> +						   REG_BIT(0) | REG_BIT(1)))
> +			},
> +			{ XE_RTP_NAME("basic-2"),
> +			  XE_RTP_RULES(FUNC(match_yes)),
> +			  XE_RTP_ACTIONS(FIELD_SET_FUNC(REGULAR_REG1,
> +							REG_BIT(2) | REG_BIT(3),
> +							bits_2_3_set))
> +			},
> +		),
> +	},
>  	{
>  		.name = "no-match-no-add",
>  		.expected_reg = REGULAR_REG1,
> @@ -417,6 +445,30 @@ static const struct rtp_to_sr_test_case rtp_to_sr_cases[] = {
>  			},
>  		),
>  	},
> +	{
> +		.name = "conflict-not-disjoint-literal-and-func",
> +		.expected_reg = REGULAR_REG1,
> +		.expected_set_bits = REG_BIT(1) | REG_BIT(2),
> +		.expected_clr_bits = REG_BIT(1) | REG_BIT(2),
> +		.expected_active = BIT(0) | BIT(1),
> +		.expected_count_sr_entries = 1,
> +		.expected_sr_errors = 1,
> +		.table = XE_RTP_TABLE_SR(
> +			{ XE_RTP_NAME("basic-1"),
> +			  XE_RTP_RULES(FUNC(match_yes)),
> +			  XE_RTP_ACTIONS(FIELD_SET(REGULAR_REG1,
> +						   REG_BIT(1) | REG_BIT(2),
> +						   REG_BIT(1) | REG_BIT(2)))
> +			},
> +			/* drop: bits are not disjoint with previous entries */
> +			{ XE_RTP_NAME("basic-2"),
> +			  XE_RTP_RULES(FUNC(match_yes)),
> +			  XE_RTP_ACTIONS(FIELD_SET_FUNC(REGULAR_REG1,
> +							REG_BIT(2) | REG_BIT(3),
> +							bits_2_3_set))
> +			},
> +		),
> +	},
>  	{
>  		.name = "conflict-reg-type",
>  		.expected_reg = REGULAR_REG1,
>
> -- 
> 2.54.0

  reply	other threads:[~2026-06-17 20:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-17 19:24 [PATCH v2 0/5] Move RTP tables for engine init off the stack Matt Roper
2026-06-17 19:24 ` [PATCH v2 1/5] drm/xe: Reformat xe_rtp_types.h Matt Roper
2026-06-17 19:24 ` [PATCH v2 2/5] drm/xe/rtp: Add FIELD_SET_FUNC RTP action Matt Roper
2026-06-17 19:24 ` [PATCH v2 3/5] drm/xe: Move engines' LRC programming RTP table off the stack Matt Roper
2026-06-17 19:24 ` [PATCH v2 4/5] drm/xe: Move engines' non-LRC " Matt Roper
2026-06-17 19:24 ` [PATCH v2 5/5] drm/xe/rtp: Add kunit tests to exercise FIELD_SET_FUNC action Matt Roper
2026-06-17 20:13   ` Gustavo Sousa [this message]
2026-06-17 19:32 ` ✗ CI.checkpatch: warning for Move RTP tables for engine init off the stack (rev2) Patchwork
2026-06-17 19:33 ` ✓ CI.KUnit: success " Patchwork
2026-06-17 20:11 ` ✗ Xe.CI.BAT: failure " Patchwork
2026-06-17 21:09   ` Matt Roper

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=87ik7h0vth.fsf@intel.com \
    --to=gustavo.sousa@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.d.roper@intel.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox