* [PATCH v2 0/9] drm/doc: misc documentation improvements
@ 2020-12-17 11:32 Simon Ser
2020-12-17 11:32 ` [PATCH v2 1/9] drm/doc: the KMS properties section is for user-space devs Simon Ser
` (8 more replies)
0 siblings, 9 replies; 18+ messages in thread
From: Simon Ser @ 2020-12-17 11:32 UTC (permalink / raw)
To: dri-devel
This is v2 for the series "drm/doc: improve plane property docs" [1].
The first 4 commits of v1 aren't re-sent. The last 4 commits of v2 are
new.
[1]: https://patchwork.freedesktop.org/series/85016/
Simon Ser (9):
drm/doc: the KMS properties section is for user-space devs
drm/doc: introduce new section for standard plane properties
drm/doc: fix reference to drm_format_modifier_blob
drm/doc: fix drm_plane_type docs
drm/doc: document the type plane property
drm/doc: atomic implicitly enables other caps
drm/doc: remove drm.h file comment
drm/doc: demote old doc-comments in drm.h
drm/doc: render drm.h uapi docs
Documentation/gpu/drm-kms.rst | 9 ++++
Documentation/gpu/drm-uapi.rst | 3 ++
drivers/gpu/drm/drm_blend.c | 6 ---
drivers/gpu/drm/drm_plane.c | 64 ++++++++++++++++++++--
include/drm/drm_plane.h | 29 +++++++---
include/uapi/drm/drm.h | 98 ++++++++++++++++------------------
6 files changed, 138 insertions(+), 71 deletions(-)
--
2.29.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH v2 1/9] drm/doc: the KMS properties section is for user-space devs
2020-12-17 11:32 [PATCH v2 0/9] drm/doc: misc documentation improvements Simon Ser
@ 2020-12-17 11:32 ` Simon Ser
2020-12-17 12:03 ` Daniel Vetter
2020-12-17 11:32 ` [PATCH v2 2/9] drm/doc: introduce new section for standard plane properties Simon Ser
` (7 subsequent siblings)
8 siblings, 1 reply; 18+ messages in thread
From: Simon Ser @ 2020-12-17 11:32 UTC (permalink / raw)
To: dri-devel
State that the "KMS Properties" section is mainly for user-space
developers.
Signed-off-by: Simon Ser <contact@emersion.fr>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Pekka Paalanen <ppaalanen@gmail.com>
---
Documentation/gpu/drm-kms.rst | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Documentation/gpu/drm-kms.rst b/Documentation/gpu/drm-kms.rst
index 2f3efb63e5ba..7a05601f1067 100644
--- a/Documentation/gpu/drm-kms.rst
+++ b/Documentation/gpu/drm-kms.rst
@@ -460,6 +460,9 @@ KMS Locking
KMS Properties
==============
+This section of the documentation is primarily aimed at user-space developers.
+For the driver APIs, see the other sections.
+
Property Types and Blob Property Support
----------------------------------------
--
2.29.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v2 2/9] drm/doc: introduce new section for standard plane properties
2020-12-17 11:32 [PATCH v2 0/9] drm/doc: misc documentation improvements Simon Ser
2020-12-17 11:32 ` [PATCH v2 1/9] drm/doc: the KMS properties section is for user-space devs Simon Ser
@ 2020-12-17 11:32 ` Simon Ser
2020-12-17 11:32 ` [PATCH v2 3/9] drm/doc: fix reference to drm_format_modifier_blob Simon Ser
` (6 subsequent siblings)
8 siblings, 0 replies; 18+ messages in thread
From: Simon Ser @ 2020-12-17 11:32 UTC (permalink / raw)
To: dri-devel
Introduce a new "Standard Plane Properties" section for properties
defined in drm_plane.c. Move the mis-placed IN_FORMATS docs there.
Signed-off-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
Cc: Pekka Paalanen <ppaalanen@gmail.com>
---
Documentation/gpu/drm-kms.rst | 6 ++++++
drivers/gpu/drm/drm_blend.c | 6 ------
drivers/gpu/drm/drm_plane.c | 12 ++++++++++++
3 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/Documentation/gpu/drm-kms.rst b/Documentation/gpu/drm-kms.rst
index 7a05601f1067..87e5023e3f55 100644
--- a/Documentation/gpu/drm-kms.rst
+++ b/Documentation/gpu/drm-kms.rst
@@ -493,6 +493,12 @@ Standard CRTC Properties
.. kernel-doc:: drivers/gpu/drm/drm_crtc.c
:doc: standard CRTC properties
+Standard Plane Properties
+-------------------------
+
+.. kernel-doc:: drivers/gpu/drm/drm_plane.c
+ :doc: standard plane properties
+
Plane Composition Properties
----------------------------
diff --git a/drivers/gpu/drm/drm_blend.c b/drivers/gpu/drm/drm_blend.c
index 5c2141e9a9f4..26e2f2ffd255 100644
--- a/drivers/gpu/drm/drm_blend.c
+++ b/drivers/gpu/drm/drm_blend.c
@@ -185,12 +185,6 @@
* plane does not expose the "alpha" property, then this is
* assumed to be 1.0
*
- * IN_FORMATS:
- * Blob property which contains the set of buffer format and modifier
- * pairs supported by this plane. The blob is a drm_format_modifier_blob
- * struct. Without this property the plane doesn't support buffers with
- * modifiers. Userspace cannot change this property.
- *
* Note that all the property extensions described here apply either to the
* plane or the CRTC (e.g. for the background color, which currently is not
* exposed and assumed to be black).
diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c
index 49b0a8b9ac02..4c1a45ac18e6 100644
--- a/drivers/gpu/drm/drm_plane.c
+++ b/drivers/gpu/drm/drm_plane.c
@@ -61,6 +61,18 @@
* userspace too much.
*/
+/**
+ * DOC: standard plane properties
+ *
+ * DRM planes have a few standardized properties:
+ *
+ * IN_FORMATS:
+ * Blob property which contains the set of buffer format and modifier
+ * pairs supported by this plane. The blob is a drm_format_modifier_blob
+ * struct. Without this property the plane doesn't support buffers with
+ * modifiers. Userspace cannot change this property.
+ */
+
static unsigned int drm_num_planes(struct drm_device *dev)
{
unsigned int num = 0;
--
2.29.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v2 3/9] drm/doc: fix reference to drm_format_modifier_blob
2020-12-17 11:32 [PATCH v2 0/9] drm/doc: misc documentation improvements Simon Ser
2020-12-17 11:32 ` [PATCH v2 1/9] drm/doc: the KMS properties section is for user-space devs Simon Ser
2020-12-17 11:32 ` [PATCH v2 2/9] drm/doc: introduce new section for standard plane properties Simon Ser
@ 2020-12-17 11:32 ` Simon Ser
2020-12-17 12:04 ` Daniel Vetter
2020-12-17 11:32 ` [PATCH v2 4/9] drm/doc: fix drm_plane_type docs Simon Ser
` (5 subsequent siblings)
8 siblings, 1 reply; 18+ messages in thread
From: Simon Ser @ 2020-12-17 11:32 UTC (permalink / raw)
To: dri-devel
The documentation build system recognizes "struct XXX" references and
generates links for them.
Signed-off-by: Simon Ser <contact@emersion.fr>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Pekka Paalanen <ppaalanen@gmail.com>
---
drivers/gpu/drm/drm_plane.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c
index 4c1a45ac18e6..4a66374dc355 100644
--- a/drivers/gpu/drm/drm_plane.c
+++ b/drivers/gpu/drm/drm_plane.c
@@ -68,9 +68,9 @@
*
* IN_FORMATS:
* Blob property which contains the set of buffer format and modifier
- * pairs supported by this plane. The blob is a drm_format_modifier_blob
- * struct. Without this property the plane doesn't support buffers with
- * modifiers. Userspace cannot change this property.
+ * pairs supported by this plane. The blob is a struct
+ * drm_format_modifier_blob. Without this property the plane doesn't
+ * support buffers with modifiers. Userspace cannot change this property.
*/
static unsigned int drm_num_planes(struct drm_device *dev)
--
2.29.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v2 4/9] drm/doc: fix drm_plane_type docs
2020-12-17 11:32 [PATCH v2 0/9] drm/doc: misc documentation improvements Simon Ser
` (2 preceding siblings ...)
2020-12-17 11:32 ` [PATCH v2 3/9] drm/doc: fix reference to drm_format_modifier_blob Simon Ser
@ 2020-12-17 11:32 ` Simon Ser
2020-12-17 12:05 ` Daniel Vetter
2020-12-17 11:32 ` [PATCH v2 5/9] drm/doc: document the type plane property Simon Ser
` (4 subsequent siblings)
8 siblings, 1 reply; 18+ messages in thread
From: Simon Ser @ 2020-12-17 11:32 UTC (permalink / raw)
To: dri-devel
The docs for enum drm_plane_type mention legacy IOCTLs, however the
plane type is not tied to legacy IOCTLs, the drm_cursor.primary and
cursor fields are. Add a small paragraph to reference these.
Instead, document expectations for primary and cursor planes for
non-legacy userspace. Note that these docs are for driver developers,
not userspace developers, so internal kernel APIs are mentionned.
Signed-off-by: Simon Ser <contact@emersion.fr>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Pekka Paalanen <ppaalanen@gmail.com>
---
include/drm/drm_plane.h | 29 +++++++++++++++++++++--------
1 file changed, 21 insertions(+), 8 deletions(-)
diff --git a/include/drm/drm_plane.h b/include/drm/drm_plane.h
index 1d82b264e5e4..5b180d07788e 100644
--- a/include/drm/drm_plane.h
+++ b/include/drm/drm_plane.h
@@ -538,10 +538,14 @@ struct drm_plane_funcs {
*
* For compatibility with legacy userspace, only overlay planes are made
* available to userspace by default. Userspace clients may set the
- * DRM_CLIENT_CAP_UNIVERSAL_PLANES client capability bit to indicate that they
+ * &DRM_CLIENT_CAP_UNIVERSAL_PLANES client capability bit to indicate that they
* wish to receive a universal plane list containing all plane types. See also
* drm_for_each_legacy_plane().
*
+ * In addition to setting each plane's type, drivers need to setup the
+ * &drm_crtc.primary and optionally &drm_crtc.cursor pointers for legacy
+ * IOCTLs. See drm_crtc_init_with_planes().
+ *
* WARNING: The values of this enum is UABI since they're exposed in the "type"
* property.
*/
@@ -557,19 +561,28 @@ enum drm_plane_type {
/**
* @DRM_PLANE_TYPE_PRIMARY:
*
- * Primary planes represent a "main" plane for a CRTC. Primary planes
- * are the planes operated upon by CRTC modesetting and flipping
- * operations described in the &drm_crtc_funcs.page_flip and
- * &drm_crtc_funcs.set_config hooks.
+ * A primary plane attached to a CRTC is the most likely to be able to
+ * light up the CRTC when no scaling/cropping is used and the plane
+ * covers the whole CRTC.
+ *
+ * In addition to setting a plane type to primary, drivers need to
+ * setup the &drm_crtc.primary pointer for legacy IOCTLs. See
+ * drm_crtc_init_with_planes().
*/
DRM_PLANE_TYPE_PRIMARY,
/**
* @DRM_PLANE_TYPE_CURSOR:
*
- * Cursor planes represent a "cursor" plane for a CRTC. Cursor planes
- * are the planes operated upon by the DRM_IOCTL_MODE_CURSOR and
- * DRM_IOCTL_MODE_CURSOR2 IOCTLs.
+ * A cursor plane attached to a CRTC is more likely to be able to be
+ * enabled when no scaling/cropping is used and the framebuffer has the
+ * size indicated by &drm_mode_config.cursor_width and
+ * &drm_mode_config.cursor_height. Additionally, if the driver doesn't
+ * support modifiers, the framebuffer should have a linear layout.
+ *
+ * In addition to setting a plane type to cursor, drivers need to setup
+ * the &drm_crtc.cursor pointer for legacy IOCTLs. See
+ * drm_crtc_init_with_planes().
*/
DRM_PLANE_TYPE_CURSOR,
};
--
2.29.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v2 5/9] drm/doc: document the type plane property
2020-12-17 11:32 [PATCH v2 0/9] drm/doc: misc documentation improvements Simon Ser
` (3 preceding siblings ...)
2020-12-17 11:32 ` [PATCH v2 4/9] drm/doc: fix drm_plane_type docs Simon Ser
@ 2020-12-17 11:32 ` Simon Ser
2020-12-17 12:13 ` Daniel Vetter
2020-12-17 11:32 ` [PATCH v2 6/9] drm/doc: atomic implicitly enables other caps Simon Ser
` (3 subsequent siblings)
8 siblings, 1 reply; 18+ messages in thread
From: Simon Ser @ 2020-12-17 11:32 UTC (permalink / raw)
To: dri-devel
Add a new entry for "type" in the section for standard plane properties.
Signed-off-by: Simon Ser <contact@emersion.fr>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Pekka Paalanen <ppaalanen@gmail.com>
---
drivers/gpu/drm/drm_plane.c | 52 ++++++++++++++++++++++++++++++++++---
1 file changed, 48 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c
index 4a66374dc355..fef63bb7d293 100644
--- a/drivers/gpu/drm/drm_plane.c
+++ b/drivers/gpu/drm/drm_plane.c
@@ -49,10 +49,8 @@
* &struct drm_plane (possibly as part of a larger structure) and registers it
* with a call to drm_universal_plane_init().
*
- * The type of a plane is exposed in the immutable "type" enumeration property,
- * which has one of the following values: "Overlay", "Primary", "Cursor" (see
- * enum drm_plane_type). A plane can be compatible with multiple CRTCs, see
- * &drm_plane.possible_crtcs.
+ * Each plane has a type, see enum drm_plane_type. A plane can be compatible
+ * with multiple CRTCs, see &drm_plane.possible_crtcs.
*
* Legacy uAPI doesn't expose the primary and cursor planes directly. DRM core
* relies on the driver to set the primary and optionally the cursor plane used
@@ -66,6 +64,52 @@
*
* DRM planes have a few standardized properties:
*
+ * type:
+ * Immutable property describing the type of the plane.
+ *
+ * For user-space which has enabled the &DRM_CLIENT_CAP_UNIVERSAL_PLANES
+ * capability, the plane type is just a hint and is mostly superseded by
+ * atomic test-only commits. The type hint can still be used to come up
+ * more easily with a plane configuration accepted by the driver. Note that
+ * &DRM_CLIENT_CAP_UNIVERSAL_PLANES is implicitly enabled by
+ * &DRM_CLIENT_CAP_ATOMIC.
+ *
+ * The value of this property can be one of the following:
+ *
+ * "Primary":
+ * To light up a CRTC, attaching a primary plane is the most likely to
+ * work if it covers the whole CRTC and doesn't have scaling or
+ * cropping set up.
+ *
+ * Drivers may support more features for the primary plane, user-space
+ * can find out with test-only atomic commits.
+ *
+ * User-space must not mix the legacy IOCTLs &DRM_IOCTL_MODE_SETCRTC or
+ * &DRM_IOCTL_MODE_PAGE_FLIP with atomic commits involving a primary
+ * plane.
+ * "Cursor":
+ * To enable this plane, using a framebuffer configured without scaling
+ * or cropping and with the following properties is the most likely to
+ * work:
+ *
+ * - If the driver provides the capabilities &DRM_CAP_CURSOR_WIDTH and
+ * &DRM_CAP_CURSOR_HEIGHT, create the framebuffer with this size.
+ * Otherwise, create a framebuffer with the size 64x64.
+ * - If the driver doesn't support modifiers, create a framebuffer with
+ * a linear layout. Otherwise, use the IN_FORMATS plane property.
+ *
+ * Drivers may support more features for the cursor plane, user-space
+ * can find out with test-only atomic commits.
+ *
+ * User-space must not mix the legacy IOCTLs &DRM_IOCTL_MODE_CURSOR or
+ * &DRM_IOCTL_MODE_CURSOR2 with atomic commits involving a cursor
+ * plane.
+ * "Overlay":
+ * Neither primary nor cursor.
+ *
+ * Overlay planes are the only planes exposed when the
+ * &DRM_CLIENT_CAP_UNIVERSAL_PLANES capability is disabled.
+ *
* IN_FORMATS:
* Blob property which contains the set of buffer format and modifier
* pairs supported by this plane. The blob is a struct
--
2.29.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v2 6/9] drm/doc: atomic implicitly enables other caps
2020-12-17 11:32 [PATCH v2 0/9] drm/doc: misc documentation improvements Simon Ser
` (4 preceding siblings ...)
2020-12-17 11:32 ` [PATCH v2 5/9] drm/doc: document the type plane property Simon Ser
@ 2020-12-17 11:32 ` Simon Ser
2020-12-17 12:05 ` Daniel Vetter
2020-12-17 11:32 ` [PATCH v2 7/9] drm/doc: remove drm.h file comment Simon Ser
` (2 subsequent siblings)
8 siblings, 1 reply; 18+ messages in thread
From: Simon Ser @ 2020-12-17 11:32 UTC (permalink / raw)
To: dri-devel
Document that enabling atomic also enables universal planes and aspect
ratio modes.
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 | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
index 808b48a93330..5c31aea1f342 100644
--- a/include/uapi/drm/drm.h
+++ b/include/uapi/drm/drm.h
@@ -678,7 +678,9 @@ struct drm_get_cap {
/**
* DRM_CLIENT_CAP_ATOMIC
*
- * If set to 1, the DRM core will expose atomic properties to userspace
+ * If set to 1, the DRM core will expose atomic properties to userspace. This
+ * implicitly enables &DRM_CLIENT_CAP_UNIVERSAL_PLANES and
+ * &DRM_CLIENT_CAP_ASPECT_RATIO.
*/
#define DRM_CLIENT_CAP_ATOMIC 3
--
2.29.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v2 7/9] drm/doc: remove drm.h file comment
2020-12-17 11:32 [PATCH v2 0/9] drm/doc: misc documentation improvements Simon Ser
` (5 preceding siblings ...)
2020-12-17 11:32 ` [PATCH v2 6/9] drm/doc: atomic implicitly enables other caps Simon Ser
@ 2020-12-17 11:32 ` Simon Ser
2020-12-17 12:07 ` Daniel Vetter
2020-12-17 11:32 ` [PATCH v2 8/9] drm/doc: demote old doc-comments in drm.h Simon Ser
2020-12-17 11:32 ` [PATCH v2 9/9] drm/doc: render drm.h uapi docs Simon Ser
8 siblings, 1 reply; 18+ messages in thread
From: Simon Ser @ 2020-12-17 11:32 UTC (permalink / raw)
To: dri-devel
Our documentation build system chokes on \file comments. This comment
seems mostly historical and doesn't provide any useful information.
./include/uapi/drm/drm.h:2: warning: Cannot understand * \file drm.h
on line 2 - I thought it was a doc line
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 | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
index 5c31aea1f342..783f666152a1 100644
--- a/include/uapi/drm/drm.h
+++ b/include/uapi/drm/drm.h
@@ -1,13 +1,3 @@
-/**
- * \file drm.h
- * Header for the Direct Rendering Manager
- *
- * \author Rickard E. (Rik) Faith <faith@valinux.com>
- *
- * \par Acknowledgments:
- * Dec 1999, Richard Henderson <rth@twiddle.net>, move to generic \c cmpxchg.
- */
-
/*
* Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
* Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
--
2.29.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v2 8/9] drm/doc: demote old doc-comments in drm.h
2020-12-17 11:32 [PATCH v2 0/9] drm/doc: misc documentation improvements Simon Ser
` (6 preceding siblings ...)
2020-12-17 11:32 ` [PATCH v2 7/9] drm/doc: remove drm.h file comment Simon Ser
@ 2020-12-17 11:32 ` Simon Ser
2020-12-17 12:13 ` Daniel Vetter
2020-12-17 11:32 ` [PATCH v2 9/9] drm/doc: render drm.h uapi docs Simon Ser
8 siblings, 1 reply; 18+ messages in thread
From: Simon Ser @ 2020-12-17 11:32 UTC (permalink / raw)
To: dri-devel
Sphinx doesn't like old doc-comments in drm.h and generates warnings
like:
./include/uapi/drm/drm.h:87: warning: cannot understand function prototype: 'struct drm_clip_rect '
./include/uapi/drm/drm.h:97: warning: cannot understand function prototype: 'struct drm_drawable_info '
./include/uapi/drm/drm.h:105: warning: cannot understand function prototype: 'struct drm_tex_region '
...
Demote these to regular comments, because converting all of them is
quite a lot of work (also requires documenting all of the struct fields
for instance). Also many of these structures aren't really used by
modern user-space.
We can easily convert these remaining old comments to Sphinx style on a
one-by-one basis.
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 | 84 +++++++++++++++++++++---------------------
1 file changed, 42 insertions(+), 42 deletions(-)
diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
index 783f666152a1..512ca80e8d4a 100644
--- a/include/uapi/drm/drm.h
+++ b/include/uapi/drm/drm.h
@@ -75,7 +75,7 @@ typedef unsigned int drm_context_t;
typedef unsigned int drm_drawable_t;
typedef unsigned int drm_magic_t;
-/**
+/*
* Cliprect.
*
* \warning: If you change this structure, make sure you change
@@ -91,7 +91,7 @@ struct drm_clip_rect {
unsigned short y2;
};
-/**
+/*
* Drawable information.
*/
struct drm_drawable_info {
@@ -99,7 +99,7 @@ struct drm_drawable_info {
struct drm_clip_rect *rects;
};
-/**
+/*
* Texture region,
*/
struct drm_tex_region {
@@ -110,7 +110,7 @@ struct drm_tex_region {
unsigned int age;
};
-/**
+/*
* Hardware lock.
*
* The lock structure is a simple cache-line aligned integer. To avoid
@@ -122,7 +122,7 @@ struct drm_hw_lock {
char padding[60]; /**< Pad to cache line */
};
-/**
+/*
* DRM_IOCTL_VERSION ioctl argument type.
*
* \sa drmGetVersion().
@@ -139,7 +139,7 @@ struct drm_version {
char __user *desc; /**< User-space buffer to hold desc */
};
-/**
+/*
* DRM_IOCTL_GET_UNIQUE ioctl argument type.
*
* \sa drmGetBusid() and drmSetBusId().
@@ -158,7 +158,7 @@ struct drm_block {
int unused;
};
-/**
+/*
* DRM_IOCTL_CONTROL ioctl argument type.
*
* \sa drmCtlInstHandler() and drmCtlUninstHandler().
@@ -173,7 +173,7 @@ struct drm_control {
int irq;
};
-/**
+/*
* Type of memory to map.
*/
enum drm_map_type {
@@ -185,7 +185,7 @@ enum drm_map_type {
_DRM_CONSISTENT = 5 /**< Consistent memory for PCI DMA */
};
-/**
+/*
* Memory mapping flags.
*/
enum drm_map_flags {
@@ -204,7 +204,7 @@ struct drm_ctx_priv_map {
void *handle; /**< Handle of map */
};
-/**
+/*
* DRM_IOCTL_GET_MAP, DRM_IOCTL_ADD_MAP and DRM_IOCTL_RM_MAP ioctls
* argument type.
*
@@ -221,7 +221,7 @@ struct drm_map {
/* Private data */
};
-/**
+/*
* DRM_IOCTL_GET_CLIENT ioctl argument type.
*/
struct drm_client {
@@ -253,7 +253,7 @@ enum drm_stat_type {
/* Add to the *END* of the list */
};
-/**
+/*
* DRM_IOCTL_GET_STATS ioctl argument type.
*/
struct drm_stats {
@@ -264,7 +264,7 @@ struct drm_stats {
} data[15];
};
-/**
+/*
* Hardware locking flags.
*/
enum drm_lock_flags {
@@ -279,7 +279,7 @@ enum drm_lock_flags {
_DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */
};
-/**
+/*
* DRM_IOCTL_LOCK, DRM_IOCTL_UNLOCK and DRM_IOCTL_FINISH ioctl argument type.
*
* \sa drmGetLock() and drmUnlock().
@@ -289,7 +289,7 @@ struct drm_lock {
enum drm_lock_flags flags;
};
-/**
+/*
* DMA flags
*
* \warning
@@ -318,7 +318,7 @@ enum drm_dma_flags {
_DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */
};
-/**
+/*
* DRM_IOCTL_ADD_BUFS and DRM_IOCTL_MARK_BUFS ioctl argument type.
*
* \sa drmAddBufs().
@@ -341,7 +341,7 @@ struct drm_buf_desc {
*/
};
-/**
+/*
* DRM_IOCTL_INFO_BUFS ioctl argument type.
*/
struct drm_buf_info {
@@ -349,7 +349,7 @@ struct drm_buf_info {
struct drm_buf_desc __user *list;
};
-/**
+/*
* DRM_IOCTL_FREE_BUFS ioctl argument type.
*/
struct drm_buf_free {
@@ -357,7 +357,7 @@ struct drm_buf_free {
int __user *list;
};
-/**
+/*
* Buffer information
*
* \sa drm_buf_map.
@@ -369,7 +369,7 @@ struct drm_buf_pub {
void __user *address; /**< Address of buffer */
};
-/**
+/*
* DRM_IOCTL_MAP_BUFS ioctl argument type.
*/
struct drm_buf_map {
@@ -382,7 +382,7 @@ struct drm_buf_map {
struct drm_buf_pub __user *list; /**< Buffer information */
};
-/**
+/*
* DRM_IOCTL_DMA ioctl argument type.
*
* Indices here refer to the offset into the buffer list in drm_buf_get.
@@ -407,7 +407,7 @@ enum drm_ctx_flags {
_DRM_CONTEXT_2DONLY = 0x02
};
-/**
+/*
* DRM_IOCTL_ADD_CTX ioctl argument type.
*
* \sa drmCreateContext() and drmDestroyContext().
@@ -417,7 +417,7 @@ struct drm_ctx {
enum drm_ctx_flags flags;
};
-/**
+/*
* DRM_IOCTL_RES_CTX ioctl argument type.
*/
struct drm_ctx_res {
@@ -425,14 +425,14 @@ struct drm_ctx_res {
struct drm_ctx __user *contexts;
};
-/**
+/*
* DRM_IOCTL_ADD_DRAW and DRM_IOCTL_RM_DRAW ioctl argument type.
*/
struct drm_draw {
drm_drawable_t handle;
};
-/**
+/*
* DRM_IOCTL_UPDATE_DRAW ioctl argument type.
*/
typedef enum {
@@ -446,14 +446,14 @@ struct drm_update_draw {
unsigned long long data;
};
-/**
+/*
* DRM_IOCTL_GET_MAGIC and DRM_IOCTL_AUTH_MAGIC ioctl argument type.
*/
struct drm_auth {
drm_magic_t magic;
};
-/**
+/*
* DRM_IOCTL_IRQ_BUSID ioctl argument type.
*
* \sa drmGetInterruptFromBusID().
@@ -495,7 +495,7 @@ struct drm_wait_vblank_reply {
long tval_usec;
};
-/**
+/*
* DRM_IOCTL_WAIT_VBLANK ioctl argument type.
*
* \sa drmWaitVBlank().
@@ -508,7 +508,7 @@ union drm_wait_vblank {
#define _DRM_PRE_MODESET 1
#define _DRM_POST_MODESET 2
-/**
+/*
* DRM_IOCTL_MODESET_CTL ioctl argument type
*
* \sa drmModesetCtl().
@@ -518,7 +518,7 @@ struct drm_modeset_ctl {
__u32 cmd;
};
-/**
+/*
* DRM_IOCTL_AGP_ENABLE ioctl argument type.
*
* \sa drmAgpEnable().
@@ -527,7 +527,7 @@ struct drm_agp_mode {
unsigned long mode; /**< AGP mode */
};
-/**
+/*
* DRM_IOCTL_AGP_ALLOC and DRM_IOCTL_AGP_FREE ioctls argument type.
*
* \sa drmAgpAlloc() and drmAgpFree().
@@ -539,7 +539,7 @@ struct drm_agp_buffer {
unsigned long physical; /**< Physical used by i810 */
};
-/**
+/*
* DRM_IOCTL_AGP_BIND and DRM_IOCTL_AGP_UNBIND ioctls argument type.
*
* \sa drmAgpBind() and drmAgpUnbind().
@@ -549,7 +549,7 @@ struct drm_agp_binding {
unsigned long offset; /**< In bytes -- will round to page boundary */
};
-/**
+/*
* DRM_IOCTL_AGP_INFO ioctl argument type.
*
* \sa drmAgpVersionMajor(), drmAgpVersionMinor(), drmAgpGetMode(),
@@ -570,7 +570,7 @@ struct drm_agp_info {
unsigned short id_device;
};
-/**
+/*
* DRM_IOCTL_SG_ALLOC ioctl argument type.
*/
struct drm_scatter_gather {
@@ -578,7 +578,7 @@ struct drm_scatter_gather {
unsigned long handle; /**< Used for mapping / unmapping */
};
-/**
+/*
* DRM_IOCTL_SET_VERSION ioctl argument type.
*/
struct drm_set_version {
@@ -588,14 +588,14 @@ struct drm_set_version {
int drm_dd_minor;
};
-/** DRM_IOCTL_GEM_CLOSE ioctl argument type */
+/* DRM_IOCTL_GEM_CLOSE ioctl argument type */
struct drm_gem_close {
/** Handle of the object to be closed. */
__u32 handle;
__u32 pad;
};
-/** DRM_IOCTL_GEM_FLINK ioctl argument type */
+/* DRM_IOCTL_GEM_FLINK ioctl argument type */
struct drm_gem_flink {
/** Handle for the object being named */
__u32 handle;
@@ -604,7 +604,7 @@ struct drm_gem_flink {
__u32 name;
};
-/** DRM_IOCTL_GEM_OPEN ioctl argument type */
+/* DRM_IOCTL_GEM_OPEN ioctl argument type */
struct drm_gem_open {
/** Name of object being opened */
__u32 name;
@@ -642,7 +642,7 @@ struct drm_gem_open {
#define DRM_CAP_SYNCOBJ 0x13
#define DRM_CAP_SYNCOBJ_TIMELINE 0x14
-/** DRM_IOCTL_GET_CAP ioctl argument type */
+/* DRM_IOCTL_GET_CAP ioctl argument type */
struct drm_get_cap {
__u64 capability;
__u64 value;
@@ -690,7 +690,7 @@ struct drm_get_cap {
*/
#define DRM_CLIENT_CAP_WRITEBACK_CONNECTORS 5
-/** DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */
+/* DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */
struct drm_set_client_cap {
__u64 capability;
__u64 value;
@@ -942,7 +942,7 @@ extern "C" {
#define DRM_IOCTL_MODE_GETFB2 DRM_IOWR(0xCE, struct drm_mode_fb_cmd2)
-/**
+/*
* Device specific ioctls should only be in their respective headers
* The device specific ioctl range is from 0x40 to 0x9f.
* Generic IOCTLS restart at 0xA0.
@@ -953,7 +953,7 @@ extern "C" {
#define DRM_COMMAND_BASE 0x40
#define DRM_COMMAND_END 0xA0
-/**
+/*
* Header for events written back to userspace on the drm fd. The
* type defines the type of event, the length specifies the total
* length of the event (including the header), and user_data is
--
2.29.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v2 9/9] drm/doc: render drm.h uapi docs
2020-12-17 11:32 [PATCH v2 0/9] drm/doc: misc documentation improvements Simon Ser
` (7 preceding siblings ...)
2020-12-17 11:32 ` [PATCH v2 8/9] drm/doc: demote old doc-comments in drm.h Simon Ser
@ 2020-12-17 11:32 ` Simon Ser
2020-12-17 12:14 ` Daniel Vetter
8 siblings, 1 reply; 18+ messages in thread
From: Simon Ser @ 2020-12-17 11:32 UTC (permalink / raw)
To: dri-devel
It doesn't seem like drm.h docs are included anywhere. Render them next
to drm_mode.h, under the "Userspace API Structures" section.
This also allows references to e.g. DRM_CAP_* to be properly linkified
elsewhere in our docs.
Signed-off-by: Simon Ser <contact@emersion.fr>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Pekka Paalanen <ppaalanen@gmail.com>
---
Documentation/gpu/drm-uapi.rst | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Documentation/gpu/drm-uapi.rst b/Documentation/gpu/drm-uapi.rst
index 7dce175f6d75..04bdc7a91d53 100644
--- a/Documentation/gpu/drm-uapi.rst
+++ b/Documentation/gpu/drm-uapi.rst
@@ -457,5 +457,8 @@ Userspace API Structures
.. kernel-doc:: include/uapi/drm/drm_mode.h
:doc: overview
+.. kernel-doc:: include/uapi/drm/drm.h
+ :internal:
+
.. kernel-doc:: include/uapi/drm/drm_mode.h
:internal:
--
2.29.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH v2 1/9] drm/doc: the KMS properties section is for user-space devs
2020-12-17 11:32 ` [PATCH v2 1/9] drm/doc: the KMS properties section is for user-space devs Simon Ser
@ 2020-12-17 12:03 ` Daniel Vetter
0 siblings, 0 replies; 18+ messages in thread
From: Daniel Vetter @ 2020-12-17 12:03 UTC (permalink / raw)
To: Simon Ser; +Cc: dri-devel
On Thu, Dec 17, 2020 at 12:32:12PM +0100, Simon Ser wrote:
> State that the "KMS Properties" section is mainly for user-space
> developers.
>
> Signed-off-by: Simon Ser <contact@emersion.fr>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Pekka Paalanen <ppaalanen@gmail.com>
> ---
> Documentation/gpu/drm-kms.rst | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/Documentation/gpu/drm-kms.rst b/Documentation/gpu/drm-kms.rst
> index 2f3efb63e5ba..7a05601f1067 100644
> --- a/Documentation/gpu/drm-kms.rst
> +++ b/Documentation/gpu/drm-kms.rst
> @@ -460,6 +460,9 @@ KMS Locking
> KMS Properties
> ==============
>
> +This section of the documentation is primarily aimed at user-space developers.
> +For the driver APIs, see the other sections.
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> +
> Property Types and Blob Property Support
> ----------------------------------------
>
> --
> 2.29.2
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v2 3/9] drm/doc: fix reference to drm_format_modifier_blob
2020-12-17 11:32 ` [PATCH v2 3/9] drm/doc: fix reference to drm_format_modifier_blob Simon Ser
@ 2020-12-17 12:04 ` Daniel Vetter
0 siblings, 0 replies; 18+ messages in thread
From: Daniel Vetter @ 2020-12-17 12:04 UTC (permalink / raw)
To: Simon Ser; +Cc: dri-devel
On Thu, Dec 17, 2020 at 12:32:14PM +0100, Simon Ser wrote:
> The documentation build system recognizes "struct XXX" references and
> generates links for them.
>
> Signed-off-by: Simon Ser <contact@emersion.fr>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Pekka Paalanen <ppaalanen@gmail.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
> drivers/gpu/drm/drm_plane.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c
> index 4c1a45ac18e6..4a66374dc355 100644
> --- a/drivers/gpu/drm/drm_plane.c
> +++ b/drivers/gpu/drm/drm_plane.c
> @@ -68,9 +68,9 @@
> *
> * IN_FORMATS:
> * Blob property which contains the set of buffer format and modifier
> - * pairs supported by this plane. The blob is a drm_format_modifier_blob
> - * struct. Without this property the plane doesn't support buffers with
> - * modifiers. Userspace cannot change this property.
> + * pairs supported by this plane. The blob is a struct
> + * drm_format_modifier_blob. Without this property the plane doesn't
> + * support buffers with modifiers. Userspace cannot change this property.
> */
>
> static unsigned int drm_num_planes(struct drm_device *dev)
> --
> 2.29.2
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v2 4/9] drm/doc: fix drm_plane_type docs
2020-12-17 11:32 ` [PATCH v2 4/9] drm/doc: fix drm_plane_type docs Simon Ser
@ 2020-12-17 12:05 ` Daniel Vetter
0 siblings, 0 replies; 18+ messages in thread
From: Daniel Vetter @ 2020-12-17 12:05 UTC (permalink / raw)
To: Simon Ser; +Cc: dri-devel
On Thu, Dec 17, 2020 at 12:32:15PM +0100, Simon Ser wrote:
> The docs for enum drm_plane_type mention legacy IOCTLs, however the
> plane type is not tied to legacy IOCTLs, the drm_cursor.primary and
> cursor fields are. Add a small paragraph to reference these.
>
> Instead, document expectations for primary and cursor planes for
> non-legacy userspace. Note that these docs are for driver developers,
> not userspace developers, so internal kernel APIs are mentionned.
>
> Signed-off-by: Simon Ser <contact@emersion.fr>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Pekka Paalanen <ppaalanen@gmail.com>
> ---
> include/drm/drm_plane.h | 29 +++++++++++++++++++++--------
> 1 file changed, 21 insertions(+), 8 deletions(-)
>
> diff --git a/include/drm/drm_plane.h b/include/drm/drm_plane.h
> index 1d82b264e5e4..5b180d07788e 100644
> --- a/include/drm/drm_plane.h
> +++ b/include/drm/drm_plane.h
> @@ -538,10 +538,14 @@ struct drm_plane_funcs {
> *
> * For compatibility with legacy userspace, only overlay planes are made
> * available to userspace by default. Userspace clients may set the
> - * DRM_CLIENT_CAP_UNIVERSAL_PLANES client capability bit to indicate that they
> + * &DRM_CLIENT_CAP_UNIVERSAL_PLANES client capability bit to indicate that they
> * wish to receive a universal plane list containing all plane types. See also
> * drm_for_each_legacy_plane().
> *
> + * In addition to setting each plane's type, drivers need to setup the
> + * &drm_crtc.primary and optionally &drm_crtc.cursor pointers for legacy
> + * IOCTLs. See drm_crtc_init_with_planes().
> + *
> * WARNING: The values of this enum is UABI since they're exposed in the "type"
> * property.
> */
> @@ -557,19 +561,28 @@ enum drm_plane_type {
> /**
> * @DRM_PLANE_TYPE_PRIMARY:
> *
> - * Primary planes represent a "main" plane for a CRTC. Primary planes
> - * are the planes operated upon by CRTC modesetting and flipping
> - * operations described in the &drm_crtc_funcs.page_flip and
> - * &drm_crtc_funcs.set_config hooks.
> + * A primary plane attached to a CRTC is the most likely to be able to
> + * light up the CRTC when no scaling/cropping is used and the plane
> + * covers the whole CRTC.
> + *
> + * In addition to setting a plane type to primary, drivers need to
> + * setup the &drm_crtc.primary pointer for legacy IOCTLs. See
> + * drm_crtc_init_with_planes().
After you brought it up I'm actually fine with not duplicating this.
Either way:
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> */
> DRM_PLANE_TYPE_PRIMARY,
>
> /**
> * @DRM_PLANE_TYPE_CURSOR:
> *
> - * Cursor planes represent a "cursor" plane for a CRTC. Cursor planes
> - * are the planes operated upon by the DRM_IOCTL_MODE_CURSOR and
> - * DRM_IOCTL_MODE_CURSOR2 IOCTLs.
> + * A cursor plane attached to a CRTC is more likely to be able to be
> + * enabled when no scaling/cropping is used and the framebuffer has the
> + * size indicated by &drm_mode_config.cursor_width and
> + * &drm_mode_config.cursor_height. Additionally, if the driver doesn't
> + * support modifiers, the framebuffer should have a linear layout.
> + *
> + * In addition to setting a plane type to cursor, drivers need to setup
> + * the &drm_crtc.cursor pointer for legacy IOCTLs. See
> + * drm_crtc_init_with_planes().
> */
> DRM_PLANE_TYPE_CURSOR,
> };
> --
> 2.29.2
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v2 6/9] drm/doc: atomic implicitly enables other caps
2020-12-17 11:32 ` [PATCH v2 6/9] drm/doc: atomic implicitly enables other caps Simon Ser
@ 2020-12-17 12:05 ` Daniel Vetter
0 siblings, 0 replies; 18+ messages in thread
From: Daniel Vetter @ 2020-12-17 12:05 UTC (permalink / raw)
To: Simon Ser; +Cc: dri-devel
On Thu, Dec 17, 2020 at 12:32:17PM +0100, Simon Ser wrote:
> Document that enabling atomic also enables universal planes and aspect
> ratio modes.
>
> Signed-off-by: Simon Ser <contact@emersion.fr>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Pekka Paalanen <ppaalanen@gmail.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
> include/uapi/drm/drm.h | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
> index 808b48a93330..5c31aea1f342 100644
> --- a/include/uapi/drm/drm.h
> +++ b/include/uapi/drm/drm.h
> @@ -678,7 +678,9 @@ struct drm_get_cap {
> /**
> * DRM_CLIENT_CAP_ATOMIC
> *
> - * If set to 1, the DRM core will expose atomic properties to userspace
> + * If set to 1, the DRM core will expose atomic properties to userspace. This
> + * implicitly enables &DRM_CLIENT_CAP_UNIVERSAL_PLANES and
> + * &DRM_CLIENT_CAP_ASPECT_RATIO.
> */
> #define DRM_CLIENT_CAP_ATOMIC 3
>
> --
> 2.29.2
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v2 7/9] drm/doc: remove drm.h file comment
2020-12-17 11:32 ` [PATCH v2 7/9] drm/doc: remove drm.h file comment Simon Ser
@ 2020-12-17 12:07 ` Daniel Vetter
0 siblings, 0 replies; 18+ messages in thread
From: Daniel Vetter @ 2020-12-17 12:07 UTC (permalink / raw)
To: Simon Ser; +Cc: dri-devel
On Thu, Dec 17, 2020 at 12:32:18PM +0100, Simon Ser wrote:
> Our documentation build system chokes on \file comments. This comment
> seems mostly historical and doesn't provide any useful information.
>
> ./include/uapi/drm/drm.h:2: warning: Cannot understand * \file drm.h
> on line 2 - I thought it was a doc line
>
> Signed-off-by: Simon Ser <contact@emersion.fr>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Pekka Paalanen <ppaalanen@gmail.com>
I think just removing the formatting and leaving the historical author
info here (this long predates git) is better. For that version:
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
> include/uapi/drm/drm.h | 10 ----------
> 1 file changed, 10 deletions(-)
>
> diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
> index 5c31aea1f342..783f666152a1 100644
> --- a/include/uapi/drm/drm.h
> +++ b/include/uapi/drm/drm.h
> @@ -1,13 +1,3 @@
> -/**
> - * \file drm.h
> - * Header for the Direct Rendering Manager
> - *
> - * \author Rickard E. (Rik) Faith <faith@valinux.com>
> - *
> - * \par Acknowledgments:
> - * Dec 1999, Richard Henderson <rth@twiddle.net>, move to generic \c cmpxchg.
> - */
> -
> /*
> * Copyright 1999 Precision Insight, Inc., Cedar Park, Texas.
> * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
> --
> 2.29.2
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v2 5/9] drm/doc: document the type plane property
2020-12-17 11:32 ` [PATCH v2 5/9] drm/doc: document the type plane property Simon Ser
@ 2020-12-17 12:13 ` Daniel Vetter
0 siblings, 0 replies; 18+ messages in thread
From: Daniel Vetter @ 2020-12-17 12:13 UTC (permalink / raw)
To: Simon Ser; +Cc: dri-devel
On Thu, Dec 17, 2020 at 12:32:16PM +0100, Simon Ser wrote:
> Add a new entry for "type" in the section for standard plane properties.
>
> Signed-off-by: Simon Ser <contact@emersion.fr>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Pekka Paalanen <ppaalanen@gmail.com>
> ---
> drivers/gpu/drm/drm_plane.c | 52 ++++++++++++++++++++++++++++++++++---
> 1 file changed, 48 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c
> index 4a66374dc355..fef63bb7d293 100644
> --- a/drivers/gpu/drm/drm_plane.c
> +++ b/drivers/gpu/drm/drm_plane.c
> @@ -49,10 +49,8 @@
> * &struct drm_plane (possibly as part of a larger structure) and registers it
> * with a call to drm_universal_plane_init().
> *
> - * The type of a plane is exposed in the immutable "type" enumeration property,
> - * which has one of the following values: "Overlay", "Primary", "Cursor" (see
> - * enum drm_plane_type). A plane can be compatible with multiple CRTCs, see
> - * &drm_plane.possible_crtcs.
> + * Each plane has a type, see enum drm_plane_type. A plane can be compatible
> + * with multiple CRTCs, see &drm_plane.possible_crtcs.
> *
> * Legacy uAPI doesn't expose the primary and cursor planes directly. DRM core
> * relies on the driver to set the primary and optionally the cursor plane used
> @@ -66,6 +64,52 @@
> *
> * DRM planes have a few standardized properties:
> *
> + * type:
> + * Immutable property describing the type of the plane.
> + *
> + * For user-space which has enabled the &DRM_CLIENT_CAP_UNIVERSAL_PLANES
> + * capability, the plane type is just a hint and is mostly superseded by
> + * atomic test-only commits. The type hint can still be used to come up
> + * more easily with a plane configuration accepted by the driver. Note that
> + * &DRM_CLIENT_CAP_UNIVERSAL_PLANES is implicitly enabled by
> + * &DRM_CLIENT_CAP_ATOMIC.
> + *
> + * The value of this property can be one of the following:
> + *
> + * "Primary":
> + * To light up a CRTC, attaching a primary plane is the most likely to
> + * work if it covers the whole CRTC and doesn't have scaling or
> + * cropping set up.
> + *
> + * Drivers may support more features for the primary plane, user-space
> + * can find out with test-only atomic commits.
> + *
> + * User-space must not mix the legacy IOCTLs &DRM_IOCTL_MODE_SETCRTC or
> + * &DRM_IOCTL_MODE_PAGE_FLIP with atomic commits involving a primary
s/a primary/any primary/
to make it a bit stronger
> + * plane.
You can also use primary planes through the setplane ioctl. Also this
doesn't explain why, which is maybe a bit head scratching.
I'd put something like "Primary planes are used implicitly by the kernel
in the legacy IOCTLs SETCRTC & FLIP. Therefore userspace must not mix
explicit usage of any primary plane (e.g. through ATOMIC IOCTL) with these
legacy IOCTL." Feel free to bikeshed further.
> + * "Cursor":
> + * To enable this plane, using a framebuffer configured without scaling
> + * or cropping and with the following properties is the most likely to
> + * work:
> + *
> + * - If the driver provides the capabilities &DRM_CAP_CURSOR_WIDTH and
> + * &DRM_CAP_CURSOR_HEIGHT, create the framebuffer with this size.
> + * Otherwise, create a framebuffer with the size 64x64.
> + * - If the driver doesn't support modifiers, create a framebuffer with
> + * a linear layout. Otherwise, use the IN_FORMATS plane property.
> + *
> + * Drivers may support more features for the cursor plane, user-space
> + * can find out with test-only atomic commits.
> + *
> + * User-space must not mix the legacy IOCTLs &DRM_IOCTL_MODE_CURSOR or
> + * &DRM_IOCTL_MODE_CURSOR2 with atomic commits involving a cursor
> + * plane.
Same here.
Maybe we should also note that cursors are not necessarily exposed as
cursor planes, even for drivers supporting atomic modeset.
-Daniel
> + * "Overlay":
> + * Neither primary nor cursor.
> + *
> + * Overlay planes are the only planes exposed when the
> + * &DRM_CLIENT_CAP_UNIVERSAL_PLANES capability is disabled.
> + *
> * IN_FORMATS:
> * Blob property which contains the set of buffer format and modifier
> * pairs supported by this plane. The blob is a struct
> --
> 2.29.2
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v2 8/9] drm/doc: demote old doc-comments in drm.h
2020-12-17 11:32 ` [PATCH v2 8/9] drm/doc: demote old doc-comments in drm.h Simon Ser
@ 2020-12-17 12:13 ` Daniel Vetter
0 siblings, 0 replies; 18+ messages in thread
From: Daniel Vetter @ 2020-12-17 12:13 UTC (permalink / raw)
To: Simon Ser; +Cc: dri-devel
On Thu, Dec 17, 2020 at 12:32:19PM +0100, Simon Ser wrote:
> Sphinx doesn't like old doc-comments in drm.h and generates warnings
> like:
>
> ./include/uapi/drm/drm.h:87: warning: cannot understand function prototype: 'struct drm_clip_rect '
> ./include/uapi/drm/drm.h:97: warning: cannot understand function prototype: 'struct drm_drawable_info '
> ./include/uapi/drm/drm.h:105: warning: cannot understand function prototype: 'struct drm_tex_region '
> ...
>
> Demote these to regular comments, because converting all of them is
> quite a lot of work (also requires documenting all of the struct fields
> for instance). Also many of these structures aren't really used by
> modern user-space.
>
> We can easily convert these remaining old comments to Sphinx style on a
> one-by-one basis.
>
> Signed-off-by: Simon Ser <contact@emersion.fr>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Pekka Paalanen <ppaalanen@gmail.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
> include/uapi/drm/drm.h | 84 +++++++++++++++++++++---------------------
> 1 file changed, 42 insertions(+), 42 deletions(-)
>
> diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
> index 783f666152a1..512ca80e8d4a 100644
> --- a/include/uapi/drm/drm.h
> +++ b/include/uapi/drm/drm.h
> @@ -75,7 +75,7 @@ typedef unsigned int drm_context_t;
> typedef unsigned int drm_drawable_t;
> typedef unsigned int drm_magic_t;
>
> -/**
> +/*
> * Cliprect.
> *
> * \warning: If you change this structure, make sure you change
> @@ -91,7 +91,7 @@ struct drm_clip_rect {
> unsigned short y2;
> };
>
> -/**
> +/*
> * Drawable information.
> */
> struct drm_drawable_info {
> @@ -99,7 +99,7 @@ struct drm_drawable_info {
> struct drm_clip_rect *rects;
> };
>
> -/**
> +/*
> * Texture region,
> */
> struct drm_tex_region {
> @@ -110,7 +110,7 @@ struct drm_tex_region {
> unsigned int age;
> };
>
> -/**
> +/*
> * Hardware lock.
> *
> * The lock structure is a simple cache-line aligned integer. To avoid
> @@ -122,7 +122,7 @@ struct drm_hw_lock {
> char padding[60]; /**< Pad to cache line */
> };
>
> -/**
> +/*
> * DRM_IOCTL_VERSION ioctl argument type.
> *
> * \sa drmGetVersion().
> @@ -139,7 +139,7 @@ struct drm_version {
> char __user *desc; /**< User-space buffer to hold desc */
> };
>
> -/**
> +/*
> * DRM_IOCTL_GET_UNIQUE ioctl argument type.
> *
> * \sa drmGetBusid() and drmSetBusId().
> @@ -158,7 +158,7 @@ struct drm_block {
> int unused;
> };
>
> -/**
> +/*
> * DRM_IOCTL_CONTROL ioctl argument type.
> *
> * \sa drmCtlInstHandler() and drmCtlUninstHandler().
> @@ -173,7 +173,7 @@ struct drm_control {
> int irq;
> };
>
> -/**
> +/*
> * Type of memory to map.
> */
> enum drm_map_type {
> @@ -185,7 +185,7 @@ enum drm_map_type {
> _DRM_CONSISTENT = 5 /**< Consistent memory for PCI DMA */
> };
>
> -/**
> +/*
> * Memory mapping flags.
> */
> enum drm_map_flags {
> @@ -204,7 +204,7 @@ struct drm_ctx_priv_map {
> void *handle; /**< Handle of map */
> };
>
> -/**
> +/*
> * DRM_IOCTL_GET_MAP, DRM_IOCTL_ADD_MAP and DRM_IOCTL_RM_MAP ioctls
> * argument type.
> *
> @@ -221,7 +221,7 @@ struct drm_map {
> /* Private data */
> };
>
> -/**
> +/*
> * DRM_IOCTL_GET_CLIENT ioctl argument type.
> */
> struct drm_client {
> @@ -253,7 +253,7 @@ enum drm_stat_type {
> /* Add to the *END* of the list */
> };
>
> -/**
> +/*
> * DRM_IOCTL_GET_STATS ioctl argument type.
> */
> struct drm_stats {
> @@ -264,7 +264,7 @@ struct drm_stats {
> } data[15];
> };
>
> -/**
> +/*
> * Hardware locking flags.
> */
> enum drm_lock_flags {
> @@ -279,7 +279,7 @@ enum drm_lock_flags {
> _DRM_HALT_CUR_QUEUES = 0x20 /**< Halt all current queues */
> };
>
> -/**
> +/*
> * DRM_IOCTL_LOCK, DRM_IOCTL_UNLOCK and DRM_IOCTL_FINISH ioctl argument type.
> *
> * \sa drmGetLock() and drmUnlock().
> @@ -289,7 +289,7 @@ struct drm_lock {
> enum drm_lock_flags flags;
> };
>
> -/**
> +/*
> * DMA flags
> *
> * \warning
> @@ -318,7 +318,7 @@ enum drm_dma_flags {
> _DRM_DMA_LARGER_OK = 0x40 /**< Larger-than-requested buffers OK */
> };
>
> -/**
> +/*
> * DRM_IOCTL_ADD_BUFS and DRM_IOCTL_MARK_BUFS ioctl argument type.
> *
> * \sa drmAddBufs().
> @@ -341,7 +341,7 @@ struct drm_buf_desc {
> */
> };
>
> -/**
> +/*
> * DRM_IOCTL_INFO_BUFS ioctl argument type.
> */
> struct drm_buf_info {
> @@ -349,7 +349,7 @@ struct drm_buf_info {
> struct drm_buf_desc __user *list;
> };
>
> -/**
> +/*
> * DRM_IOCTL_FREE_BUFS ioctl argument type.
> */
> struct drm_buf_free {
> @@ -357,7 +357,7 @@ struct drm_buf_free {
> int __user *list;
> };
>
> -/**
> +/*
> * Buffer information
> *
> * \sa drm_buf_map.
> @@ -369,7 +369,7 @@ struct drm_buf_pub {
> void __user *address; /**< Address of buffer */
> };
>
> -/**
> +/*
> * DRM_IOCTL_MAP_BUFS ioctl argument type.
> */
> struct drm_buf_map {
> @@ -382,7 +382,7 @@ struct drm_buf_map {
> struct drm_buf_pub __user *list; /**< Buffer information */
> };
>
> -/**
> +/*
> * DRM_IOCTL_DMA ioctl argument type.
> *
> * Indices here refer to the offset into the buffer list in drm_buf_get.
> @@ -407,7 +407,7 @@ enum drm_ctx_flags {
> _DRM_CONTEXT_2DONLY = 0x02
> };
>
> -/**
> +/*
> * DRM_IOCTL_ADD_CTX ioctl argument type.
> *
> * \sa drmCreateContext() and drmDestroyContext().
> @@ -417,7 +417,7 @@ struct drm_ctx {
> enum drm_ctx_flags flags;
> };
>
> -/**
> +/*
> * DRM_IOCTL_RES_CTX ioctl argument type.
> */
> struct drm_ctx_res {
> @@ -425,14 +425,14 @@ struct drm_ctx_res {
> struct drm_ctx __user *contexts;
> };
>
> -/**
> +/*
> * DRM_IOCTL_ADD_DRAW and DRM_IOCTL_RM_DRAW ioctl argument type.
> */
> struct drm_draw {
> drm_drawable_t handle;
> };
>
> -/**
> +/*
> * DRM_IOCTL_UPDATE_DRAW ioctl argument type.
> */
> typedef enum {
> @@ -446,14 +446,14 @@ struct drm_update_draw {
> unsigned long long data;
> };
>
> -/**
> +/*
> * DRM_IOCTL_GET_MAGIC and DRM_IOCTL_AUTH_MAGIC ioctl argument type.
> */
> struct drm_auth {
> drm_magic_t magic;
> };
>
> -/**
> +/*
> * DRM_IOCTL_IRQ_BUSID ioctl argument type.
> *
> * \sa drmGetInterruptFromBusID().
> @@ -495,7 +495,7 @@ struct drm_wait_vblank_reply {
> long tval_usec;
> };
>
> -/**
> +/*
> * DRM_IOCTL_WAIT_VBLANK ioctl argument type.
> *
> * \sa drmWaitVBlank().
> @@ -508,7 +508,7 @@ union drm_wait_vblank {
> #define _DRM_PRE_MODESET 1
> #define _DRM_POST_MODESET 2
>
> -/**
> +/*
> * DRM_IOCTL_MODESET_CTL ioctl argument type
> *
> * \sa drmModesetCtl().
> @@ -518,7 +518,7 @@ struct drm_modeset_ctl {
> __u32 cmd;
> };
>
> -/**
> +/*
> * DRM_IOCTL_AGP_ENABLE ioctl argument type.
> *
> * \sa drmAgpEnable().
> @@ -527,7 +527,7 @@ struct drm_agp_mode {
> unsigned long mode; /**< AGP mode */
> };
>
> -/**
> +/*
> * DRM_IOCTL_AGP_ALLOC and DRM_IOCTL_AGP_FREE ioctls argument type.
> *
> * \sa drmAgpAlloc() and drmAgpFree().
> @@ -539,7 +539,7 @@ struct drm_agp_buffer {
> unsigned long physical; /**< Physical used by i810 */
> };
>
> -/**
> +/*
> * DRM_IOCTL_AGP_BIND and DRM_IOCTL_AGP_UNBIND ioctls argument type.
> *
> * \sa drmAgpBind() and drmAgpUnbind().
> @@ -549,7 +549,7 @@ struct drm_agp_binding {
> unsigned long offset; /**< In bytes -- will round to page boundary */
> };
>
> -/**
> +/*
> * DRM_IOCTL_AGP_INFO ioctl argument type.
> *
> * \sa drmAgpVersionMajor(), drmAgpVersionMinor(), drmAgpGetMode(),
> @@ -570,7 +570,7 @@ struct drm_agp_info {
> unsigned short id_device;
> };
>
> -/**
> +/*
> * DRM_IOCTL_SG_ALLOC ioctl argument type.
> */
> struct drm_scatter_gather {
> @@ -578,7 +578,7 @@ struct drm_scatter_gather {
> unsigned long handle; /**< Used for mapping / unmapping */
> };
>
> -/**
> +/*
> * DRM_IOCTL_SET_VERSION ioctl argument type.
> */
> struct drm_set_version {
> @@ -588,14 +588,14 @@ struct drm_set_version {
> int drm_dd_minor;
> };
>
> -/** DRM_IOCTL_GEM_CLOSE ioctl argument type */
> +/* DRM_IOCTL_GEM_CLOSE ioctl argument type */
> struct drm_gem_close {
> /** Handle of the object to be closed. */
> __u32 handle;
> __u32 pad;
> };
>
> -/** DRM_IOCTL_GEM_FLINK ioctl argument type */
> +/* DRM_IOCTL_GEM_FLINK ioctl argument type */
> struct drm_gem_flink {
> /** Handle for the object being named */
> __u32 handle;
> @@ -604,7 +604,7 @@ struct drm_gem_flink {
> __u32 name;
> };
>
> -/** DRM_IOCTL_GEM_OPEN ioctl argument type */
> +/* DRM_IOCTL_GEM_OPEN ioctl argument type */
> struct drm_gem_open {
> /** Name of object being opened */
> __u32 name;
> @@ -642,7 +642,7 @@ struct drm_gem_open {
> #define DRM_CAP_SYNCOBJ 0x13
> #define DRM_CAP_SYNCOBJ_TIMELINE 0x14
>
> -/** DRM_IOCTL_GET_CAP ioctl argument type */
> +/* DRM_IOCTL_GET_CAP ioctl argument type */
> struct drm_get_cap {
> __u64 capability;
> __u64 value;
> @@ -690,7 +690,7 @@ struct drm_get_cap {
> */
> #define DRM_CLIENT_CAP_WRITEBACK_CONNECTORS 5
>
> -/** DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */
> +/* DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */
> struct drm_set_client_cap {
> __u64 capability;
> __u64 value;
> @@ -942,7 +942,7 @@ extern "C" {
>
> #define DRM_IOCTL_MODE_GETFB2 DRM_IOWR(0xCE, struct drm_mode_fb_cmd2)
>
> -/**
> +/*
> * Device specific ioctls should only be in their respective headers
> * The device specific ioctl range is from 0x40 to 0x9f.
> * Generic IOCTLS restart at 0xA0.
> @@ -953,7 +953,7 @@ extern "C" {
> #define DRM_COMMAND_BASE 0x40
> #define DRM_COMMAND_END 0xA0
>
> -/**
> +/*
> * Header for events written back to userspace on the drm fd. The
> * type defines the type of event, the length specifies the total
> * length of the event (including the header), and user_data is
> --
> 2.29.2
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v2 9/9] drm/doc: render drm.h uapi docs
2020-12-17 11:32 ` [PATCH v2 9/9] drm/doc: render drm.h uapi docs Simon Ser
@ 2020-12-17 12:14 ` Daniel Vetter
0 siblings, 0 replies; 18+ messages in thread
From: Daniel Vetter @ 2020-12-17 12:14 UTC (permalink / raw)
To: Simon Ser; +Cc: dri-devel
On Thu, Dec 17, 2020 at 12:32:20PM +0100, Simon Ser wrote:
> It doesn't seem like drm.h docs are included anywhere. Render them next
> to drm_mode.h, under the "Userspace API Structures" section.
>
> This also allows references to e.g. DRM_CAP_* to be properly linkified
> elsewhere in our docs.
>
> Signed-off-by: Simon Ser <contact@emersion.fr>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Cc: Pekka Paalanen <ppaalanen@gmail.com>
> ---
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> Documentation/gpu/drm-uapi.rst | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/Documentation/gpu/drm-uapi.rst b/Documentation/gpu/drm-uapi.rst
> index 7dce175f6d75..04bdc7a91d53 100644
> --- a/Documentation/gpu/drm-uapi.rst
> +++ b/Documentation/gpu/drm-uapi.rst
> @@ -457,5 +457,8 @@ Userspace API Structures
> .. kernel-doc:: include/uapi/drm/drm_mode.h
> :doc: overview
>
> +.. kernel-doc:: include/uapi/drm/drm.h
> + :internal:
> +
> .. kernel-doc:: include/uapi/drm/drm_mode.h
> :internal:
> --
> 2.29.2
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2020-12-17 12:14 UTC | newest]
Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-17 11:32 [PATCH v2 0/9] drm/doc: misc documentation improvements Simon Ser
2020-12-17 11:32 ` [PATCH v2 1/9] drm/doc: the KMS properties section is for user-space devs Simon Ser
2020-12-17 12:03 ` Daniel Vetter
2020-12-17 11:32 ` [PATCH v2 2/9] drm/doc: introduce new section for standard plane properties Simon Ser
2020-12-17 11:32 ` [PATCH v2 3/9] drm/doc: fix reference to drm_format_modifier_blob Simon Ser
2020-12-17 12:04 ` Daniel Vetter
2020-12-17 11:32 ` [PATCH v2 4/9] drm/doc: fix drm_plane_type docs Simon Ser
2020-12-17 12:05 ` Daniel Vetter
2020-12-17 11:32 ` [PATCH v2 5/9] drm/doc: document the type plane property Simon Ser
2020-12-17 12:13 ` Daniel Vetter
2020-12-17 11:32 ` [PATCH v2 6/9] drm/doc: atomic implicitly enables other caps Simon Ser
2020-12-17 12:05 ` Daniel Vetter
2020-12-17 11:32 ` [PATCH v2 7/9] drm/doc: remove drm.h file comment Simon Ser
2020-12-17 12:07 ` Daniel Vetter
2020-12-17 11:32 ` [PATCH v2 8/9] drm/doc: demote old doc-comments in drm.h Simon Ser
2020-12-17 12:13 ` Daniel Vetter
2020-12-17 11:32 ` [PATCH v2 9/9] drm/doc: render drm.h uapi docs Simon Ser
2020-12-17 12:14 ` Daniel Vetter
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.