-----Original Message----- From: Intel-xe <intel-xe-bounces@xxxxxxxxxxxxxxxxxxxxx> On Behalf Of Matthew Brost Sent: Wednesday, September 4, 2024 10:05 AM To: intel-xe@xxxxxxxxxxxxxxxxxxxxx; dri-devel@xxxxxxxxxxxxxxxxxxxxx Cc: simona.vetter@xxxxxxxx; boris.brezillon@xxxxxxxxxxxxx; Landwerlin, Lionel G <lionel.g.landwerlin@xxxxxxxxx>; Graunke, Kenneth W <kenneth.w.graunke@xxxxxxxxx> 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@xxxxxxxxx> > Cc: Lionel Landwerlin <lionel.g.landwerlin@xxxxxxxxx> > Cc: Boris Brezillon <boris.brezillon@xxxxxxxxxxxxx> > Suggested-by: Simona Vetter <simona.vetter@xxxxxxxx> > Signed-off-by: Matthew Brost <matthew.brost@xxxxxxxxx> 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@xxxxxxxxx> -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 > >