Skip to content

Commit e2a0a63

Browse files
Tvrtko Ursulinlucasdemarchi
authored andcommitted
drm/xe: Fix ring flush invalidation
Emit_flush_invalidate() is incorrectly marking the write to LRC_PPHWSP as a GGTT write and also writing an atypical ~0 dword as the payload. Fix it. While at it drop the unused flags argument. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250307111402.26577-3-tvrtko.ursulin@igalia.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> (cherry picked from commit 08ea901) Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
1 parent 298661c commit e2a0a63

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

drivers/gpu/drm/xe/xe_ring_ops.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,13 @@ static int emit_bb_start(u64 batch_addr, u32 ppgtt_flag, u32 *dw, int i)
111111
return i;
112112
}
113113

114-
static int emit_flush_invalidate(u32 flag, u32 *dw, int i)
114+
static int emit_flush_invalidate(u32 *dw, int i)
115115
{
116-
dw[i] = MI_FLUSH_DW;
117-
dw[i] |= flag;
118-
dw[i++] |= MI_INVALIDATE_TLB | MI_FLUSH_DW_OP_STOREDW | MI_FLUSH_IMM_DW |
119-
MI_FLUSH_DW_STORE_INDEX;
120-
121-
dw[i++] = LRC_PPHWSP_FLUSH_INVAL_SCRATCH_ADDR | MI_FLUSH_DW_USE_GTT;
116+
dw[i++] = MI_FLUSH_DW | MI_INVALIDATE_TLB | MI_FLUSH_DW_OP_STOREDW |
117+
MI_FLUSH_IMM_DW | MI_FLUSH_DW_STORE_INDEX;
118+
dw[i++] = LRC_PPHWSP_FLUSH_INVAL_SCRATCH_ADDR;
119+
dw[i++] = 0;
122120
dw[i++] = 0;
123-
dw[i++] = ~0U;
124121

125122
return i;
126123
}
@@ -413,7 +410,7 @@ static void emit_migration_job_gen12(struct xe_sched_job *job,
413410
if (!IS_SRIOV_VF(gt_to_xe(job->q->gt))) {
414411
/* XXX: Do we need this? Leaving for now. */
415412
dw[i++] = preparser_disable(true);
416-
i = emit_flush_invalidate(0, dw, i);
413+
i = emit_flush_invalidate(dw, i);
417414
dw[i++] = preparser_disable(false);
418415
}
419416

0 commit comments

Comments
 (0)