diff options
author | Lucas De Marchi <lucas.demarchi@intel.com> | 2023-05-08 15:53:19 -0700 |
---|---|---|
committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2023-12-19 18:33:49 -0500 |
commit | ce8bf5bd059542431230eac216693a579dc09dba (patch) | |
tree | b6841c93b343466920343f999046fb596aa50e30 /drivers/gpu/drm/xe/xe_reg_sr.c | |
parent | 34f89ac8e66cd5121fb05c765acc3c67ddbef7a0 (diff) |
drm/xe/mmio: Use struct xe_reg
Convert all the callers to deal with xe_mmio_*() using struct xe_reg
instead of plain u32. In a few places there was also a rename
s/reg/reg_val/ when dealing with the value returned so it doesn't get
mixed up with the register address.
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://lore.kernel.org/r/20230508225322.2692066-2-lucas.demarchi@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_reg_sr.c')
-rw-r--r-- | drivers/gpu/drm/xe/xe_reg_sr.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/gpu/drm/xe/xe_reg_sr.c b/drivers/gpu/drm/xe/xe_reg_sr.c index d129e6d7cb1f..f75ef8d7500a 100644 --- a/drivers/gpu/drm/xe/xe_reg_sr.c +++ b/drivers/gpu/drm/xe/xe_reg_sr.c @@ -161,7 +161,7 @@ static void apply_one_mmio(struct xe_gt *gt, struct xe_reg_sr_entry *entry) else if (entry->clr_bits + 1) val = (reg.mcr ? xe_gt_mcr_unicast_read_any(gt, reg_mcr) : - xe_mmio_read32(gt, reg.reg)) & (~entry->clr_bits); + xe_mmio_read32(gt, reg)) & (~entry->clr_bits); else val = 0; @@ -177,7 +177,7 @@ static void apply_one_mmio(struct xe_gt *gt, struct xe_reg_sr_entry *entry) if (entry->reg.mcr) xe_gt_mcr_multicast_write(gt, reg_mcr, val); else - xe_mmio_write32(gt, reg.reg, val); + xe_mmio_write32(gt, reg, val); } void xe_reg_sr_apply_mmio(struct xe_reg_sr *sr, struct xe_gt *gt) @@ -230,15 +230,17 @@ void xe_reg_sr_apply_whitelist(struct xe_reg_sr *sr, u32 mmio_base, p = drm_debug_printer(KBUILD_MODNAME); xa_for_each(&sr->xa, reg, entry) { xe_reg_whitelist_print_entry(&p, 0, reg, entry); - xe_mmio_write32(gt, RING_FORCE_TO_NONPRIV(mmio_base, slot).reg, + xe_mmio_write32(gt, RING_FORCE_TO_NONPRIV(mmio_base, slot), reg | entry->set_bits); slot++; } /* And clear the rest just in case of garbage */ - for (; slot < RING_MAX_NONPRIV_SLOTS; slot++) - xe_mmio_write32(gt, RING_FORCE_TO_NONPRIV(mmio_base, slot).reg, - RING_NOPID(mmio_base).reg); + for (; slot < RING_MAX_NONPRIV_SLOTS; slot++) { + u32 addr = RING_NOPID(mmio_base).reg; + + xe_mmio_write32(gt, RING_FORCE_TO_NONPRIV(mmio_base, slot), addr); + } err = xe_force_wake_put(>->mmio.fw, XE_FORCEWAKE_ALL); XE_WARN_ON(err); |