]> git.hungrycats.org Git - linux/commitdiff
drm/xe/step: Pass xe_step_info to xe_step_*_get() functions
authorGustavo Sousa <gustavo.sousa@intel.com>
Tue, 9 Jun 2026 20:17:34 +0000 (17:17 -0300)
committerGustavo Sousa <gustavo.sousa@intel.com>
Thu, 2 Jul 2026 21:41:50 +0000 (18:41 -0300)
The xe_step_*_get() functions update the step directly in
xe->info.step and are called by functions xe_info_init_early() and
xe_info_init().

As the stepping info is something probed from the hardware (via PCI
revid and/or GMDID) and we want to move away from probing inside
xe_info_init*() functions, let's make xe_step_*_get() functions modify
a pointer to the step structure instead of modifying xe->info.step
directly: this will allow an upcoming change that will move those
function calls out of the info init functions and will pass a member
of struct xe_probed_info instead of xe->info.step.

Reviewed-by: Dnyaneshwar Bhadane <dnyaneshwar.bhadane@intel.com>
Reviewed-by: Violet Monti <violet.monti@intel.com>
Link: https://patch.msgid.link/20260609-xe-probe-info-v1-2-21e83e188e60@intel.com
Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
drivers/gpu/drm/xe/xe_pci.c
drivers/gpu/drm/xe/xe_step.c
drivers/gpu/drm/xe/xe_step.h

index 6156d8689430e1df41b54a2654ac96784e02d78f..c4f7ffd039872b6f98a1e396a89381cdb8841636 100644 (file)
@@ -813,7 +813,7 @@ static int xe_info_init_early(struct xe_device *xe,
        xe->info.max_gt_per_tile = desc->max_gt_per_tile;
        xe->info.tile_count = 1 + desc->max_remote_tiles;
 
-       xe_step_platform_get(xe);
+       xe_step_platform_get(xe, &xe->info.step);
 
        err = xe_tile_init_early(xe_device_get_root_tile(xe), xe, 0);
        if (err)
@@ -965,7 +965,7 @@ static int xe_info_init(struct xe_device *xe,
        if (desc->pre_gmdid_graphics_ip) {
                graphics_ip = desc->pre_gmdid_graphics_ip;
                media_ip = desc->pre_gmdid_media_ip;
-               xe_step_pre_gmdid_get(xe);
+               xe_step_pre_gmdid_get(xe, &xe->info.step);
        } else {
                xe_assert(xe, !desc->pre_gmdid_media_ip);
                ret = handle_gmdid(xe, &graphics_ip, &media_ip,
@@ -973,7 +973,7 @@ static int xe_info_init(struct xe_device *xe,
                if (ret)
                        return ret;
 
-               xe_step_gmdid_get(xe, graphics_gmdid_revid, media_gmdid_revid);
+               xe_step_gmdid_get(xe, graphics_gmdid_revid, media_gmdid_revid, &xe->info.step);
        }
 
        /*
index fb9c31613ca7d617ef539c872c48cdecf60cd49d..49dc64f2b363d069d246ea448296499f7c52c7a4 100644 (file)
@@ -111,11 +111,12 @@ __diag_pop();
 /**
  * xe_step_platform_get - Determine platform-level stepping from PCI revid
  * @xe: Xe device
+ * @step: Pointer to the step struct to update
  *
  * Convert the PCI revid into a platform-level stepping value and store that
- * in the device info.
+ * in @step->platform.
  */
-void xe_step_platform_get(struct xe_device *xe)
+void xe_step_platform_get(struct xe_device *xe, struct xe_step_info *step)
 {
        /*
         * Not all platforms map PCI revid directly into our symbolic stepping
@@ -127,17 +128,20 @@ void xe_step_platform_get(struct xe_device *xe)
         */
 
        if (xe->info.platform == XE_NOVALAKE_P)
-               xe->info.step.platform = STEP_A0 + xe->info.revid;
+               step->platform = STEP_A0 + xe->info.revid;
 }
 
 /**
  * xe_step_pre_gmdid_get - Determine IP steppings from PCI revid
  * @xe: Xe device
+ * @step: Pointer to the step struct to update
  *
- * Convert the PCI revid into proper IP steppings.  This should only be
- * used on platforms that do not have GMD_ID support.
+ * Convert the PCI revid into proper IP steppings and update @step->basedie,
+ * @step->graphics and @step->media accordingly.
+ *
+ * This should only be used on platforms that do not have GMD_ID support.
  */
-void xe_step_pre_gmdid_get(struct xe_device *xe)
+void xe_step_pre_gmdid_get(struct xe_device *xe, struct xe_step_info *step)
 {
        const struct xe_step_info *revids = NULL;
        u16 revid = xe->info.revid;
@@ -234,9 +238,9 @@ void xe_step_pre_gmdid_get(struct xe_device *xe)
        }
 
 done:
-       xe->info.step.graphics = graphics;
-       xe->info.step.media = media;
-       xe->info.step.basedie = basedie;
+       step->graphics = graphics;
+       step->media = media;
+       step->basedie = basedie;
 }
 
 /**
@@ -244,8 +248,10 @@ done:
  * @xe: Xe device
  * @graphics_gmdid_revid: value of graphics GMD_ID register's revid field
  * @media_gmdid_revid: value of media GMD_ID register's revid field
+ * @step: Poninter to the step struct to update.
  *
- * Convert the revid fields of the GMD_ID registers into proper IP steppings.
+ * Convert the revid fields of the GMD_ID registers into proper IP steppings
+ * and update @step->graphics and @step->media accordingly.
  *
  * GMD_ID revid values are currently expected to have consistent meanings on
  * all platforms:  major steppings (A0, B0, etc.) are 4 apart, with minor
@@ -253,7 +259,8 @@ done:
  */
 void xe_step_gmdid_get(struct xe_device *xe,
                       u32 graphics_gmdid_revid,
-                      u32 media_gmdid_revid)
+                      u32 media_gmdid_revid,
+                      struct xe_step_info *step)
 {
        u8 graphics = STEP_A0 + graphics_gmdid_revid;
        u8 media = STEP_A0 + media_gmdid_revid;
@@ -270,8 +277,8 @@ void xe_step_gmdid_get(struct xe_device *xe,
                        media_gmdid_revid);
        }
 
-       xe->info.step.graphics = graphics;
-       xe->info.step.media = media;
+       step->graphics = graphics;
+       step->media = media;
 }
 
 #define STEP_NAME_CASE(name)   \
index ea36b22cc297c148b692faf8a986e2b0d4f5d786..c6cea95a3727d994f9460d931e364db06d6db9b2 100644 (file)
 
 struct xe_device;
 
-void xe_step_platform_get(struct xe_device *xe);
+void xe_step_platform_get(struct xe_device *xe, struct xe_step_info *step);
 
-void xe_step_pre_gmdid_get(struct xe_device *xe);
+void xe_step_pre_gmdid_get(struct xe_device *xe, struct xe_step_info *step);
 void xe_step_gmdid_get(struct xe_device *xe,
                       u32 graphics_gmdid_revid,
-                      u32 media_gmdid_revid);
+                      u32 media_gmdid_revid,
+                      struct xe_step_info *step);
 static inline u32 xe_step_to_gmdid(enum intel_step step) { return step - STEP_A0; }
 
 const char *xe_step_name(enum intel_step step);