Skip to content

Commit 3aa3c5c

Browse files
mbrost05Thomas Hellström
authored andcommitted
drm/xe: Map both mem.kernel_bb_pool and usm.bb_pool
For integrated devices we need to map both mem.kernel_bb_pool and usm.bb_pool to be able to run batches from both pools. Fixes: a682b6a ("drm/xe: Support device page faults on integrated platforms") Tested-by: Brian Welty <[email protected]> Signed-off-by: Matthew Brost <[email protected]> Reviewed-by: Brian Welty <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 72f86ed) Signed-off-by: Thomas Hellström <[email protected]>
1 parent 90773aa commit 3aa3c5c

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

drivers/gpu/drm/xe/xe_gt.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,10 @@ static int all_fw_domain_init(struct xe_gt *gt)
437437
* USM has its only SA pool to non-block behind user operations
438438
*/
439439
if (gt_to_xe(gt)->info.has_usm) {
440-
gt->usm.bb_pool = xe_sa_bo_manager_init(gt_to_tile(gt), SZ_1M, 16);
440+
struct xe_device *xe = gt_to_xe(gt);
441+
442+
gt->usm.bb_pool = xe_sa_bo_manager_init(gt_to_tile(gt),
443+
IS_DGFX(xe) ? SZ_1M : SZ_512K, 16);
441444
if (IS_ERR(gt->usm.bb_pool)) {
442445
err = PTR_ERR(gt->usm.bb_pool);
443446
goto err_force_wake;

drivers/gpu/drm/xe/xe_migrate.c

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,6 @@ static int xe_migrate_prepare_vm(struct xe_tile *tile, struct xe_migrate *m,
170170
if (!IS_DGFX(xe)) {
171171
/* Write out batch too */
172172
m->batch_base_ofs = NUM_PT_SLOTS * XE_PAGE_SIZE;
173-
if (xe->info.has_usm) {
174-
batch = tile->primary_gt->usm.bb_pool->bo;
175-
m->usm_batch_base_ofs = m->batch_base_ofs;
176-
}
177-
178173
for (i = 0; i < batch->size;
179174
i += vm->flags & XE_VM_FLAG_64K ? XE_64K_PAGE_SIZE :
180175
XE_PAGE_SIZE) {
@@ -185,6 +180,24 @@ static int xe_migrate_prepare_vm(struct xe_tile *tile, struct xe_migrate *m,
185180
entry);
186181
level++;
187182
}
183+
if (xe->info.has_usm) {
184+
xe_tile_assert(tile, batch->size == SZ_1M);
185+
186+
batch = tile->primary_gt->usm.bb_pool->bo;
187+
m->usm_batch_base_ofs = m->batch_base_ofs + SZ_1M;
188+
xe_tile_assert(tile, batch->size == SZ_512K);
189+
190+
for (i = 0; i < batch->size;
191+
i += vm->flags & XE_VM_FLAG_64K ? XE_64K_PAGE_SIZE :
192+
XE_PAGE_SIZE) {
193+
entry = vm->pt_ops->pte_encode_bo(batch, i,
194+
pat_index, 0);
195+
196+
xe_map_wr(xe, &bo->vmap, map_ofs + level * 8, u64,
197+
entry);
198+
level++;
199+
}
200+
}
188201
} else {
189202
u64 batch_addr = xe_bo_addr(batch, 0, XE_PAGE_SIZE);
190203

0 commit comments

Comments
 (0)