]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe/nvlp: Read platform-level stepping info
authorGustavo Sousa <gustavo.sousa@intel.com>
Tue, 10 Mar 2026 00:42:08 +0000 (21:42 -0300)
committerGustavo Sousa <gustavo.sousa@intel.com>
Tue, 10 Mar 2026 22:18:45 +0000 (19:18 -0300)
There will be a NVL-P workaround for which we will need to know the
platform-level stepping information in order to decide whether to apply
it or not.

While NVL-P has a nice mapping between the PCI revid and our symbolic
stepping enumeration, not all platforms are like that: (i) Some
platforms will have a single PCI revid used for a set platform level
steppings (ii) and some might even require specific mappings.

To make things simpler, let's include stepping information in the device
info only on demand, for those platforms where it is needed for
workaround checks.

v2:
  - Call xe_step_platform_get() very early, to allow device workarounds
    to use it in early stages of device initialization. (Matt)

Bspec: 74201
Reviewed-by: Matt Roper <matthew.d.roper@intel.com> # v1
Link: https://patch.msgid.link/20260309-extra-nvl-p-enabling-patches-v5-3-be9c902ee34e@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
drivers/gpu/drm/xe/xe_step_types.h

index 0bb22b69172224178960ad5785a4beca32f2f930..01673d2b2464989124d687b6280ad1f8904ab06c 100644 (file)
@@ -779,6 +779,8 @@ 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);
+
        err = xe_tile_init_early(xe_device_get_root_tile(xe), xe, 0);
        if (err)
                return err;
index 064b604b5b9428125435181a234699a775b20a0f..d0f888c31831fca71a14ddf9da8e169954f1644c 100644 (file)
@@ -108,6 +108,28 @@ static const int pvc_basedie_subids[] = {
 
 __diag_pop();
 
+/**
+ * xe_step_platform_get - Determine platform-level stepping from PCI revid
+ * @xe: Xe device
+ *
+ * Convert the PCI revid into a platform-level stepping value and store that
+ * in the device info.
+ */
+void xe_step_platform_get(struct xe_device *xe)
+{
+       /*
+        * Not all platforms map PCI revid directly into our symbolic stepping
+        * enumeration. Some platforms will have a single PCI revid used for a
+        * range platform level steppings and some might even require specific
+        * mappings. So prefer to err on the side of caution and include only
+        * the platforms from which we need the stepping info for workaround
+        * checks.
+        */
+
+       if (xe->info.platform == XE_NOVALAKE_P)
+               xe->info.step.platform = STEP_A0 + xe->info.revid;
+}
+
 /**
  * xe_step_pre_gmdid_get - Determine IP steppings from PCI revid
  * @xe: Xe device
index 6febb7fac476d7bc72ef8faafedaaf6143c8d949..41f1c95c46e5cd9faee95268c7b53b6bb2011278 100644 (file)
@@ -12,6 +12,8 @@
 
 struct xe_device;
 
+void xe_step_platform_get(struct xe_device *xe);
+
 void xe_step_pre_gmdid_get(struct xe_device *xe);
 void xe_step_gmdid_get(struct xe_device *xe,
                       u32 graphics_gmdid_revid,
index d978cc2512f2503f15edead61e465638f2deb221..43ca7385073960feb7bc395d668b017ee27c115d 100644 (file)
@@ -9,6 +9,7 @@
 #include <linux/types.h>
 
 struct xe_step_info {
+       u8 platform;
        u8 graphics;
        u8 media;
        u8 basedie;