Skip to content

Commit 88fca61

Browse files
committed
Revert "drm/xe: Force write completion of MI_STORE_DATA_IMM"
This reverts commit 1460bb1. In all places the MI_STORE_DATA_IMM are not followed by a read of the same memory address in the same batch buffer and the posted writes are flushed with PIPE_CONTROL or MI_FLUSH_DW in xe_ring_ops.c functions so there is no need to set this register. Reviewed-by: Ashutosh Dixit <[email protected]> Cc: Thomas Hellström <[email protected]> Cc: Ashutosh Dixit <[email protected]> Fixes: 1460bb1 ("drm/xe: Force write completion of MI_STORE_DATA_IMM") Signed-off-by: José Roberto de Souza <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent fba0f03 commit 88fca61

File tree

3 files changed

+11
-19
lines changed

3 files changed

+11
-19
lines changed

drivers/gpu/drm/xe/instructions/xe_mi_commands.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,12 @@
3333
#define MI_TOPOLOGY_FILTER __MI_INSTR(0xD)
3434
#define MI_FORCE_WAKEUP __MI_INSTR(0x1D)
3535

36-
#define MI_STORE_DATA_IMM __MI_INSTR(0x20)
37-
#define MI_SDI_GGTT REG_BIT(22)
38-
#define MI_FORCE_WRITE_COMPLETION_CHECK REG_BIT(10)
39-
#define MI_SDI_LEN_DW GENMASK(9, 0)
40-
#define MI_SDI_NUM_DW(x) REG_FIELD_PREP(MI_SDI_LEN_DW, (x) + 3 - 2)
41-
#define MI_SDI_NUM_QW(x) (REG_FIELD_PREP(MI_SDI_LEN_DW, 2 * (x) + 3 - 2) | \
42-
REG_BIT(21))
36+
#define MI_STORE_DATA_IMM __MI_INSTR(0x20)
37+
#define MI_SDI_GGTT REG_BIT(22)
38+
#define MI_SDI_LEN_DW GENMASK(9, 0)
39+
#define MI_SDI_NUM_DW(x) REG_FIELD_PREP(MI_SDI_LEN_DW, (x) + 3 - 2)
40+
#define MI_SDI_NUM_QW(x) (REG_FIELD_PREP(MI_SDI_LEN_DW, 2 * (x) + 3 - 2) | \
41+
REG_BIT(21))
4342

4443
#define MI_LOAD_REGISTER_IMM __MI_INSTR(0x22)
4544
#define MI_LRI_LRM_CS_MMIO REG_BIT(19)

drivers/gpu/drm/xe/xe_migrate.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -581,9 +581,7 @@ static void emit_pte(struct xe_migrate *m,
581581
while (ptes) {
582582
u32 chunk = min(MAX_PTE_PER_SDI, ptes);
583583

584-
bb->cs[bb->len++] = MI_STORE_DATA_IMM |
585-
MI_FORCE_WRITE_COMPLETION_CHECK |
586-
MI_SDI_NUM_QW(chunk);
584+
bb->cs[bb->len++] = MI_STORE_DATA_IMM | MI_SDI_NUM_QW(chunk);
587585
bb->cs[bb->len++] = ofs;
588586
bb->cs[bb->len++] = 0;
589587

@@ -1225,9 +1223,7 @@ static void write_pgtable(struct xe_tile *tile, struct xe_bb *bb, u64 ppgtt_ofs,
12251223
if (!(bb->len & 1))
12261224
bb->cs[bb->len++] = MI_NOOP;
12271225

1228-
bb->cs[bb->len++] = MI_STORE_DATA_IMM |
1229-
MI_FORCE_WRITE_COMPLETION_CHECK |
1230-
MI_SDI_NUM_QW(chunk);
1226+
bb->cs[bb->len++] = MI_STORE_DATA_IMM | MI_SDI_NUM_QW(chunk);
12311227
bb->cs[bb->len++] = lower_32_bits(addr);
12321228
bb->cs[bb->len++] = upper_32_bits(addr);
12331229
if (pt_op->bind)
@@ -1392,8 +1388,7 @@ __xe_migrate_update_pgtables(struct xe_migrate *m,
13921388
u32 idx = 0;
13931389

13941390
bb->cs[bb->len++] = MI_STORE_DATA_IMM |
1395-
MI_FORCE_WRITE_COMPLETION_CHECK |
1396-
MI_SDI_NUM_QW(chunk);
1391+
MI_SDI_NUM_QW(chunk);
13971392
bb->cs[bb->len++] = ofs;
13981393
bb->cs[bb->len++] = 0; /* upper_32_bits */
13991394

drivers/gpu/drm/xe/xe_ring_ops.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ static int emit_user_interrupt(u32 *dw, int i)
7272

7373
static int emit_store_imm_ggtt(u32 addr, u32 value, u32 *dw, int i)
7474
{
75-
dw[i++] = MI_STORE_DATA_IMM | MI_SDI_GGTT |
76-
MI_FORCE_WRITE_COMPLETION_CHECK | MI_SDI_NUM_DW(1);
75+
dw[i++] = MI_STORE_DATA_IMM | MI_SDI_GGTT | MI_SDI_NUM_DW(1);
7776
dw[i++] = addr;
7877
dw[i++] = 0;
7978
dw[i++] = value;
@@ -163,8 +162,7 @@ static int emit_pipe_invalidate(u32 mask_flags, bool invalidate_tlb, u32 *dw,
163162
static int emit_store_imm_ppgtt_posted(u64 addr, u64 value,
164163
u32 *dw, int i)
165164
{
166-
dw[i++] = MI_STORE_DATA_IMM | MI_FORCE_WRITE_COMPLETION_CHECK |
167-
MI_SDI_NUM_QW(1);
165+
dw[i++] = MI_STORE_DATA_IMM | MI_SDI_NUM_QW(1);
168166
dw[i++] = lower_32_bits(addr);
169167
dw[i++] = upper_32_bits(addr);
170168
dw[i++] = lower_32_bits(value);

0 commit comments

Comments
 (0)