Skip to content

Commit 4202dd9

Browse files
matt-auldrodrigovivi
authored andcommitted
drm/xe/migrate: fix MI_ARB_ON_OFF usage
Spec says: "This is a privileged command; it will not be effective (will be converted to a no-op) if executed from within a non-privileged batch buffer." However here it looks like we are just emitting it inside some bb which was jumped to via the ppGTT, which should be considered a non-privileged address space. It looks like we just need some way of preventing things like the emit_pte() and later copy/clear being preempted in-between so rather just emit directly in the ring for migration jobs. Bspec: 45716 Signed-off-by: Matthew Auld <[email protected]> Cc: Thomas Hellström <[email protected]> Cc: Matthew Brost <[email protected]> Reviewed-by: Matt Roper <[email protected]> Reviewed-by: Thomas Hellström <[email protected]> Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent 7eea3fb commit 4202dd9

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

drivers/gpu/drm/xe/xe_migrate.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -406,12 +406,6 @@ struct xe_migrate *xe_migrate_init(struct xe_tile *tile)
406406
return m;
407407
}
408408

409-
static void emit_arb_clear(struct xe_bb *bb)
410-
{
411-
/* 1 dword */
412-
bb->cs[bb->len++] = MI_ARB_ON_OFF | MI_ARB_DISABLE;
413-
}
414-
415409
static u64 xe_migrate_res_sizes(struct xe_res_cursor *cur)
416410
{
417411
/*
@@ -745,10 +739,6 @@ struct dma_fence *xe_migrate_copy(struct xe_migrate *m,
745739
goto err_sync;
746740
}
747741

748-
/* Preemption is enabled again by the ring ops. */
749-
if (!src_is_vram || !dst_is_vram)
750-
emit_arb_clear(bb);
751-
752742
if (!src_is_vram)
753743
emit_pte(m, bb, src_L0_pt, src_is_vram, &src_it, src_L0,
754744
src_bo);
@@ -994,7 +984,6 @@ struct dma_fence *xe_migrate_clear(struct xe_migrate *m,
994984

995985
/* Preemption is enabled again by the ring ops. */
996986
if (!clear_vram) {
997-
emit_arb_clear(bb);
998987
emit_pte(m, bb, clear_L0_pt, clear_vram, &src_it, clear_L0,
999988
bo);
1000989
} else {
@@ -1285,9 +1274,6 @@ xe_migrate_update_pgtables(struct xe_migrate *m,
12851274
VM_SA_UPDATE_UNIT_SIZE;
12861275
}
12871276

1288-
/* Preemption is enabled again by the ring ops. */
1289-
emit_arb_clear(bb);
1290-
12911277
/* Map our PT's to gtt */
12921278
bb->cs[bb->len++] = MI_STORE_DATA_IMM | MI_SDI_NUM_QW(num_updates);
12931279
bb->cs[bb->len++] = ppgtt_ofs * XE_PAGE_SIZE + page_ofs;
@@ -1316,8 +1302,6 @@ xe_migrate_update_pgtables(struct xe_migrate *m,
13161302
bb->cs[bb->len++] = MI_BATCH_BUFFER_END;
13171303
update_idx = bb->len;
13181304

1319-
/* Preemption is enabled again by the ring ops. */
1320-
emit_arb_clear(bb);
13211305
for (i = 0; i < num_updates; i++)
13221306
write_pgtable(tile, bb, 0, &updates[i], pt_update);
13231307
}

drivers/gpu/drm/xe/xe_ring_ops.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,8 @@ static void emit_migration_job_gen12(struct xe_sched_job *job,
355355
i = emit_store_imm_ggtt(xe_lrc_start_seqno_ggtt_addr(lrc),
356356
seqno, dw, i);
357357

358+
dw[i++] = MI_ARB_ON_OFF | MI_ARB_DISABLE; /* Enabled again below */
359+
358360
i = emit_bb_start(job->batch_addr[0], BIT(8), dw, i);
359361

360362
/* XXX: Do we need this? Leaving for now. */

0 commit comments

Comments
 (0)