Commit e12a6488 authored by Matt Roper's avatar Matt Roper Committed by Rodrigo Vivi

drm/xe: Separate number of registers from MI_LRI opcode

Keeping the number of registers to be loaded as a separate macro from
the instruction opcode will simplify some upcoming LRC parsing code.
Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Link: https://lore.kernel.org/r/20231016163449.1300701-10-matthew.d.roper@intel.comSigned-off-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent de54bb81
...@@ -25,9 +25,11 @@ ...@@ -25,9 +25,11 @@
#define MI_BATCH_BUFFER_END MI_INSTR(0x0a, 0) #define MI_BATCH_BUFFER_END MI_INSTR(0x0a, 0)
#define MI_STORE_DATA_IMM MI_INSTR(0x20, 0) #define MI_STORE_DATA_IMM MI_INSTR(0x20, 0)
#define MI_LOAD_REGISTER_IMM(x) MI_INSTR(0x22, 2*(x)-1) #define MI_LOAD_REGISTER_IMM MI_INSTR(0x22, 0)
#define MI_LRI_LRM_CS_MMIO REG_BIT(19) #define MI_LRI_LRM_CS_MMIO REG_BIT(19)
#define MI_LRI_MMIO_REMAP_EN REG_BIT(17) #define MI_LRI_MMIO_REMAP_EN REG_BIT(17)
#define MI_LRI_LENGTH GENMASK(5, 0)
#define MI_LRI_NUM_REGS(x) REG_FIELD_PREP(MI_LRI_LENGTH, 2 * (x) - 1)
#define MI_LRI_FORCE_POSTED (1<<12) #define MI_LRI_FORCE_POSTED (1<<12)
#define MI_FLUSH_DW MI_INSTR(0x26, 0) #define MI_FLUSH_DW MI_INSTR(0x26, 0)
......
...@@ -145,7 +145,7 @@ static int emit_wa_job(struct xe_gt *gt, struct xe_exec_queue *q) ...@@ -145,7 +145,7 @@ static int emit_wa_job(struct xe_gt *gt, struct xe_exec_queue *q)
if (count) { if (count) {
xe_gt_dbg(gt, "LRC WA %s save-restore batch\n", sr->name); xe_gt_dbg(gt, "LRC WA %s save-restore batch\n", sr->name);
bb->cs[bb->len++] = MI_LOAD_REGISTER_IMM(count); bb->cs[bb->len++] = MI_LOAD_REGISTER_IMM | MI_LRI_NUM_REGS(count);
xa_for_each(&sr->xa, idx, entry) { xa_for_each(&sr->xa, idx, entry) {
struct xe_reg reg = entry->reg; struct xe_reg reg = entry->reg;
......
...@@ -111,7 +111,7 @@ static void set_offsets(u32 *regs, ...@@ -111,7 +111,7 @@ static void set_offsets(u32 *regs,
flags = *data >> 6; flags = *data >> 6;
data++; data++;
*regs = MI_LOAD_REGISTER_IMM(count); *regs = MI_LOAD_REGISTER_IMM | MI_LRI_NUM_REGS(count);
if (flags & POSTED) if (flags & POSTED)
*regs |= MI_LRI_FORCE_POSTED; *regs |= MI_LRI_FORCE_POSTED;
*regs |= MI_LRI_LRM_CS_MMIO; *regs |= MI_LRI_LRM_CS_MMIO;
......
...@@ -50,7 +50,7 @@ static u32 preparser_disable(bool state) ...@@ -50,7 +50,7 @@ static u32 preparser_disable(bool state)
static int emit_aux_table_inv(struct xe_gt *gt, struct xe_reg reg, static int emit_aux_table_inv(struct xe_gt *gt, struct xe_reg reg,
u32 *dw, int i) u32 *dw, int i)
{ {
dw[i++] = MI_LOAD_REGISTER_IMM(1) | MI_LRI_MMIO_REMAP_EN; dw[i++] = MI_LOAD_REGISTER_IMM | MI_LRI_NUM_REGS(1) | MI_LRI_MMIO_REMAP_EN;
dw[i++] = reg.addr + gt->mmio.adj_offset; dw[i++] = reg.addr + gt->mmio.adj_offset;
dw[i++] = AUX_INV; dw[i++] = AUX_INV;
dw[i++] = MI_NOOP; dw[i++] = MI_NOOP;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment