Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/xe: Handle Wa_22010954014 and Wa_14022085890 as device workarounds

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>

+17 -9
+2
drivers/gpu/drm/xe/xe_device_wa_oob.rules
··· 1 + 22010954014 PLATFORM(DG2) 1 2 15015404425 PLATFORM(LUNARLAKE) 2 3 PLATFORM(PANTHERLAKE) 3 4 22019338487_display PLATFORM(LUNARLAKE) 5 + 14022085890 SUBPLATFORM(BATTLEMAGE, G21)
+2 -1
drivers/gpu/drm/xe/xe_guc_pc.c
··· 14 14 15 15 #include <drm/drm_managed.h> 16 16 #include <drm/drm_print.h> 17 + #include <generated/xe_device_wa_oob.h> 17 18 #include <generated/xe_wa_oob.h> 18 19 19 20 #include "abi/guc_actions_slpc_abi.h" ··· 887 886 if (pc_get_min_freq(pc) > pc->rp0_freq) 888 887 ret = pc_set_min_freq(pc, pc->rp0_freq); 889 888 890 - if (XE_GT_WA(tile->primary_gt, 14022085890)) 889 + if (XE_DEVICE_WA(tile_to_xe(tile), 14022085890)) 891 890 ret = pc_set_min_freq(pc, max(BMG_MIN_FREQ, pc_get_min_freq(pc))); 892 891 893 892 out:
+6
drivers/gpu/drm/xe/xe_pci.c
··· 335 335 .vm_max_level = 4, 336 336 }; 337 337 338 + static const u16 bmg_g21_ids[] = { INTEL_BMG_G21_IDS(NOP), 0 }; 339 + 338 340 static const struct xe_device_desc bmg_desc = { 339 341 DGFX_FEATURES, 340 342 PLATFORM(BATTLEMAGE), ··· 351 349 .has_sriov = true, 352 350 .max_gt_per_tile = 2, 353 351 .needs_scratch = true, 352 + .subplatforms = (const struct xe_subplatform_desc[]) { 353 + { XE_SUBPLATFORM_BATTLEMAGE_G21, "G21", bmg_g21_ids }, 354 + { } 355 + }, 354 356 .va_bits = 48, 355 357 .vm_max_level = 4, 356 358 };
+1
drivers/gpu/drm/xe/xe_platform_types.h
··· 34 34 XE_SUBPLATFORM_DG2_G10, 35 35 XE_SUBPLATFORM_DG2_G11, 36 36 XE_SUBPLATFORM_DG2_G12, 37 + XE_SUBPLATFORM_BATTLEMAGE_G21, 37 38 }; 38 39 39 40 #endif
+1 -1
drivers/gpu/drm/xe/xe_wa.c
··· 1138 1138 if (IS_SRIOV_VF(tile->xe)) 1139 1139 return; 1140 1140 1141 - if (XE_GT_WA(tile->primary_gt, 22010954014)) 1141 + if (XE_DEVICE_WA(tile->xe, 22010954014)) 1142 1142 xe_mmio_rmw32(mmio, XEHP_CLOCK_GATE_DIS, 0, SGSI_SIDECLK_DIS); 1143 1143 }
-5
drivers/gpu/drm/xe/xe_wa_oob.rules
··· 14 14 14016763929 SUBPLATFORM(DG2, G10) 15 15 SUBPLATFORM(DG2, G12) 16 16 16017236439 PLATFORM(PVC) 17 - 22010954014 PLATFORM(DG2) 18 17 14019821291 MEDIA_VERSION_RANGE(1300, 2000) 19 18 14015076503 MEDIA_VERSION(1300) 20 19 16020292621 GRAPHICS_VERSION(2004), GRAPHICS_STEP(A0, B0) ··· 72 73 MEDIA_VERSION(3002), FUNC(xe_rtp_match_psmi_enabled) 73 74 16023683509 MEDIA_VERSION(2000), FUNC(xe_rtp_match_psmi_enabled) 74 75 MEDIA_VERSION(3000), MEDIA_STEP(A0, B0), FUNC(xe_rtp_match_psmi_enabled) 75 - 76 - # SoC workaround - currently applies to all platforms with the following 77 - # primary GT GMDID 78 - 14022085890 GRAPHICS_VERSION(2001) 79 76 80 77 15015404425_disable PLATFORM(PANTHERLAKE), MEDIA_STEP(B0, FOREVER) 81 78 16026007364 MEDIA_VERSION(3000)
+5 -2
include/drm/intel/pciids.h
··· 849 849 MACRO__(0x64B0, ## __VA_ARGS__) 850 850 851 851 /* BMG */ 852 - #define INTEL_BMG_IDS(MACRO__, ...) \ 852 + #define INTEL_BMG_G21_IDS(MACRO__, ...) \ 853 853 MACRO__(0xE202, ## __VA_ARGS__), \ 854 854 MACRO__(0xE209, ## __VA_ARGS__), \ 855 855 MACRO__(0xE20B, ## __VA_ARGS__), \ ··· 858 858 MACRO__(0xE210, ## __VA_ARGS__), \ 859 859 MACRO__(0xE211, ## __VA_ARGS__), \ 860 860 MACRO__(0xE212, ## __VA_ARGS__), \ 861 - MACRO__(0xE216, ## __VA_ARGS__), \ 861 + MACRO__(0xE216, ## __VA_ARGS__) 862 + 863 + #define INTEL_BMG_IDS(MACRO__, ...) \ 864 + INTEL_BMG_G21_IDS(MACRO__, __VA_ARGS__), \ 862 865 MACRO__(0xE220, ## __VA_ARGS__), \ 863 866 MACRO__(0xE221, ## __VA_ARGS__), \ 864 867 MACRO__(0xE222, ## __VA_ARGS__), \