]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe/rtp: Add "always true" match function
authorMatt Roper <matthew.d.roper@intel.com>
Fri, 24 Apr 2026 20:48:12 +0000 (13:48 -0700)
committerMatt Roper <matthew.d.roper@intel.com>
Mon, 27 Apr 2026 20:20:34 +0000 (13:20 -0700)
All RTP table entries are required to have at least one rule.  In cases
where an entry should apply unconditionally across all platforms we've
been using a graphics version range of 12.00 - forever since this covers
all platforms supported by the driver.  However if the primary GT is
disabled via configfs (not actually possible today, but probably
possible in the future) or if we have a future platform that lacks a
primary GT and only supports media/display, this rule would cause
important programming to fail to apply on the media GT.

Add a simple match function that just always returns true
unconditionally.  This solves the worries above while also being more
immediately human-readable.

Reviewed-by: Shuicheng Lin <shuicheng.lin@intel.com>
Link: https://patch.msgid.link/20260424-engine-setup-v2-2-59cc620a25f1@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
drivers/gpu/drm/xe/xe_hw_engine.c
drivers/gpu/drm/xe/xe_rtp.c
drivers/gpu/drm/xe/xe_rtp.h

index 74f29025dd6cacaf2bc420f45c8dec4037c589b9..c7d211178300ff013bbbea29f3f50b5414f01cae 100644 (file)
@@ -430,7 +430,7 @@ hw_engine_setup_default_state(struct xe_hw_engine *hwe)
        struct xe_rtp_process_ctx ctx = XE_RTP_PROCESS_CTX_INITIALIZER(hwe);
        const struct xe_rtp_entry_sr engine_entries[] = {
                { XE_RTP_NAME("RING_CMD_CCTL_default_MOCS"),
-                 XE_RTP_RULES(GRAPHICS_VERSION_RANGE(1200, XE_RTP_END_VERSION_UNDEFINED)),
+                 XE_RTP_RULES(FUNC(xe_rtp_match_always)),
                  XE_RTP_ACTIONS(FIELD_SET(RING_CMD_CCTL(0),
                                           CMD_CCTL_WRITE_OVERRIDE_MASK |
                                           CMD_CCTL_READ_OVERRIDE_MASK,
index 991f218f1cc309fc89103e55eba8e270c2b45c1f..728933a1c34fac351ef0fade59074c3c4ed8365f 100644 (file)
@@ -352,6 +352,13 @@ void xe_rtp_process(struct xe_rtp_process_ctx *ctx,
 }
 EXPORT_SYMBOL_IF_KUNIT(xe_rtp_process);
 
+bool xe_rtp_match_always(const struct xe_device *xe,
+                        const struct xe_gt *gt,
+                        const struct xe_hw_engine *hwe)
+{
+       return true;
+}
+
 bool xe_rtp_match_even_instance(const struct xe_device *xe,
                                const struct xe_gt *gt,
                                const struct xe_hw_engine *hwe)
index 4537ff46a17f3de12736899b43cffc88b825babd..d058a629cd3e12e36a4ebc00951bf5075e54ded2 100644 (file)
@@ -459,6 +459,18 @@ void xe_rtp_process(struct xe_rtp_process_ctx *ctx,
 
 /* Match functions to be used with XE_RTP_MATCH_FUNC */
 
+/**
+ * xe_rtp_match_always - Match RTP entry unconditionally
+ * @xe: Device structure
+ * @gt: GT structure
+ * @hwe: Engine instance
+ *
+ * Returns: true, regardless of inputs
+ */
+bool xe_rtp_match_always(const struct xe_device *xe,
+                        const struct xe_gt *gt,
+                        const struct xe_hw_engine *hwe);
+
 /**
  * xe_rtp_match_even_instance - Match if engine instance is even
  * @xe: Device structure