diff options
author | Lucas De Marchi <lucas.demarchi@intel.com> | 2023-05-09 00:53:19 +0200 |
---|---|---|
committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2023-12-20 00:33:49 +0100 |
commit | ce8bf5bd059542431230eac216693a579dc09dba (patch) | |
tree | b6841c93b343466920343f999046fb596aa50e30 /drivers/gpu/drm/xe/xe_pat.c | |
parent | drm/xe: Handle -EDEADLK case in exec ioctl (diff) | |
download | linux-ce8bf5bd059542431230eac216693a579dc09dba.tar.xz linux-ce8bf5bd059542431230eac216693a579dc09dba.zip |
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_pat.c')
-rw-r--r-- | drivers/gpu/drm/xe/xe_pat.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/gpu/drm/xe/xe_pat.c b/drivers/gpu/drm/xe/xe_pat.c index abee41fa3cb9..b56a65779d26 100644 --- a/drivers/gpu/drm/xe/xe_pat.c +++ b/drivers/gpu/drm/xe/xe_pat.c @@ -64,14 +64,20 @@ static const u32 mtl_pat_table[] = { static void program_pat(struct xe_gt *gt, const u32 table[], int n_entries) { - for (int i = 0; i < n_entries; i++) - xe_mmio_write32(gt, _PAT_INDEX(i), table[i]); + for (int i = 0; i < n_entries; i++) { + struct xe_reg reg = XE_REG(_PAT_INDEX(i)); + + xe_mmio_write32(gt, reg, table[i]); + } } static void program_pat_mcr(struct xe_gt *gt, const u32 table[], int n_entries) { - for (int i = 0; i < n_entries; i++) - xe_gt_mcr_multicast_write(gt, XE_REG_MCR(_PAT_INDEX(i)), table[i]); + for (int i = 0; i < n_entries; i++) { + struct xe_reg_mcr reg_mcr = XE_REG_MCR(_PAT_INDEX(i)); + + xe_gt_mcr_multicast_write(gt, reg_mcr, table[i]); + } } void xe_pat_init(struct xe_gt *gt) |