Skip to content

Commit e751827

Browse files
mbrost05lucasdemarchi
authored andcommitted
drm/xe: Use bookkeep slots for external BO's in exec IOCTL
Fix external BO's dma-resv usage in exec IOCTL using bookkeep slots rather than write slots. This leaves syncing to user space rather than the KMD blindly enforcing write semantics on every external BO. Fixes: dd08ebf ("drm/xe: Introduce a new DRM driver for Intel GPUs") Cc: José Roberto de Souza <[email protected]> Cc: Kenneth Graunke <[email protected]> Cc: Paulo Zanoni <[email protected]> Reported-by: Simona Vetter <[email protected]> Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/2673 Signed-off-by: Matthew Brost <[email protected]> Reviewed-by: José Roberto de Souza <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit b8b1163) Signed-off-by: Lucas De Marchi <[email protected]>
1 parent 477d665 commit e751827

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

drivers/gpu/drm/xe/xe_exec.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@
4141
* user knows an exec writes to a BO and reads from the BO in the next exec, it
4242
* is the user's responsibility to pass in / out fence between the two execs).
4343
*
44-
* Implicit dependencies for external BOs are handled by using the dma-buf
45-
* implicit dependency uAPI (TODO: add link). To make this works each exec must
46-
* install the job's fence into the DMA_RESV_USAGE_WRITE slot of every external
47-
* BO mapped in the VM.
48-
*
4944
* We do not allow a user to trigger a bind at exec time rather we have a VM
5045
* bind IOCTL which uses the same in / out fence interface as exec. In that
5146
* sense, a VM bind is basically the same operation as an exec from the user
@@ -59,8 +54,8 @@
5954
* behind any pending kernel operations on any external BOs in VM or any BOs
6055
* private to the VM. This is accomplished by the rebinds waiting on BOs
6156
* DMA_RESV_USAGE_KERNEL slot (kernel ops) and kernel ops waiting on all BOs
62-
* slots (inflight execs are in the DMA_RESV_USAGE_BOOKING for private BOs and
63-
* in DMA_RESV_USAGE_WRITE for external BOs).
57+
* slots (inflight execs are in the DMA_RESV_USAGE_BOOKKEEP for private BOs and
58+
* for external BOs).
6459
*
6560
* Rebinds / dma-resv usage applies to non-compute mode VMs only as for compute
6661
* mode VMs we use preempt fences and a rebind worker (TODO: add link).
@@ -304,7 +299,8 @@ int xe_exec_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
304299
xe_sched_job_arm(job);
305300
if (!xe_vm_in_lr_mode(vm))
306301
drm_gpuvm_resv_add_fence(&vm->gpuvm, exec, &job->drm.s_fence->finished,
307-
DMA_RESV_USAGE_BOOKKEEP, DMA_RESV_USAGE_WRITE);
302+
DMA_RESV_USAGE_BOOKKEEP,
303+
DMA_RESV_USAGE_BOOKKEEP);
308304

309305
for (i = 0; i < num_syncs; i++) {
310306
xe_sync_entry_signal(&syncs[i], &job->drm.s_fence->finished);

0 commit comments

Comments
 (0)