summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Sousa <gustavo.sousa@intel.com>2026-03-10 03:42:09 +0300
committerGustavo Sousa <gustavo.sousa@intel.com>2026-03-11 01:18:45 +0300
commit557c05034ffaa0614d2ed57fff435b6630b92e70 (patch)
tree895dd8a79c6709406a3fa857ae5f79dfa5d099ef
parent19da26bce08a5686515b877099af78169148a3b3 (diff)
downloadlinux-557c05034ffaa0614d2ed57fff435b6630b92e70.tar.xz
drm/xe/rtp: Add support for matching platform-level stepping
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. Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Link: https://patch.msgid.link/20260309-extra-nvl-p-enabling-patches-v5-4-be9c902ee34e@intel.com Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
-rw-r--r--drivers/gpu/drm/xe/xe_rtp.c7
-rw-r--r--drivers/gpu/drm/xe/xe_rtp.h20
-rw-r--r--drivers/gpu/drm/xe/xe_rtp_types.h1
3 files changed, 28 insertions, 0 deletions
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__ }
@@ -67,6 +71,22 @@ struct xe_reg_sr;
_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_)
+
+/**
* XE_RTP_RULE_GRAPHICS_STEP - Create rule matching graphics stepping
* @start_: First stepping matching the rule
* @end_: First stepping that does not match 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,