drm/xe/rtp: Move match function from wa to rtp
authorLucas De Marchi <lucas.demarchi@intel.com>
Wed, 1 Mar 2023 09:31:06 +0000 (01:31 -0800)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 19 Dec 2023 23:29:46 +0000 (18:29 -0500)
Match functions are generally useful for other parts of the code (e.g.
xe_tuning.c). Move and rename the single one available to create a place
where similar match functions can be added.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_rtp.c
drivers/gpu/drm/xe/xe_rtp.h
drivers/gpu/drm/xe/xe_wa.c

index 5b1316b..c04eca2 100644 (file)
@@ -154,3 +154,9 @@ void xe_rtp_process(const struct xe_rtp_entry *entries, struct xe_reg_sr *sr,
                }
        }
 }
+
+bool xe_rtp_match_even_instance(const struct xe_gt *gt,
+                               const struct xe_hw_engine *hwe)
+{
+       return hwe->instance % 2 == 0;
+}
index bd44fd8..9bd2532 100644 (file)
@@ -397,4 +397,16 @@ struct xe_reg_sr;
 void xe_rtp_process(const struct xe_rtp_entry *entries, struct xe_reg_sr *sr,
                    struct xe_gt *gt, struct xe_hw_engine *hwe);
 
+/* Match functions to be used with XE_RTP_MATCH_FUNC */
+
+/**
+ * xe_rtp_match_even_instance - Match if engine instance is even
+ * @gt: GT structure
+ * @hwe: Engine instance
+ *
+ * Returns: true if engine instance is even, false otherwise
+ */
+bool xe_rtp_match_even_instance(const struct xe_gt *gt,
+                               const struct xe_hw_engine *hwe);
+
 #endif
index 03c5b01..67539f9 100644 (file)
 #define _MMIO(x)       _XE_RTP_REG(x)
 #define MCR_REG(x)     _XE_RTP_MCR_REG(x)
 
-static bool match_14011060649(const struct xe_gt *gt,
-                             const struct xe_hw_engine *hwe)
-{
-       return hwe->instance % 2 == 0;
-}
-
 static const struct xe_rtp_entry gt_was[] = {
        { XE_RTP_NAME("14011060649"),
          XE_RTP_RULES(MEDIA_VERSION_RANGE(1200, 1255),
                       ENGINE_CLASS(VIDEO_DECODE),
-                      FUNC(match_14011060649)),
+                      FUNC(xe_rtp_match_even_instance)),
          XE_RTP_ACTIONS(SET(VDBOX_CGCTL3F10(0), IECPUNIT_CLKGATE_DIS)),
          XE_RTP_ENTRY_FLAG(FOREACH_ENGINE),
        },