]> www.infradead.org Git - users/hch/configfs.git/commitdiff
drm/xe/rtp: Add match on any GT
authorLucas De Marchi <lucas.demarchi@intel.com>
Tue, 18 Jun 2024 05:00:43 +0000 (22:00 -0700)
committerMatt Roper <matthew.d.roper@intel.com>
Tue, 18 Jun 2024 19:03:29 +0000 (12:03 -0700)
One surprising factor of GRAPHICS_VERSION()/MEDIA_VERSION() matching for
people adding new WAs is that it implicitly checks that the
graphics/media IP under check is of that specific type and not that the
device contains a media/graphics IP of that version. Add a new
*_ANY_GT() variant that can be used in that case.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240618050044.324454-5-lucas.demarchi@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 dc315b8aae071c8837a44c62c4c9d667f2dacbfc..ac31cba1dbea93c3d20de152cd67b88a8b9a7e37 100644 (file)
@@ -63,6 +63,9 @@ static bool rule_matches(const struct xe_device *xe,
                                xe->info.graphics_verx100 <= r->ver_end &&
                                (!has_samedia(xe) || !xe_gt_is_media_type(gt));
                        break;
+               case XE_RTP_MATCH_GRAPHICS_VERSION_ANY_GT:
+                       match = xe->info.graphics_verx100 == r->ver_start;
+                       break;
                case XE_RTP_MATCH_GRAPHICS_STEP:
                        match = xe->info.step.graphics >= r->step_start &&
                                xe->info.step.graphics < r->step_end &&
@@ -82,6 +85,9 @@ static bool rule_matches(const struct xe_device *xe,
                                xe->info.step.media < r->step_end &&
                                (!has_samedia(xe) || xe_gt_is_media_type(gt));
                        break;
+               case XE_RTP_MATCH_MEDIA_VERSION_ANY_GT:
+                       match = xe->info.media_verx100 == r->ver_start;
+                       break;
                case XE_RTP_MATCH_INTEGRATED:
                        match = !xe->info.is_dgfx;
                        break;
index bd5b5ba0fb313003e5c6f99baa7765444314b993..ad446731192c19c0002338cd37e600a7f1654efb 100644 (file)
@@ -140,9 +140,23 @@ struct xe_reg_sr;
          .ver_start = ver_start__, .ver_end = ver_end__, }
 
 /**
- * XE_RTP_RULE_MEDIA_VERSION - Create rule matching media version
+ * XE_RTP_RULE_GRAPHICS_VERSION_ANY_GT - Create rule matching graphics version on any GT
  * @ver__: Graphics IP version to match
  *
+ * Like XE_RTP_RULE_GRAPHICS_VERSION, but it matches even if the current GT
+ * being checked is not of the graphics type. It allows to add RTP entries to
+ * another GT when the device contains a Graphics IP with that version.
+ *
+ * Refer to XE_RTP_RULES() for expected usage.
+ */
+#define XE_RTP_RULE_GRAPHICS_VERSION_ANY_GT(ver__)                             \
+       { .match_type = XE_RTP_MATCH_GRAPHICS_VERSION_ANY_GT,                   \
+         .ver_start = ver__, }
+
+/**
+ * XE_RTP_RULE_MEDIA_VERSION - Create rule matching media version
+ * @ver__: Media IP version to match
+ *
  * Refer to XE_RTP_RULES() for expected usage.
  */
 #define XE_RTP_RULE_MEDIA_VERSION(ver__)                                       \
@@ -163,6 +177,20 @@ struct xe_reg_sr;
        { .match_type = XE_RTP_MATCH_MEDIA_VERSION_RANGE,                       \
          .ver_start = ver_start__, .ver_end = ver_end__, }
 
+/**
+ * XE_RTP_RULE_MEDIA_VERSION_ANY_GT - Create rule matching media version on any GT
+ * @ver__: Media IP version to match
+ *
+ * Like XE_RTP_RULE_MEDIA_VERSION, but it matches even if the current GT being
+ * checked is not of the media type. It allows to add RTP entries to another
+ * GT when the device contains a Media IP with that version.
+ *
+ * Refer to XE_RTP_RULES() for expected usage.
+ */
+#define XE_RTP_RULE_MEDIA_VERSION_ANY_GT(ver__)                                        \
+       { .match_type = XE_RTP_MATCH_MEDIA_VERSION_ANY_GT,                      \
+         .ver_start = ver__, }
+
 /**
  * XE_RTP_RULE_IS_INTEGRATED - Create a rule matching integrated graphics devices
  *
index 10150bc22ccd358e3be0d6548eb6df7a22eb40fe..1b76b947c7063a6ce301cc530ac91195ac7e4e81 100644 (file)
@@ -42,9 +42,11 @@ enum {
        XE_RTP_MATCH_SUBPLATFORM,
        XE_RTP_MATCH_GRAPHICS_VERSION,
        XE_RTP_MATCH_GRAPHICS_VERSION_RANGE,
+       XE_RTP_MATCH_GRAPHICS_VERSION_ANY_GT,
        XE_RTP_MATCH_GRAPHICS_STEP,
        XE_RTP_MATCH_MEDIA_VERSION,
        XE_RTP_MATCH_MEDIA_VERSION_RANGE,
+       XE_RTP_MATCH_MEDIA_VERSION_ANY_GT,
        XE_RTP_MATCH_MEDIA_STEP,
        XE_RTP_MATCH_INTEGRATED,
        XE_RTP_MATCH_DISCRETE,