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

drm/xe/sriov: Convert register access to use xe_mmio

Stop using GT pointers for register access.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240910234719.3335472-82-matthew.d.roper@intel.com

+9 -9
+3 -3
drivers/gpu/drm/xe/xe_gt_sriov_pf.c
··· 74 74 75 75 static void pf_enable_ggtt_guest_update(struct xe_gt *gt) 76 76 { 77 - xe_mmio_write32(gt, VIRTUAL_CTRL_REG, GUEST_GTT_UPDATE_EN); 77 + xe_mmio_write32(&gt->mmio, VIRTUAL_CTRL_REG, GUEST_GTT_UPDATE_EN); 78 78 } 79 79 80 80 /** ··· 116 116 count = MED_VF_SW_FLAG_COUNT; 117 117 for (n = 0; n < count; n++) { 118 118 scratch = xe_reg_vf_to_pf(MED_VF_SW_FLAG(n), vfid, stride); 119 - xe_mmio_write32(gt, scratch, 0); 119 + xe_mmio_write32(&gt->mmio, scratch, 0); 120 120 } 121 121 } else { 122 122 count = VF_SW_FLAG_COUNT; 123 123 for (n = 0; n < count; n++) { 124 124 scratch = xe_reg_vf_to_pf(VF_SW_FLAG(n), vfid, stride); 125 - xe_mmio_write32(gt, scratch, 0); 125 + xe_mmio_write32(&gt->mmio, scratch, 0); 126 126 } 127 127 } 128 128 }
+3 -3
drivers/gpu/drm/xe/xe_gt_sriov_pf_service.c
··· 237 237 const struct xe_reg *regs, u32 *values) 238 238 { 239 239 while (count--) 240 - *values++ = xe_mmio_read32(gt, *regs++); 240 + *values++ = xe_mmio_read32(&gt->mmio, *regs++); 241 241 } 242 242 243 243 static void pf_prepare_runtime_info(struct xe_gt *gt) ··· 402 402 403 403 for (i = 0; i < count; ++i, ++data) { 404 404 addr = runtime->regs[start + i].addr; 405 - data->offset = xe_mmio_adjusted_addr(gt, addr); 405 + data->offset = xe_mmio_adjusted_addr(&gt->mmio, addr); 406 406 data->value = runtime->values[start + i]; 407 407 } 408 408 ··· 513 513 514 514 for (; size--; regs++, values++) { 515 515 drm_printf(p, "reg[%#x] = %#x\n", 516 - xe_mmio_adjusted_addr(gt, regs->addr), *values); 516 + xe_mmio_adjusted_addr(&gt->mmio, regs->addr), *values); 517 517 } 518 518 519 519 return 0;
+2 -2
drivers/gpu/drm/xe/xe_gt_sriov_vf.c
··· 881 881 */ 882 882 u32 xe_gt_sriov_vf_read32(struct xe_gt *gt, struct xe_reg reg) 883 883 { 884 - u32 addr = xe_mmio_adjusted_addr(gt, reg.addr); 884 + u32 addr = xe_mmio_adjusted_addr(&gt->mmio, reg.addr); 885 885 struct vf_runtime_reg *rr; 886 886 887 887 xe_gt_assert(gt, IS_SRIOV_VF(gt_to_xe(gt))); ··· 917 917 */ 918 918 void xe_gt_sriov_vf_write32(struct xe_gt *gt, struct xe_reg reg, u32 val) 919 919 { 920 - u32 addr = xe_mmio_adjusted_addr(gt, reg.addr); 920 + u32 addr = xe_mmio_adjusted_addr(&gt->mmio, reg.addr); 921 921 922 922 xe_gt_assert(gt, IS_SRIOV_VF(gt_to_xe(gt))); 923 923 xe_gt_assert(gt, !reg.vf);
+1 -1
drivers/gpu/drm/xe/xe_sriov.c
··· 35 35 36 36 static bool test_is_vf(struct xe_device *xe) 37 37 { 38 - u32 value = xe_mmio_read32(xe_root_mmio_gt(xe), VF_CAP_REG); 38 + u32 value = xe_mmio_read32(xe_root_tile_mmio(xe), VF_CAP_REG); 39 39 40 40 return value & VF_CAP; 41 41 }