]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe/rtp: Add support for matching platform-level stepping
authorGustavo Sousa <gustavo.sousa@intel.com>
Tue, 10 Mar 2026 00:42:09 +0000 (21:42 -0300)
committerGustavo Sousa <gustavo.sousa@intel.com>
Tue, 10 Mar 2026 22:18:45 +0000 (19:18 -0300)
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>
drivers/gpu/drm/xe/xe_rtp.c
drivers/gpu/drm/xe/xe_rtp.h
drivers/gpu/drm/xe/xe_rtp_types.h

index 7bfdc6795ce6fd3d2c8c9d1398c7b72ff476b96d..991f218f1cc309fc89103e55eba8e270c2b45c1f 100644 (file)
@@ -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;
index be4195264286378d390540fea97b030166df4172..7d6daa7eb1e4c29f14931bb5edf830dfcdbedd92 100644 (file)
@@ -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_)
+
 /**
  * XE_RTP_RULE_GRAPHICS_STEP - Create rule matching graphics stepping
  * @start_: First stepping matching the rule
index 6ba7f226c2274ea37569af65c3d540de69a5317e..166251615be13e5ed644d9c7d5834fccff3b131c 100644 (file)
@@ -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,