dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Ser <contact@emersion.fr>
To: dri-devel@lists.freedesktop.org
Subject: [PATCH v2 4/9] drm/doc: fix drm_plane_type docs
Date: Thu, 17 Dec 2020 12:32:15 +0100	[thread overview]
Message-ID: <20201217113220.102271-5-contact@emersion.fr> (raw)
In-Reply-To: <20201217113220.102271-1-contact@emersion.fr>

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

  parent reply	other threads:[~2020-12-17 11:32 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Simon Ser [this message]
2020-12-17 12:05   ` [PATCH v2 4/9] drm/doc: fix drm_plane_type docs 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

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=20201217113220.102271-5-contact@emersion.fr \
    --to=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox