drm/xe/rtp: Add check for media stepping
authorLucas De Marchi <lucas.demarchi@intel.com>
Fri, 26 May 2023 16:43:46 +0000 (09:43 -0700)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 19 Dec 2023 23:34:02 +0000 (18:34 -0500)
Start differentiating the media and graphics stepping as it will be
important for MTL. Note that RTP is still not prepared to handle the
different types of GT, i.e. checking for graphics version/range/stepping
on a media gt or vice versa still matches regardless of the gt being
passed as parameter. Changing it to accommodate MTL is left for a future
patch.

Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://lore.kernel.org/r/20230526164358.86393-10-lucas.demarchi@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@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_rtp_types.h

index 2ac7b47942fe295c4200a1d1d5b88d0f3858a3a2..70769852a93da02ebbc165ba4df243fb106e7dc8 100644 (file)
@@ -43,13 +43,16 @@ static bool rule_matches(const struct xe_device *xe,
                                xe->info.subplatform == r->subplatform;
                        break;
                case XE_RTP_MATCH_GRAPHICS_VERSION:
-                       /* TODO: match display */
                        match = xe->info.graphics_verx100 == r->ver_start;
                        break;
                case XE_RTP_MATCH_GRAPHICS_VERSION_RANGE:
                        match = xe->info.graphics_verx100 >= r->ver_start &&
                                xe->info.graphics_verx100 <= r->ver_end;
                        break;
+               case XE_RTP_MATCH_GRAPHICS_STEP:
+                       match = xe->info.step.graphics >= r->step_start &&
+                               xe->info.step.graphics < r->step_end;
+                       break;
                case XE_RTP_MATCH_MEDIA_VERSION:
                        match = xe->info.media_verx100 == r->ver_start;
                        break;
@@ -57,10 +60,9 @@ static bool rule_matches(const struct xe_device *xe,
                        match = xe->info.media_verx100 >= r->ver_start &&
                                xe->info.media_verx100 <= r->ver_end;
                        break;
-               case XE_RTP_MATCH_GRAPHICS_STEP:
-                       /* TODO: match media/display */
-                       match = xe->info.step.graphics >= r->step_start &&
-                               xe->info.step.graphics < r->step_end;
+               case XE_RTP_MATCH_MEDIA_STEP:
+                       match = xe->info.step.media >= r->step_start &&
+                               xe->info.step.media < r->step_end;
                        break;
                case XE_RTP_MATCH_INTEGRATED:
                        match = !xe->info.is_dgfx;
index 7ba9d2ecab926527f57e7d29f69490eaab4be938..d55701d2f39b447dfd63c07e3d50df69359b079b 100644 (file)
@@ -39,6 +39,10 @@ struct xe_reg_sr;
        { .match_type = XE_RTP_MATCH_GRAPHICS_STEP,                             \
          .step_start = start__, .step_end = end__ }
 
+#define _XE_RTP_RULE_MEDIA_STEP(start__, end__)                                        \
+       { .match_type = XE_RTP_MATCH_MEDIA_STEP,                                \
+         .step_start = start__, .step_end = end__ }
+
 #define _XE_RTP_RULE_ENGINE_CLASS(cls__)                                       \
        { .match_type = XE_RTP_MATCH_ENGINE_CLASS,                              \
          .engine_class = (cls__) }
@@ -75,6 +79,19 @@ struct xe_reg_sr;
 #define XE_RTP_RULE_GRAPHICS_STEP(start_, end_)                                        \
        _XE_RTP_RULE_GRAPHICS_STEP(STEP_##start_, STEP_##end_)
 
+/**
+ * XE_RTP_RULE_MEDIA_STEP - Create rule matching media 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.
+ *
+ * Refer to XE_RTP_RULES() for expected usage.
+ */
+#define XE_RTP_RULE_MEDIA_STEP(start_, end_)                                   \
+       _XE_RTP_RULE_MEDIA_STEP(STEP_##start_, STEP_##end_)
+
 /**
  * XE_RTP_RULE_ENGINE_CLASS - Create rule matching an engine class
  * @cls_: Engine class to match
index 52adbf7de752e551e434a0a1bad5caadd5ee5157..af49cbf98407eba290a8003dc77d76f6c98e400e 100644 (file)
@@ -42,6 +42,7 @@ enum {
        XE_RTP_MATCH_GRAPHICS_STEP,
        XE_RTP_MATCH_MEDIA_VERSION,
        XE_RTP_MATCH_MEDIA_VERSION_RANGE,
+       XE_RTP_MATCH_MEDIA_STEP,
        XE_RTP_MATCH_INTEGRATED,
        XE_RTP_MATCH_DISCRETE,
        XE_RTP_MATCH_ENGINE_CLASS,