Re: [RFC PATCH] drm/syncobj: add IOCTL to register an eventfd for a timeline

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 09 Oct 2022 14:40:14 +0000
Simon Ser <contact@xxxxxxxxxxx> 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 <contact@xxxxxxxxxxx>
> Cc: Jason Ekstrand <jason@xxxxxxxxxxxxxx>
> Cc: Daniel Vetter <daniel@xxxxxxxx>
> Cc: Christian König <christian.koenig@xxxxxxx>
> Cc: Bas Nieuwenhuizen <bas@xxxxxxxxxxxxxxxxxxx>
> Cc: Daniel Stone <daniel@xxxxxxxxxxxxx>
> Cc: Pekka Paalanen <ppaalanen@xxxxxxxxx>
> Cc: James Jones <jajones@xxxxxxxxxx>
> ---
>  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.

Attachment: pgp3t2kUkQZbq.pgp
Description: OpenPGP digital signature


[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux