diff mbox series

[1/2] drm/xe: Add DRM_XE_VM_CREATE_FLAG_EXTOBJ_BOOKKEEP

Message ID 20240904170500.3303081-2-matthew.brost@intel.com (mailing list archive)
State New, archived
Headers show
Series Fix extobj dma-resv slot usage in XE's exec IOCTL | expand

Commit Message

Matthew Brost Sept. 4, 2024, 5:04 p.m. UTC
Add DRM_XE_VM_CREATE_FLAG_EXTOBJ_BOOKKEEP which will install exec IOCTL
fence into external BO's dma-resv bookkeep slot rather than write slot.
A bit of confusion of the usage of the dma-buf sync uAPI lead to using
the write slot. With a proper user space the bookkeep slot is
sufficient as user space will install read / write dependencies. Flags
is added to not break old user spaces.

Cc: Kenneth Graunke <kenneth.w.graunke@intel.com>
Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: Boris Brezillon <boris.brezillon@collabora.com>
Suggested-by: Simona Vetter <simona.vetter@ffwll.ch>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
---
 include/uapi/drm/xe_drm.h | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Cavitt, Jonathan Sept. 4, 2024, 5:36 p.m. UTC | #1
-----Original Message-----
From: Intel-xe <intel-xe-bounces@lists.freedesktop.org> On Behalf Of Matthew Brost
Sent: Wednesday, September 4, 2024 10:05 AM
To: intel-xe@lists.freedesktop.org; dri-devel@lists.freedesktop.org
Cc: simona.vetter@ffwll.ch; boris.brezillon@collabora.com; Landwerlin, Lionel G <lionel.g.landwerlin@intel.com>; Graunke, Kenneth W <kenneth.w.graunke@intel.com>
Subject: [PATCH 1/2] drm/xe: Add DRM_XE_VM_CREATE_FLAG_EXTOBJ_BOOKKEEP
> 
> Add DRM_XE_VM_CREATE_FLAG_EXTOBJ_BOOKKEEP which will install exec IOCTL
> fence into external BO's dma-resv bookkeep slot rather than write slot.
> A bit of confusion of the usage of the dma-buf sync uAPI lead to using
> the write slot. With a proper user space the bookkeep slot is
> sufficient as user space will install read / write dependencies. Flags
> is added to not break old user spaces.
> 
> Cc: Kenneth Graunke <kenneth.w.graunke@intel.com>
> Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
> Cc: Boris Brezillon <boris.brezillon@collabora.com>
> Suggested-by: Simona Vetter <simona.vetter@ffwll.ch>
> Signed-off-by: Matthew Brost <matthew.brost@intel.com>

LGTM, though there may be an argument to be made that this should
be squashed with the next patch in this series.  I won't be making that
argument, however.
Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
-Jonathan Cavitt

> ---
>  include/uapi/drm/xe_drm.h | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/include/uapi/drm/xe_drm.h b/include/uapi/drm/xe_drm.h
> index b6fbe4988f2e..54ec1cbce895 100644
> --- a/include/uapi/drm/xe_drm.h
> +++ b/include/uapi/drm/xe_drm.h
> @@ -849,6 +849,11 @@ struct drm_xe_gem_mmap_offset {
>   *    demand when accessed, and also allows per-VM overcommit of memory.
>   *    The xe driver internally uses recoverable pagefaults to implement
>   *    this.
> + *  - %DRM_XE_VM_CREATE_FLAG_EXTOBJ_BOOKKEEP - Insert exec IOCTL fences into
> + *    external BO's bookkeep slots rather than write slots. A bit of confusion
> + *    the dma-buf sync uAPI lead using the write slots but with a proper user
> + *    space implementation only bookkeep is required as user space will install
> + *    read / write dependecies. Flag added as an opt in to correct usage model.
>   */
>  struct drm_xe_vm_create {
>  	/** @extensions: Pointer to the first extension struct, if any */
> @@ -857,6 +862,7 @@ struct drm_xe_vm_create {
>  #define DRM_XE_VM_CREATE_FLAG_SCRATCH_PAGE	(1 << 0)
>  #define DRM_XE_VM_CREATE_FLAG_LR_MODE	        (1 << 1)
>  #define DRM_XE_VM_CREATE_FLAG_FAULT_MODE	(1 << 2)
> +#define DRM_XE_VM_CREATE_FLAG_EXTOBJ_BOOKKEEP	(1 << 3)
>  	/** @flags: Flags */
>  	__u32 flags;
>  
> -- 
> 2.34.1
> 
>
diff mbox series

Patch

diff --git a/include/uapi/drm/xe_drm.h b/include/uapi/drm/xe_drm.h
index b6fbe4988f2e..54ec1cbce895 100644
--- a/include/uapi/drm/xe_drm.h
+++ b/include/uapi/drm/xe_drm.h
@@ -849,6 +849,11 @@  struct drm_xe_gem_mmap_offset {
  *    demand when accessed, and also allows per-VM overcommit of memory.
  *    The xe driver internally uses recoverable pagefaults to implement
  *    this.
+ *  - %DRM_XE_VM_CREATE_FLAG_EXTOBJ_BOOKKEEP - Insert exec IOCTL fences into
+ *    external BO's bookkeep slots rather than write slots. A bit of confusion
+ *    the dma-buf sync uAPI lead using the write slots but with a proper user
+ *    space implementation only bookkeep is required as user space will install
+ *    read / write dependecies. Flag added as an opt in to correct usage model.
  */
 struct drm_xe_vm_create {
 	/** @extensions: Pointer to the first extension struct, if any */
@@ -857,6 +862,7 @@  struct drm_xe_vm_create {
 #define DRM_XE_VM_CREATE_FLAG_SCRATCH_PAGE	(1 << 0)
 #define DRM_XE_VM_CREATE_FLAG_LR_MODE	        (1 << 1)
 #define DRM_XE_VM_CREATE_FLAG_FAULT_MODE	(1 << 2)
+#define DRM_XE_VM_CREATE_FLAG_EXTOBJ_BOOKKEEP	(1 << 3)
 	/** @flags: Flags */
 	__u32 flags;