All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: document DRM_IOCTL_MODE_GETFB2
@ 2021-11-09  8:56 Simon Ser
  2021-11-09  9:24 ` Daniel Vetter
  2021-11-11 11:50 ` Daniel Stone
  0 siblings, 2 replies; 9+ messages in thread
From: Simon Ser @ 2021-11-09  8:56 UTC (permalink / raw)
  To: dri-devel

There are a few details specific to the GETFB2 IOCTL.

It's not immediately clear how user-space should check for the
number of planes. Suggest using the pitches field.

The modifier array is filled with zeroes, ie. DRM_FORMAT_MOD_LINEAR.
So explicitly tell user-space to not look at it unless the flag is
set.

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 | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
index 3b810b53ba8b..9809078b0f51 100644
--- a/include/uapi/drm/drm.h
+++ b/include/uapi/drm/drm.h
@@ -1096,6 +1096,22 @@ extern "C" {
 #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)
 
+/**
+ * DRM_IOCTL_MODE_GETFB2 - Get framebuffer metadata.
+ *
+ * This queries metadata about a framebuffer. User-space fills
+ * &drm_mode_fb_cmd2.fb_id as the input, and the kernels fills the rest of the
+ * struct as the output.
+ *
+ * If the client is not DRM master and doesn't have &CAP_SYS_ADMIN,
+ * &drm_mode_fb_cmd2.handles will be zeroed. Planes are valid until one has a
+ * zero &drm_mode_fb_cmd2.pitches -- this can be used to compute the number of
+ * planes.
+ *
+ * If the framebuffer has a format modifier, &DRM_MODE_FB_MODIFIERS will be set
+ * in &drm_mode_fb_cmd2.flags. Otherwise, &drm_mode_fb_cmd2.modifier has
+ * undefined contents.
+ */
 #define DRM_IOCTL_MODE_GETFB2		DRM_IOWR(0xCE, struct drm_mode_fb_cmd2)
 
 /*
-- 
2.33.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-11-15 14:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-09  8:56 [PATCH] drm: document DRM_IOCTL_MODE_GETFB2 Simon Ser
2021-11-09  9:24 ` Daniel Vetter
2021-11-09  9:29   ` Simon Ser
2021-11-09  9:55     ` Daniel Vetter
2021-11-11  9:46   ` Pekka Paalanen
2021-11-11 11:50 ` Daniel Stone
2021-11-15 12:09   ` Simon Ser
2021-11-15 14:20     ` Daniel Vetter
2021-11-15 14:31       ` Simon Ser

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.