Skip to content

Commit 4c20075

Browse files
author
Thomas Hellström
committed
drm/xe/migrate: Allow xe_migrate_vram() also on non-pagefault capable devices
The drm_pagemap functionality does not depend on the device having recoverable pagefaults available. So allow xe_migrate_vram() also for such devices. Even if this will have little use in practice, it's beneficial for testin multi-device SVM, since a memory provider could be a non-pagefault capable gpu. Signed-off-by: Thomas Hellström <[email protected]> Reviewed-by: Matthew Brost <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 3cbb651 commit 4c20075

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/gpu/drm/xe/xe_migrate.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1609,6 +1609,7 @@ static struct dma_fence *xe_migrate_vram(struct xe_migrate *m,
16091609
{
16101610
struct xe_gt *gt = m->tile->primary_gt;
16111611
struct xe_device *xe = gt_to_xe(gt);
1612+
bool use_usm_batch = xe->info.has_usm;
16121613
struct dma_fence *fence = NULL;
16131614
u32 batch_size = 2;
16141615
u64 src_L0_ofs, dst_L0_ofs;
@@ -1625,7 +1626,7 @@ static struct dma_fence *xe_migrate_vram(struct xe_migrate *m,
16251626
batch_size += pte_update_cmd_size(round_update_size);
16261627
batch_size += EMIT_COPY_DW;
16271628

1628-
bb = xe_bb_new(gt, batch_size, true);
1629+
bb = xe_bb_new(gt, batch_size, use_usm_batch);
16291630
if (IS_ERR(bb)) {
16301631
err = PTR_ERR(bb);
16311632
return ERR_PTR(err);
@@ -1650,7 +1651,7 @@ static struct dma_fence *xe_migrate_vram(struct xe_migrate *m,
16501651
XE_PAGE_SIZE);
16511652

16521653
job = xe_bb_create_migration_job(m->q, bb,
1653-
xe_migrate_batch_base(m, true),
1654+
xe_migrate_batch_base(m, use_usm_batch),
16541655
update_idx);
16551656
if (IS_ERR(job)) {
16561657
err = PTR_ERR(job);

0 commit comments

Comments
 (0)