aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Welty <[email protected]>2023-11-20 10:44:51 -0800
committerRodrigo Vivi <[email protected]>2023-12-21 11:45:10 -0500
commita682b6a42d4de68419f23d73afa57fc931fed3c6 (patch)
tree7cd36b0e227b64a046bdb0b67ef8a92e5de7b43e
parentf4a0a113f103e23adb4f3ba8a0e02ce4973fdedf (diff)
drm/xe: Support device page faults on integrated platforms
Update xe_migrate_prepare_vm() to use the usm batch buffer even for servicing device page faults on integrated platforms. And as we have no VRAM on integrated platforms, device pagefault handler should not attempt to migrate into VRAM. LNL is first integrated platform to support device pagefaults. Signed-off-by: Brian Welty <[email protected]> Reviewed-by: Matthew Brost <[email protected]> Signed-off-by: Rodrigo Vivi <[email protected]>
-rw-r--r--drivers/gpu/drm/xe/xe_gt_pagefault.c2
-rw-r--r--drivers/gpu/drm/xe/xe_migrate.c7
2 files changed, 6 insertions, 3 deletions
diff --git a/drivers/gpu/drm/xe/xe_gt_pagefault.c b/drivers/gpu/drm/xe/xe_gt_pagefault.c
index 0a278df6a97f..ccf5a6671faf 100644
--- a/drivers/gpu/drm/xe/xe_gt_pagefault.c
+++ b/drivers/gpu/drm/xe/xe_gt_pagefault.c
@@ -106,7 +106,7 @@ static int xe_pf_begin(struct drm_exec *exec, struct xe_vma *vma,
if (err)
return err;
- if (atomic) {
+ if (atomic && IS_DGFX(vm->xe)) {
if (xe_vma_is_userptr(vma)) {
err = -EACCES;
return err;
diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c
index 4aea748c984b..84e138df0172 100644
--- a/drivers/gpu/drm/xe/xe_migrate.c
+++ b/drivers/gpu/drm/xe/xe_migrate.c
@@ -215,10 +215,13 @@ static int xe_migrate_prepare_vm(struct xe_tile *tile, struct xe_migrate *m,
}
if (!IS_DGFX(xe)) {
- xe_tile_assert(tile, !xe->info.supports_usm);
-
/* Write out batch too */
m->batch_base_ofs = NUM_PT_SLOTS * XE_PAGE_SIZE;
+ if (xe->info.supports_usm) {
+ batch = tile->primary_gt->usm.bb_pool->bo;
+ m->usm_batch_base_ofs = m->batch_base_ofs;
+ }
+
for (i = 0; i < batch->size;
i += vm->flags & XE_VM_FLAG_64K ? XE_64K_PAGE_SIZE :
XE_PAGE_SIZE) {