* [PATCH] drm/doc: document that PRIME import/export is always supported
@ 2023-07-12 18:32 Simon Ser
2023-07-12 18:37 ` Jeffrey Hugo
2023-07-13 5:09 ` Thomas Zimmermann
0 siblings, 2 replies; 5+ messages in thread
From: Simon Ser @ 2023-07-12 18:32 UTC (permalink / raw)
To: dri-devel; +Cc: Alex Deucher, Daniel Vetter, Jeffrey Hugo, Thomas Zimmermann
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.
+ *
* 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
/**
--
2.41.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/doc: document that PRIME import/export is always supported
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
1 sibling, 0 replies; 5+ messages in thread
From: Jeffrey Hugo @ 2023-07-12 18:37 UTC (permalink / raw)
To: Simon Ser, dri-devel; +Cc: Alex Deucher, Daniel Vetter, Thomas Zimmermann
On 7/12/2023 12:32 PM, Simon Ser wrote:
> 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>
Seems reasonable to me.
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/doc: document that PRIME import/export is always supported
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
2023-07-13 7:17 ` Simon Ser
1 sibling, 1 reply; 5+ messages in thread
From: Thomas Zimmermann @ 2023-07-13 5:09 UTC (permalink / raw)
To: Simon Ser, dri-devel; +Cc: Alex Deucher, Daniel Vetter, Jeffrey Hugo
[-- 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 --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/doc: document that PRIME import/export is always supported
2023-07-13 5:09 ` Thomas Zimmermann
@ 2023-07-13 7:17 ` Simon Ser
2023-07-13 7:45 ` Thomas Zimmermann
0 siblings, 1 reply; 5+ messages in thread
From: Simon Ser @ 2023-07-13 7:17 UTC (permalink / raw)
To: Thomas Zimmermann; +Cc: Alex Deucher, Daniel Vetter, Jeffrey Hugo, dri-devel
On Thursday, July 13th, 2023 at 07:09, Thomas Zimmermann <tzimmermann@suse.de> wrote:
> > + * 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()
Daniel Vetter asked for specific kernel versions in b603e810f740
("drm/uapi: document kernel capabilities"). It allows user-space to
figure out how widespread a cap is.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/doc: document that PRIME import/export is always supported
2023-07-13 7:17 ` Simon Ser
@ 2023-07-13 7:45 ` Thomas Zimmermann
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Zimmermann @ 2023-07-13 7:45 UTC (permalink / raw)
To: Simon Ser; +Cc: Alex Deucher, Daniel Vetter, Jeffrey Hugo, dri-devel
[-- Attachment #1.1: Type: text/plain, Size: 1089 bytes --]
Am 13.07.23 um 09:17 schrieb Simon Ser:
> On Thursday, July 13th, 2023 at 07:09, Thomas Zimmermann <tzimmermann@suse.de> wrote:
>
>>> + * 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()
>
> Daniel Vetter asked for specific kernel versions in b603e810f740
> ("drm/uapi: document kernel capabilities"). It allows user-space to
> figure out how widespread a cap is.
Well, OK then... :)
--
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 --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-07-13 7:45 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2023-07-13 7:17 ` Simon Ser
2023-07-13 7:45 ` Thomas Zimmermann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox