Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Roper <matthew.d.roper@intel.com>
To: Gustavo Sousa <gustavo.sousa@intel.com>
Cc: <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH 4/7] drm/xe/rtp: Add support for matching platform-level stepping
Date: Thu, 5 Mar 2026 14:22:56 -0800	[thread overview]
Message-ID: <20260305222256.GS4694@mdroper-desk1.amr.corp.intel.com> (raw)
In-Reply-To: <20260305-extra-nvl-p-enabling-patches-v1-4-5020d5289dea@intel.com>

On Thu, Mar 05, 2026 at 09:02:31AM -0300, Gustavo Sousa wrote:
> Add support for matching platform-level stepping, which will be used for
> an upcoming NVL-P workaround.
> 
> As support for reading platform-level stepping information is added only
> as needed in the driver, add a warning when the rule finds a STEP_NONE
> value, which is an indication that the driver is missing such a support.
> 
> Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_rtp.c       |  7 +++++++
>  drivers/gpu/drm/xe/xe_rtp.h       | 20 ++++++++++++++++++++
>  drivers/gpu/drm/xe/xe_rtp_types.h |  1 +
>  3 files changed, 28 insertions(+)
> 
> diff --git a/drivers/gpu/drm/xe/xe_rtp.c b/drivers/gpu/drm/xe/xe_rtp.c
> index 7bfdc6795ce6..991f218f1cc3 100644
> --- a/drivers/gpu/drm/xe/xe_rtp.c
> +++ b/drivers/gpu/drm/xe/xe_rtp.c
> @@ -55,6 +55,13 @@ static bool rule_matches(const struct xe_device *xe,
>  			match = xe->info.platform == r->platform &&
>  				xe->info.subplatform == r->subplatform;
>  			break;
> +		case XE_RTP_MATCH_PLATFORM_STEP:
> +			if (drm_WARN_ON(&xe->drm, xe->info.step.platform == STEP_NONE))
> +				return false;
> +
> +			match = xe->info.step.platform >= r->step_start &&
> +				xe->info.step.platform < r->step_end;
> +			break;
>  		case XE_RTP_MATCH_GRAPHICS_VERSION:
>  			if (drm_WARN_ON(&xe->drm, !gt))
>  				return false;
> diff --git a/drivers/gpu/drm/xe/xe_rtp.h b/drivers/gpu/drm/xe/xe_rtp.h
> index be4195264286..7d6daa7eb1e4 100644
> --- a/drivers/gpu/drm/xe/xe_rtp.h
> +++ b/drivers/gpu/drm/xe/xe_rtp.h
> @@ -35,6 +35,10 @@ struct xe_reg_sr;
>  	{ .match_type = XE_RTP_MATCH_SUBPLATFORM,				\
>  	  .platform = plat__, .subplatform = sub__ }
>  
> +#define _XE_RTP_RULE_PLATFORM_STEP(start__, end__)				\
> +	{ .match_type = XE_RTP_MATCH_PLATFORM_STEP,				\
> +	  .step_start = start__, .step_end = end__ }
> +
>  #define _XE_RTP_RULE_GRAPHICS_STEP(start__, end__)				\
>  	{ .match_type = XE_RTP_MATCH_GRAPHICS_STEP,				\
>  	  .step_start = start__, .step_end = end__ }
> @@ -66,6 +70,22 @@ struct xe_reg_sr;
>  #define XE_RTP_RULE_SUBPLATFORM(plat_, sub_)					\
>  	_XE_RTP_RULE_SUBPLATFORM(XE_##plat_, XE_SUBPLATFORM_##plat_##_##sub_)
>  
> +/**
> + * XE_RTP_RULE_PLATFORM_STEP - Create rule matching platform-level stepping
> + * @start_: First stepping matching the rule
> + * @end_: First stepping that does not match the rule
> + *
> + * Note that the range matching this rule is [ @start_, @end_ ), i.e. inclusive
> + * on the left, exclusive on the right.
> + *
> + * You need to make sure that proper support for reading platform-level stepping
> + * information is present for the target platform before using this rule.
> + *
> + * Refer to XE_RTP_RULES() for expected usage.
> + */
> +#define XE_RTP_RULE_PLATFORM_STEP(start_, end_)					\
> +	_XE_RTP_RULE_PLATFORM_STEP(STEP_##start_, STEP_##end_)

To use this effectively someone will need to pair this with another rule
like

        PLATFORM(NOVALAKE_P), PLATFORM_STEP(A2, C1)

and using PLATFORM_STEP() by itself without a corresponding PLATFORM()
or SUBPLATFORM() would be a bug.  Maybe we should just make
PLATFORM_STEP a rule that takes the platform as well as the stepping
range so that it's impossible for anyone to ever use PLATFORM_STEP
without tying it to a specific platform?  And also make a corresponding
SUBPLATFORM_STEP() rule for cases where that's relevant.  E.g.,

        PLATFORM_STEP(NOVALAKE_P, A2, C1)

or

        SUBPLATFORM_STEP(BATTLEMAGE, BATTLEMAGE_G21, A0, B0)

We'd need to update the union in struct xe_rtp_rule, but the size of the
union shouldn't increase.

What do you think?


Matt

> +
>  /**
>   * XE_RTP_RULE_GRAPHICS_STEP - Create rule matching graphics stepping
>   * @start_: First stepping matching the rule
> diff --git a/drivers/gpu/drm/xe/xe_rtp_types.h b/drivers/gpu/drm/xe/xe_rtp_types.h
> index 6ba7f226c227..166251615be1 100644
> --- a/drivers/gpu/drm/xe/xe_rtp_types.h
> +++ b/drivers/gpu/drm/xe/xe_rtp_types.h
> @@ -41,6 +41,7 @@ struct xe_rtp_action {
>  enum {
>  	XE_RTP_MATCH_PLATFORM,
>  	XE_RTP_MATCH_SUBPLATFORM,
> +	XE_RTP_MATCH_PLATFORM_STEP,
>  	XE_RTP_MATCH_GRAPHICS_VERSION,
>  	XE_RTP_MATCH_GRAPHICS_VERSION_RANGE,
>  	XE_RTP_MATCH_GRAPHICS_VERSION_ANY_GT,
> 
> -- 
> 2.52.0
> 

-- 
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation

  reply	other threads:[~2026-03-05 22:23 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-05 12:02 [PATCH 0/7] Extra enabling patches for NVL-P Gustavo Sousa
2026-03-05 12:02 ` [PATCH 1/7] drm/xe: Modify stepping info directly in xe_step_*_get() Gustavo Sousa
2026-03-05 22:07   ` Matt Roper
2026-03-05 12:02 ` [PATCH 2/7] drm/xe: Drop unused IS_PLATFORM_STEP() and IS_SUBPLATFORM_STEP() Gustavo Sousa
2026-03-05 22:09   ` Matt Roper
2026-03-05 12:02 ` [PATCH 3/7] drm/xe/nvlp: Read platform-level stepping info Gustavo Sousa
2026-03-05 22:13   ` Matt Roper
2026-03-05 12:02 ` [PATCH 4/7] drm/xe/rtp: Add support for matching platform-level stepping Gustavo Sousa
2026-03-05 22:22   ` Matt Roper [this message]
2026-03-06  0:53     ` Matt Roper
2026-03-06 13:39       ` Gustavo Sousa
2026-03-06 16:40         ` Matt Roper
2026-03-05 12:02 ` [PATCH 5/7] drm/xe/nvlp: Implement Wa_14026539277 Gustavo Sousa
2026-03-05 15:23   ` Gustavo Sousa
2026-03-05 22:05     ` Matt Roper
2026-03-05 12:02 ` [PATCH 6/7] drm/xe/xe3p: Drop Wa_16028780921 Gustavo Sousa
2026-03-05 22:23   ` Matt Roper
2026-03-05 12:02 ` [PATCH 7/7] drm/xe: Translate C-state "reset value" into RC6 Gustavo Sousa
2026-03-05 22:25   ` Matt Roper
2026-03-06 11:37 ` ✓ CI.KUnit: success for Extra enabling patches for NVL-P Patchwork
2026-03-06 12:16 ` ✓ Xe.CI.BAT: " 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=20260305222256.GS4694@mdroper-desk1.amr.corp.intel.com \
    --to=matthew.d.roper@intel.com \
    --cc=gustavo.sousa@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    /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