On Sun, 09 Oct 2022 14:40:14 +0000 Simon Ser <cont...@emersion.fr> wrote:
> Introduce a new DRM_IOCTL_SYNCOBJ_TIMELINE_REGISTER_EVENTFD IOCTL > which signals an eventfd when a timeline point completes. > > This is useful for Wayland compositors to handle wait-before-submit. > Wayland clients can send a timeline point to the compositor > before the point has materialized yet, then compositors can wait > for the point to materialize via this new IOCTL. > > The existing DRM_IOCTL_SYNCOBJ_TIMELINE_WAIT IOCTL is not suitable > because it blocks. Compositors want to integrate the wait with > their poll(2)-based event loop. > > Signed-off-by: Simon Ser <cont...@emersion.fr> > Cc: Jason Ekstrand <ja...@jlekstrand.net> > Cc: Daniel Vetter <dan...@ffwll.ch> > Cc: Christian König <christian.koe...@amd.com> > Cc: Bas Nieuwenhuizen <b...@basnieuwenhuizen.nl> > Cc: Daniel Stone <dan...@fooishbar.org> > Cc: Pekka Paalanen <ppaala...@gmail.com> > Cc: James Jones <jajo...@nvidia.com> > --- > drivers/gpu/drm/drm_internal.h | 3 + > drivers/gpu/drm/drm_ioctl.c | 3 + > drivers/gpu/drm/drm_syncobj.c | 113 +++++++++++++++++++++++++++++++-- > include/drm/drm_syncobj.h | 6 +- > include/uapi/drm/drm.h | 15 +++++ > 5 files changed, 133 insertions(+), 7 deletions(-) ... > diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h > index 642808520d92..359e21414196 100644 > --- a/include/uapi/drm/drm.h > +++ b/include/uapi/drm/drm.h > @@ -909,6 +909,20 @@ struct drm_syncobj_timeline_wait { > __u32 pad; > }; > Hi, I'm completely clueless about this API. > +/** > + * struct drm_syncobj_timeline_register_eventfd > + * > + * Register an eventfd to be signalled when a timeline point completes. The > + * eventfd counter will be incremented by one. Sounds nice. Since the action is to increment the counter by one, does it mean it will be possible to wait for a bunch of completions and have the eventfd poll return only when they have all signaled? > + */ > +struct drm_syncobj_timeline_register_eventfd { > + __u32 handle; Handle of what? > + __u32 flags; What flags are allowed? Must be zero for now? > + __u64 point; Is this some Vulkan thingy? > + __s32 fd; I guess the userspace needs to create an eventfd first, and pass it as the argument here? This is not creating a new eventfd itself? > + __u32 pad; Must be zero? Thanks, pq > +}; > + > > struct drm_syncobj_array { > __u64 handles; > @@ -1095,6 +1109,7 @@ extern "C" { > #define DRM_IOCTL_SYNCOBJ_QUERY DRM_IOWR(0xCB, struct > drm_syncobj_timeline_array) > #define DRM_IOCTL_SYNCOBJ_TRANSFER DRM_IOWR(0xCC, struct > drm_syncobj_transfer) > #define DRM_IOCTL_SYNCOBJ_TIMELINE_SIGNAL DRM_IOWR(0xCD, struct > drm_syncobj_timeline_array) > +#define DRM_IOCTL_SYNCOBJ_TIMELINE_REGISTER_EVENTFD DRM_IOWR(0xCE, struct > drm_syncobj_timeline_register_eventfd) > > /** > * DRM_IOCTL_MODE_GETFB2 - Get framebuffer metadata.
pgpOPOXVs7Q2J.pgp
Description: OpenPGP digital signature