From: "Souza, Jose" <jose.souza@intel.com>
To: "intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>,
"Brost, Matthew" <matthew.brost@intel.com>
Cc: "Zanoni, Paulo R" <paulo.r.zanoni@intel.com>,
"Graunke, Kenneth W" <kenneth.w.graunke@intel.com>
Subject: Re: [PATCH] drm/xe: Use bookkeep slots for external BO's in exec IOCTL
Date: Wed, 11 Sep 2024 15:37:11 +0000 [thread overview]
Message-ID: <7199ce6364bc4ae5d66600e49acb288fa58a585e.camel@intel.com> (raw)
In-Reply-To: <20240911152622.903058-1-matthew.brost@intel.com>
On Wed, 2024-09-11 at 08:26 -0700, Matthew Brost wrote:
> 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.
>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
> Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
> Cc: José Roberto de Souza <jose.souza@intel.com>
> Cc: Kenneth Graunke <kenneth.w.graunke@intel.com>
> Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
> Reported-by: Simona Vetter <simona.vetter@ffwll.ch>
> Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/2673
> Signed-off-by: Matthew Brost <matthew.brost@intel.com>
> ---
> drivers/gpu/drm/xe/xe_exec.c | 12 ++++--------
> 1 file changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_exec.c b/drivers/gpu/drm/xe/xe_exec.c
> index 7b38485817dc..f23ac1e2ed88 100644
> --- a/drivers/gpu/drm/xe/xe_exec.c
> +++ b/drivers/gpu/drm/xe/xe_exec.c
> @@ -41,11 +41,6 @@
> * user knows an exec writes to a BO and reads from the BO in the next exec, it
> * is the user's responsibility to pass in / out fence between the two execs).
> *
> - * Implicit dependencies for external BOs are handled by using the dma-buf
> - * implicit dependency uAPI (TODO: add link). To make this works each exec must
> - * install the job's fence into the DMA_RESV_USAGE_WRITE slot of every external
> - * BO mapped in the VM.
> - *
> * We do not allow a user to trigger a bind at exec time rather we have a VM
> * bind IOCTL which uses the same in / out fence interface as exec. In that
> * sense, a VM bind is basically the same operation as an exec from the user
> @@ -59,8 +54,8 @@
> * behind any pending kernel operations on any external BOs in VM or any BOs
> * private to the VM. This is accomplished by the rebinds waiting on BOs
> * DMA_RESV_USAGE_KERNEL slot (kernel ops) and kernel ops waiting on all BOs
> - * slots (inflight execs are in the DMA_RESV_USAGE_BOOKING for private BOs and
> - * in DMA_RESV_USAGE_WRITE for external BOs).
> + * slots (inflight execs are in the DMA_RESV_USAGE_BOOKKEEP for private BOs and
> + * for external BOs).
> *
> * Rebinds / dma-resv usage applies to non-compute mode VMs only as for compute
> * 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)
> xe_sched_job_arm(job);
> if (!xe_vm_in_lr_mode(vm))
> drm_gpuvm_resv_add_fence(&vm->gpuvm, exec, &job->drm.s_fence->finished,
> - DMA_RESV_USAGE_BOOKKEEP, DMA_RESV_USAGE_WRITE);
> + DMA_RESV_USAGE_BOOKKEEP,
> + DMA_RESV_USAGE_BOOKKEEP);
>
> for (i = 0; i < num_syncs; i++) {
> xe_sync_entry_signal(&syncs[i], &job->drm.s_fence->finished);
next prev parent reply other threads:[~2024-09-11 15:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-11 15:26 [PATCH] drm/xe: Use bookkeep slots for external BO's in exec IOCTL Matthew Brost
2024-09-11 15:31 ` ✓ CI.Patch_applied: success for " Patchwork
2024-09-11 15:31 ` ✓ CI.checkpatch: " Patchwork
2024-09-11 15:32 ` ✓ CI.KUnit: " Patchwork
2024-09-11 15:37 ` Souza, Jose [this message]
2024-09-11 22:06 ` [PATCH] " Kenneth Graunke
2024-09-11 15:44 ` ✓ CI.Build: success for " Patchwork
2024-09-11 15:46 ` ✓ CI.Hooks: " Patchwork
2024-09-11 15:48 ` ✓ CI.checksparse: " Patchwork
2024-09-11 16:04 ` ✗ CI.BAT: failure " Patchwork
2024-09-11 16:45 ` Matthew Brost
2024-09-11 17:06 ` ✗ CI.FULL: " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7199ce6364bc4ae5d66600e49acb288fa58a585e.camel@intel.com \
--to=jose.souza@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=kenneth.w.graunke@intel.com \
--cc=matthew.brost@intel.com \
--cc=paulo.r.zanoni@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox