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

drm/xe/guc: Adding steering info support for GuC register lists

The guc_mmio_reg interface supports steering, but it is currently not
implemented. This will allow the GuC to control steering of MMIO
registers after save-restore and avoid reading from fused off MCR
register instances.

Fixes: 9c57bc08652a ("drm/xe/lnl: Drop force_probe requirement")
Signed-off-by: Jesus Narvaez <jesus.narvaez@intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241212190100.3768068-1-jesus.narvaez@intel.com
(cherry picked from commit ee5a1321df90891d59d83b7c9d5b6c5b755d059d)
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>

authored by

Jesus Narvaez and committed by
Thomas Hellström
64192bb2 5bc55a33

+22 -3
+3 -3
drivers/gpu/drm/xe/xe_gt_mcr.c
··· 550 550 * Returns true if the caller should steer to the @group/@instance values 551 551 * returned. Returns false if the caller need not perform any steering 552 552 */ 553 - static bool xe_gt_mcr_get_nonterminated_steering(struct xe_gt *gt, 554 - struct xe_reg_mcr reg_mcr, 555 - u8 *group, u8 *instance) 553 + bool xe_gt_mcr_get_nonterminated_steering(struct xe_gt *gt, 554 + struct xe_reg_mcr reg_mcr, 555 + u8 *group, u8 *instance) 556 556 { 557 557 const struct xe_reg reg = to_xe_reg(reg_mcr); 558 558 const struct xe_mmio_range *implicit_ranges;
+4
drivers/gpu/drm/xe/xe_gt_mcr.h
··· 26 26 void xe_gt_mcr_multicast_write(struct xe_gt *gt, struct xe_reg_mcr mcr_reg, 27 27 u32 value); 28 28 29 + bool xe_gt_mcr_get_nonterminated_steering(struct xe_gt *gt, 30 + struct xe_reg_mcr reg_mcr, 31 + u8 *group, u8 *instance); 32 + 29 33 void xe_gt_mcr_steering_dump(struct xe_gt *gt, struct drm_printer *p); 30 34 void xe_gt_mcr_get_dss_steering(struct xe_gt *gt, unsigned int dss, u16 *group, u16 *instance); 31 35 u32 xe_gt_mcr_steering_info_to_dss_id(struct xe_gt *gt, u16 group, u16 instance);
+15
drivers/gpu/drm/xe/xe_guc_ads.c
··· 29 29 #include "xe_platform_types.h" 30 30 #include "xe_uc_fw.h" 31 31 #include "xe_wa.h" 32 + #include "xe_gt_mcr.h" 32 33 33 34 /* Slack of a few additional entries per engine */ 34 35 #define ADS_REGSET_EXTRA_MAX 8 ··· 701 700 .offset = reg.addr, 702 701 .flags = reg.masked ? GUC_REGSET_MASKED : 0, 703 702 }; 703 + 704 + if (reg.mcr) { 705 + struct xe_reg_mcr mcr_reg = XE_REG_MCR(reg.addr); 706 + u8 group, instance; 707 + 708 + bool steer = xe_gt_mcr_get_nonterminated_steering(ads_to_gt(ads), mcr_reg, 709 + &group, &instance); 710 + 711 + if (steer) { 712 + entry.flags |= FIELD_PREP(GUC_REGSET_STEERING_GROUP, group); 713 + entry.flags |= FIELD_PREP(GUC_REGSET_STEERING_INSTANCE, instance); 714 + entry.flags |= GUC_REGSET_STEERING_NEEDED; 715 + } 716 + } 704 717 705 718 xe_map_memcpy_to(ads_to_xe(ads), regset_map, n_entry * sizeof(entry), 706 719 &entry, sizeof(entry));