Skip to content

Commit 695255c

Browse files
committed
Merge tag 'drm-xe-fixes-2026-07-09' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-fixes
Driver Changes: - Fix PTE index in xe_vm_populate_pgtable for chunked binds (Matt Brost) - Wait on external BO kernel fences in exec IOCTL (Matt Brost) - Remove duplicate include (Anas Khan) - Free madvise VMA array on L2 flush failure (Guangshuo Li) - Stub notifier_lock helpers when DRM_GPUSVM=n (Shuicheng Lin) Signed-off-by: Dave Airlie <airlied@redhat.com> From: Thomas Hellstrom <thomas.hellstrom@linux.intel.com> Link: https://patch.msgid.link/alASIbW318Rl-HTv@fedora
2 parents ff17ec8 + f5ef65a commit 695255c

4 files changed

Lines changed: 34 additions & 10 deletions

File tree

drivers/gpu/drm/xe/tests/xe_pci.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
#include <kunit/test-bug.h>
1111
#include <kunit/test.h>
12-
#include <kunit/test-bug.h>
1312
#include <kunit/visibility.h>
1413

1514
#define PLATFORM_CASE(platform__, graphics_step__) \

drivers/gpu/drm/xe/xe_exec.c

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -292,13 +292,23 @@ int xe_exec_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
292292
goto err_exec;
293293
}
294294

295-
/* Wait behind rebinds */
295+
/*
296+
* Wait behind rebinds and any kernel operations (evictions, defrag
297+
* moves, ...) on the VM and all external BOs. The VM's private BOs
298+
* carry their kernel ops in the VM dma-resv KERNEL slot, while each
299+
* external BO carries them in its own dma-resv KERNEL slot; both are
300+
* covered by iterating every object locked by the exec, mirroring the
301+
* drm_gpuvm_resv_add_fence() below.
302+
*/
296303
if (!xe_vm_in_lr_mode(vm)) {
297-
err = xe_sched_job_add_deps(job,
298-
xe_vm_resv(vm),
299-
DMA_RESV_USAGE_KERNEL);
300-
if (err)
301-
goto err_put_job;
304+
struct drm_gem_object *obj;
305+
306+
drm_exec_for_each_locked_object(exec, obj) {
307+
err = xe_sched_job_add_deps(job, obj->resv,
308+
DMA_RESV_USAGE_KERNEL);
309+
if (err)
310+
goto err_put_job;
311+
}
302312
}
303313

304314
for (i = 0; i < num_syncs && !err; i++)

drivers/gpu/drm/xe/xe_pt.c

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,12 +1026,22 @@ xe_vm_populate_pgtable(struct xe_migrate_pt_update *pt_update, struct xe_tile *t
10261026
u64 *ptr = data;
10271027
u32 i;
10281028

1029+
/*
1030+
* @qword_ofs is the absolute entry offset within the page table, while
1031+
* @ptes is indexed relative to @update->ofs (its first entry). The GPU
1032+
* path (write_pgtable) splits a single update into MAX_PTE_PER_SDI-sized
1033+
* chunks, calling this with an advancing @qword_ofs but a fresh @data
1034+
* pointer per chunk, so translate back into a @ptes index rather than
1035+
* assuming the chunk starts at ptes[0].
1036+
*/
10291037
for (i = 0; i < num_qwords; i++) {
1038+
u32 idx = qword_ofs - update->ofs + i;
1039+
10301040
if (map)
10311041
xe_map_wr(tile_to_xe(tile), map, (qword_ofs + i) *
1032-
sizeof(u64), u64, ptes[i].pte);
1042+
sizeof(u64), u64, ptes[idx].pte);
10331043
else
1034-
ptr[i] = ptes[i].pte;
1044+
ptr[i] = ptes[idx].pte;
10351045
}
10361046
}
10371047

@@ -1408,6 +1418,7 @@ static int xe_pt_pre_commit(struct xe_migrate_pt_update *pt_update)
14081418
pt_update_ops, rftree);
14091419
}
14101420

1421+
#if IS_ENABLED(CONFIG_DRM_GPUSVM)
14111422
/*
14121423
* Acquire/release the svm notifier_lock around xe_pt_svm_userptr_pre_commit()
14131424
* and the matching late release in xe_pt_update_ops_run(). Read mode by
@@ -1434,6 +1445,10 @@ static void xe_pt_svm_userptr_notifier_unlock(struct xe_vm *vm)
14341445
xe_svm_notifier_unlock(vm);
14351446
#endif
14361447
}
1448+
#else
1449+
static inline void xe_pt_svm_userptr_notifier_lock(struct xe_vm *vm) { }
1450+
static inline void xe_pt_svm_userptr_notifier_unlock(struct xe_vm *vm) { }
1451+
#endif
14371452

14381453
#if IS_ENABLED(CONFIG_DRM_GPUSVM)
14391454
#ifdef CONFIG_DRM_XE_USERPTR_INVAL_INJECT

drivers/gpu/drm/xe/xe_vm_madvise.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ int xe_vm_madvise_ioctl(struct drm_device *dev, void *data, struct drm_file *fil
643643
xe_device_is_l2_flush_optimized(xe) &&
644644
(pat_index != 19 && coh_mode != XE_COH_2WAY))) {
645645
err = -EINVAL;
646-
goto madv_fini;
646+
goto free_vmas;
647647
}
648648
}
649649

0 commit comments

Comments
 (0)