]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe: Handle Wa_22010954014 and Wa_14022085890 as device workarounds
authorMatt Roper <matthew.d.roper@intel.com>
Mon, 13 Oct 2025 20:09:58 +0000 (13:09 -0700)
committerMatt Roper <matthew.d.roper@intel.com>
Tue, 14 Oct 2025 14:45:17 +0000 (07:45 -0700)
When Wa_22010954014 and Wa_14022085890 were first implemented, we didn't
have a device workaround infrastructure so we hacked them into the GT
workaround list.  Now that we have proper device workaround support,
move them to the proper place.  Note that Wa_14022085890 specifically
applies to BMG-G21 platforms, so this requires defining a BMG
subplatform to capture the correct subset of device IDs.

Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
Link: https://lore.kernel.org/r/20251013200944.2499947-40-matthew.d.roper@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
drivers/gpu/drm/xe/xe_device_wa_oob.rules
drivers/gpu/drm/xe/xe_guc_pc.c
drivers/gpu/drm/xe/xe_pci.c
drivers/gpu/drm/xe/xe_platform_types.h
drivers/gpu/drm/xe/xe_wa.c
drivers/gpu/drm/xe/xe_wa_oob.rules
include/drm/intel/pciids.h

index 3cc93f0e77f8cbfc89e2a85340a74b700ed1d94a..55ba01bc8f38a7f2847b1ba8326161f1435ff249 100644 (file)
@@ -1,3 +1,5 @@
+22010954014    PLATFORM(DG2)
 15015404425     PLATFORM(LUNARLAKE)
                PLATFORM(PANTHERLAKE)
 22019338487_display    PLATFORM(LUNARLAKE)
+14022085890    SUBPLATFORM(BATTLEMAGE, G21)
index 3c0feb50a1e2fa62cc6e3ec90acc086a5be839cc..ff22235857f8825e6531d21c52941edefe63a537 100644 (file)
@@ -14,6 +14,7 @@
 
 #include <drm/drm_managed.h>
 #include <drm/drm_print.h>
+#include <generated/xe_device_wa_oob.h>
 #include <generated/xe_wa_oob.h>
 
 #include "abi/guc_actions_slpc_abi.h"
@@ -886,7 +887,7 @@ static int pc_adjust_freq_bounds(struct xe_guc_pc *pc)
        if (pc_get_min_freq(pc) > pc->rp0_freq)
                ret = pc_set_min_freq(pc, pc->rp0_freq);
 
-       if (XE_GT_WA(tile->primary_gt, 14022085890))
+       if (XE_DEVICE_WA(tile_to_xe(tile), 14022085890))
                ret = pc_set_min_freq(pc, max(BMG_MIN_FREQ, pc_get_min_freq(pc)));
 
 out:
index 0fea2ddb3c99971d02ae63374cde48ceaed5b3b9..368181b4d0b369cd4544c450e82c921a7c1d9318 100644 (file)
@@ -335,6 +335,8 @@ static const struct xe_device_desc lnl_desc = {
        .vm_max_level = 4,
 };
 
+static const u16 bmg_g21_ids[] = { INTEL_BMG_G21_IDS(NOP), 0 };
+
 static const struct xe_device_desc bmg_desc = {
        DGFX_FEATURES,
        PLATFORM(BATTLEMAGE),
@@ -349,6 +351,10 @@ static const struct xe_device_desc bmg_desc = {
        .has_sriov = true,
        .max_gt_per_tile = 2,
        .needs_scratch = true,
+       .subplatforms = (const struct xe_subplatform_desc[]) {
+               { XE_SUBPLATFORM_BATTLEMAGE_G21, "G21", bmg_g21_ids },
+               { }
+       },
        .va_bits = 48,
        .vm_max_level = 4,
 };
index d08574c4cdb8b0c88022c7c854fc8ab56ab5fec4..3e332214c7bb45f0360912120a7fa64c3cf502fb 100644 (file)
@@ -34,6 +34,7 @@ enum xe_subplatform {
        XE_SUBPLATFORM_DG2_G10,
        XE_SUBPLATFORM_DG2_G11,
        XE_SUBPLATFORM_DG2_G12,
+       XE_SUBPLATFORM_BATTLEMAGE_G21,
 };
 
 #endif
index c60159a13001469907a55321cf904f75b16eebf1..aa1b69f48f6f9f323bfd7a9453b2930b1b03fee9 100644 (file)
@@ -1138,6 +1138,6 @@ void xe_wa_apply_tile_workarounds(struct xe_tile *tile)
        if (IS_SRIOV_VF(tile->xe))
                return;
 
-       if (XE_GT_WA(tile->primary_gt, 22010954014))
+       if (XE_DEVICE_WA(tile->xe, 22010954014))
                xe_mmio_rmw32(mmio, XEHP_CLOCK_GATE_DIS, 0, SGSI_SIDECLK_DIS);
 }
index eb761d30e066a5b1dc9caf21cda46719ec074197..113a62f1b541dd205efa8a8257f97176433b8832 100644 (file)
@@ -14,7 +14,6 @@
 14016763929    SUBPLATFORM(DG2, G10)
                SUBPLATFORM(DG2, G12)
 16017236439    PLATFORM(PVC)
-22010954014    PLATFORM(DG2)
 14019821291    MEDIA_VERSION_RANGE(1300, 2000)
 14015076503    MEDIA_VERSION(1300)
 16020292621    GRAPHICS_VERSION(2004), GRAPHICS_STEP(A0, B0)
@@ -74,9 +73,5 @@
 16023683509    MEDIA_VERSION(2000), FUNC(xe_rtp_match_psmi_enabled)
                MEDIA_VERSION(3000), MEDIA_STEP(A0, B0), FUNC(xe_rtp_match_psmi_enabled)
 
-# SoC workaround - currently applies to all platforms with the following
-# primary GT GMDID
-14022085890    GRAPHICS_VERSION(2001)
-
 15015404425_disable    PLATFORM(PANTHERLAKE), MEDIA_STEP(B0, FOREVER)
 16026007364    MEDIA_VERSION(3000)
index da6301a6fceabcf19eb648b1ef077cd2d0b0b731..0cd12616d621cfc64c66db5d0ce9ebef9074bc50 100644 (file)
        MACRO__(0x64B0, ## __VA_ARGS__)
 
 /* BMG */
-#define INTEL_BMG_IDS(MACRO__, ...) \
+#define INTEL_BMG_G21_IDS(MACRO__, ...) \
        MACRO__(0xE202, ## __VA_ARGS__), \
        MACRO__(0xE209, ## __VA_ARGS__), \
        MACRO__(0xE20B, ## __VA_ARGS__), \
        MACRO__(0xE210, ## __VA_ARGS__), \
        MACRO__(0xE211, ## __VA_ARGS__), \
        MACRO__(0xE212, ## __VA_ARGS__), \
-       MACRO__(0xE216, ## __VA_ARGS__), \
+       MACRO__(0xE216, ## __VA_ARGS__)
+
+#define INTEL_BMG_IDS(MACRO__, ...) \
+       INTEL_BMG_G21_IDS(MACRO__, __VA_ARGS__), \
        MACRO__(0xE220, ## __VA_ARGS__), \
        MACRO__(0xE221, ## __VA_ARGS__), \
        MACRO__(0xE222, ## __VA_ARGS__), \