From: Pekka Paalanen <ppaalanen@gmail.com>
To: Simon Ser <contact@emersion.fr>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm: document expectations for GETFB2 handles
Date: Wed, 15 Feb 2023 15:41:23 +0200 [thread overview]
Message-ID: <20230215154123.3f9fefce@eldfell> (raw)
In-Reply-To: <20230215124152.101548-1-contact@emersion.fr>
[-- Attachment #1: Type: text/plain, Size: 2125 bytes --]
On Wed, 15 Feb 2023 12:42:00 +0000
Simon Ser <contact@emersion.fr> wrote:
> There are two important details missing from the docs:
>
> - If the memory object backing the FB already has a GEM handle,
> it's not re-used, a new one is generated.
> - Aliased planes will return the same GEM handle.
>
> Signed-off-by: Simon Ser <contact@emersion.fr>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Pekka Paalanen <ppaalanen@gmail.com>
> ---
> include/uapi/drm/drm.h | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
> index 642808520d92..4cb956a52aee 100644
> --- a/include/uapi/drm/drm.h
> +++ b/include/uapi/drm/drm.h
> @@ -1104,8 +1104,13 @@ extern "C" {
> * struct as the output.
> *
> * If the client is DRM master or has &CAP_SYS_ADMIN, &drm_mode_fb_cmd2.handles
> - * will be filled with GEM buffer handles. Planes are valid until one has a
> - * zero handle -- this can be used to compute the number of planes.
> + * will be filled with GEM buffer handles. Fresh new GEM handles are always
> + * returned, even if another GEM handle referring to the same memory object
> + * already exists on the DRM file description. The caller is responsible for
> + * removing the new handles, e.g. via the &DRM_IOCTL_GEM_CLOSE IOCTL. The same
> + * new handle will be returned for multiple planes in case they use the same
> + * memory object. Planes are valid until one has a zero handle -- this can be
> + * used to compute the number of planes.
> *
> * Otherwise, &drm_mode_fb_cmd2.handles will be zeroed and planes are valid
> * until one has a zero &drm_mode_fb_cmd2.pitches.
It is well-written, clear, and a surprise to me.
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.com>
I didn't know it was at all possible to have different GEM handles
pointing to the same object. DMABUF import is guaranteed to return the
existing GEM handle, right? Why is GETFB2 different? Why does it not
have the same problem as what forced DMABUF import to return existing
handles?
Thanks,
pq
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2023-02-15 13:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-15 12:42 [PATCH] drm: document expectations for GETFB2 handles Simon Ser
2023-02-15 13:41 ` Pekka Paalanen [this message]
2023-02-15 17:03 ` Simon Ser
2023-02-16 9:11 ` Pekka Paalanen
2023-02-16 9:25 ` Simon Ser
2023-02-16 11:19 ` Pekka Paalanen
2023-02-16 12:37 ` Daniel Stone
2023-02-16 12:46 ` Daniel Vetter
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=20230215154123.3f9fefce@eldfell \
--to=ppaalanen@gmail.com \
--cc=contact@emersion.fr \
--cc=dri-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.