dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Simon Ser <contact@emersion.fr>, dri-devel@lists.freedesktop.org
Cc: Alex Deucher <alexander.deucher@amd.com>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	Jeffrey Hugo <quic_jhugo@quicinc.com>
Subject: Re: [PATCH] drm/doc: document that PRIME import/export is always supported
Date: Thu, 13 Jul 2023 07:09:46 +0200	[thread overview]
Message-ID: <69a71fab-2407-49ed-d445-5dccc126c64b@suse.de> (raw)
In-Reply-To: <20230712183156.191445-1-contact@emersion.fr>


[-- Attachment #1.1: Type: text/plain, Size: 2470 bytes --]

Hi

Am 12.07.23 um 20:32 schrieb Simon Ser:
> Since commit 6b85aa68d9d5 ("drm: Enable PRIME import/export for all
> drivers"), import/export is always supported. Document this so that
> user-space knows what to expect.
> 
> Signed-off-by: Simon Ser <contact@emersion.fr>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Cc: Jeffrey Hugo <quic_jhugo@quicinc.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>   include/uapi/drm/drm.h | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
> index a87bbbbca2d4..56c194df527e 100644
> --- a/include/uapi/drm/drm.h
> +++ b/include/uapi/drm/drm.h
> @@ -673,6 +673,9 @@ struct drm_gem_open {
>    * Bitfield of supported PRIME sharing capabilities. See &DRM_PRIME_CAP_IMPORT
>    * and &DRM_PRIME_CAP_EXPORT.
>    *
> + * Starting from kernel version 6.6, both &DRM_PRIME_CAP_IMPORT and
> + * &DRM_PRIME_CAP_EXPORT are always advertised.
> + *

When people port these changes into their trees the version becomes 
meaningless. There are so many "enterprise kernels" that combine whole 
subsystems from different upstream releases.

That makes me wonder if such documentation makes sense. We want to avoid 
a situation where userspace does

if (v6.6)
   do()
else if (test_flags())
   do()

Best regards
Thomas

>    * PRIME buffers are exposed as dma-buf file descriptors. See
>    * Documentation/gpu/drm-mm.rst, section "PRIME Buffer Sharing".
>    */
> @@ -682,6 +685,8 @@ struct drm_gem_open {
>    *
>    * If this bit is set in &DRM_CAP_PRIME, the driver supports importing PRIME
>    * buffers via the &DRM_IOCTL_PRIME_FD_TO_HANDLE ioctl.
> + *
> + * Starting from kernel version 6.6, this bit is always set in &DRM_CAP_PRIME.
>    */
>   #define  DRM_PRIME_CAP_IMPORT		0x1
>   /**
> @@ -689,6 +694,8 @@ struct drm_gem_open {
>    *
>    * If this bit is set in &DRM_CAP_PRIME, the driver supports exporting PRIME
>    * buffers via the &DRM_IOCTL_PRIME_HANDLE_TO_FD ioctl.
> + *
> + * Starting from kernel version 6.6, this bit is always set in &DRM_CAP_PRIME.
>    */
>   #define  DRM_PRIME_CAP_EXPORT		0x2
>   /**

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)

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

  parent reply	other threads:[~2023-07-13  5:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-12 18:32 [PATCH] drm/doc: document that PRIME import/export is always supported Simon Ser
2023-07-12 18:37 ` Jeffrey Hugo
2023-07-13  5:09 ` Thomas Zimmermann [this message]
2023-07-13  7:17   ` Simon Ser
2023-07-13  7:45     ` Thomas Zimmermann

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=69a71fab-2407-49ed-d445-5dccc126c64b@suse.de \
    --to=tzimmermann@suse.de \
    --cc=alexander.deucher@amd.com \
    --cc=contact@emersion.fr \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=quic_jhugo@quicinc.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox