All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pekka Paalanen <ppaalanen@gmail.com>
To: Simon Ser <contact@emersion.fr>
Cc: "Jason Ekstrand" <jason@jlekstrand.net>,
	"James Jones" <jajones@nvidia.com>,
	dri-devel@lists.freedesktop.org,
	wayland-devel@lists.freedesktop.org,
	"Christian König" <christian.koenig@amd.com>
Subject: Re: [RFC PATCH] drm/syncobj: add IOCTL to register an eventfd for a timeline
Date: Mon, 10 Oct 2022 11:19:34 +0300	[thread overview]
Message-ID: <20221010111934.1e1d84ac@eldfell> (raw)
In-Reply-To: <20221009144001.161124-1-contact@emersion.fr>

[-- Attachment #1: Type: text/plain, Size: 3037 bytes --]

On Sun, 09 Oct 2022 14:40:14 +0000
Simon Ser <contact@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 <contact@emersion.fr>
> Cc: Jason Ekstrand <jason@jlekstrand.net>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Christian König <christian.koenig@amd.com>
> Cc: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
> Cc: Daniel Stone <daniel@fooishbar.org>
> Cc: Pekka Paalanen <ppaalanen@gmail.com>
> Cc: James Jones <jajones@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.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2022-10-10  8:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-09 14:40 [RFC PATCH] drm/syncobj: add IOCTL to register an eventfd for a timeline Simon Ser
2022-10-09 18:00 ` Christian König
2022-10-10  9:13   ` Simon Ser
2022-10-11 12:10     ` Christian König
2022-10-12 10:25       ` Simon Ser
2022-10-12 11:00         ` Christian König
2022-10-10  8:19 ` Pekka Paalanen [this message]
2022-10-10  9:20   ` Simon Ser

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=20221010111934.1e1d84ac@eldfell \
    --to=ppaalanen@gmail.com \
    --cc=christian.koenig@amd.com \
    --cc=contact@emersion.fr \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jajones@nvidia.com \
    --cc=jason@jlekstrand.net \
    --cc=wayland-devel@lists.freedesktop.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.