From: Sean Paul <seanpaul@chromium.org>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Daniel Vetter <daniel.vetter@intel.com>,
DRI Development <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 09/15] drm: switch drm_plane to inline comments
Date: Fri, 13 Jul 2018 11:20:57 -0400 [thread overview]
Message-ID: <20180713152057.GH20303@art_vandelay> (raw)
In-Reply-To: <20180709084016.23750-10-daniel.vetter@ffwll.ch>
On Mon, Jul 09, 2018 at 10:40:10AM +0200, Daniel Vetter wrote:
> And use that opportunity to polish the kernel doc all around:
> - Beef up some of the documentation.
> - Intro text for drm_plane and better links
> - Fix all the hyperlinks!
>
> v2: Fix linebreaks.
>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
> ---
> Documentation/gpu/drm-kms.rst | 11 +++--
> include/drm/drm_crtc.h | 4 +-
> include/drm/drm_plane.h | 88 +++++++++++++++++++++++++----------
> 3 files changed, 72 insertions(+), 31 deletions(-)
>
> diff --git a/Documentation/gpu/drm-kms.rst b/Documentation/gpu/drm-kms.rst
> index 58eed08fbe31..5dee6b8a4c12 100644
> --- a/Documentation/gpu/drm-kms.rst
> +++ b/Documentation/gpu/drm-kms.rst
> @@ -56,11 +56,12 @@ Overview
>
> The basic object structure KMS presents to userspace is fairly simple.
> Framebuffers (represented by :c:type:`struct drm_framebuffer <drm_framebuffer>`,
> -see `Frame Buffer Abstraction`_) feed into planes. One or more (or even no)
> -planes feed their pixel data into a CRTC (represented by :c:type:`struct
> -drm_crtc <drm_crtc>`, see `CRTC Abstraction`_) for blending. The precise
> -blending step is explained in more detail in `Plane Composition Properties`_ and
> -related chapters.
> +see `Frame Buffer Abstraction`_) feed into planes. Planes are represented by
> +:c:type:`struct drm_plane <drm_plane>`, see `Plane Abstraction`_ for more
> +details. One or more (or even no) planes feed their pixel data into a CRTC
> +(represented by :c:type:`struct drm_crtc <drm_crtc>`, see `CRTC Abstraction`_)
> +for blending. The precise blending step is explained in more detail in `Plane
> +Composition Properties`_ and related chapters.
>
> For the output routing the first step is encoders (represented by
> :c:type:`struct drm_encoder <drm_encoder>`, see `Encoder Abstraction`_). Those
> diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
> index 23eddbccab10..5afe2deb76b7 100644
> --- a/include/drm/drm_crtc.h
> +++ b/include/drm/drm_crtc.h
> @@ -942,8 +942,8 @@ static inline unsigned int drm_crtc_index(const struct drm_crtc *crtc)
> * drm_crtc_mask - find the mask of a registered CRTC
> * @crtc: CRTC to find mask for
> *
> - * Given a registered CRTC, return the mask bit of that CRTC for an
> - * encoder's possible_crtcs field.
> + * Given a registered CRTC, return the mask bit of that CRTC for the
> + * &drm_encoder.possible_crtcs and &drm_plane.possible_crtcs fields.
> */
> static inline uint32_t drm_crtc_mask(const struct drm_crtc *crtc)
> {
> diff --git a/include/drm/drm_plane.h b/include/drm/drm_plane.h
> index 1a647f8f5661..8a152dc16ea5 100644
> --- a/include/drm/drm_plane.h
> +++ b/include/drm/drm_plane.h
> @@ -525,30 +525,27 @@ enum drm_plane_type {
>
> /**
> * struct drm_plane - central DRM plane control structure
> - * @dev: DRM device this plane belongs to
> - * @head: for list management
> - * @name: human readable name, can be overwritten by the driver
> - * @base: base mode object
> - * @possible_crtcs: pipes this plane can be bound to
> - * @format_types: array of formats supported by this plane
> - * @format_count: number of formats supported
> - * @format_default: driver hasn't supplied supported formats for the plane
> - * @modifiers: array of modifiers supported by this plane
> - * @modifier_count: number of modifiers supported
> - * @old_fb: Temporary tracking of the old fb while a modeset is ongoing. Used by
> - * drm_mode_set_config_internal() to implement correct refcounting.
> - * @funcs: helper functions
> - * @properties: property tracking for this plane
> - * @type: type of plane (overlay, primary, cursor)
> - * @alpha_property: alpha property for this plane
> - * @zpos_property: zpos property for this plane
> - * @rotation_property: rotation property for this plane
> - * @helper_private: mid-layer private data
> + *
> + * Planes represent the scanout hardware of a display block. They receive their
> + * input data from a &drm_framebuffer and feed it to a &drm_crtc. Planes control
> + * the color conversion, see `Plane Composition Properties`_ for more details,
> + * and are also involved in the color conversion of input pixels, see `Color
> + * Management Properties`_ for details on that.
> */
> struct drm_plane {
> + /** @dev: DRM device this plane belongs to */
> struct drm_device *dev;
> +
> + /**
> + * @head:
> + *
> + * List of all planes on @dev, linked from &drm_mode_config.plane_list.
> + * Invariant over the lifetime of @dev and therefore does not need
> + * locking.
> + */
> struct list_head head;
>
> + /** @name: human readable name, can be overwritten by the driver */
> char *name;
>
> /**
> @@ -562,35 +559,62 @@ struct drm_plane {
> */
> struct drm_modeset_lock mutex;
>
> + /** @base: base mode object */
> struct drm_mode_object base;
>
> + /**
> + * @possible_crtcs: pipes this plane can be bound to constructed from
> + * drm_crtc_mask()
> + */
> uint32_t possible_crtcs;
> + /** @format_types: array of formats supported by this plane */
> uint32_t *format_types;
> + /** @format_count: Size of the array pointed at by @format_types. */
> unsigned int format_count;
> + /**
> + * @format_default: driver hasn't supplied supported formats for the
> + * plane. Used by the drm_plane_init compatibility wrapper only.
> + */
> bool format_default;
>
> + /** @modifiers: array of modifiers supported by this plane */
> uint64_t *modifiers;
> + /** @modifier_count: Size of the array pointed at by @modifier_count. */
> unsigned int modifier_count;
>
> /**
> - * @crtc: Currently bound CRTC, only really meaningful for non-atomic
> - * drivers. Atomic drivers should instead check &drm_plane_state.crtc.
> + * @crtc:
> + *
> + * Currently bound CRTC, only meaningful for non-atomic drivers. For
> + * atomic drivers this is forced to be NULL, atomic drivers should
> + * instead check &drm_plane_state.crtc.
> */
> struct drm_crtc *crtc;
>
> /**
> - * @fb: Currently bound framebuffer, only really meaningful for
> - * non-atomic drivers. Atomic drivers should instead check
> - * &drm_plane_state.fb.
> + * @fb:
> + *
> + * Currently bound framebuffer, only meaningful for non-atomic drivers.
> + * For atomic drivers this is forced to be NULL, atomic drivers should
> + * instead check &drm_plane_state.fb.
> */
> struct drm_framebuffer *fb;
>
> + /**
> + * @old_fb:
> + *
> + * Temporary tracking of the old fb while a modeset is ongoing. Only
> + * used by non-atomic drivers, forced to be NULL for atomic drivers.
> + */
> struct drm_framebuffer *old_fb;
>
> + /** @funcs: plane control functions */
> const struct drm_plane_funcs *funcs;
>
> + /** @properties: property tracking for this plane */
> struct drm_object_properties properties;
>
> + /** @type: Type of plane, see &enum drm_plane_type for details. */
> enum drm_plane_type type;
>
> /**
> @@ -599,6 +623,7 @@ struct drm_plane {
> */
> unsigned index;
>
> + /** @helper_private: mid-layer private data */
> const struct drm_plane_helper_funcs *helper_private;
>
> /**
> @@ -616,8 +641,23 @@ struct drm_plane {
> */
> struct drm_plane_state *state;
>
> + /**
> + * @alpha_property:
> + * Optional alpha property for this plane. See
> + * drm_plane_create_alpha_property().
> + */
> struct drm_property *alpha_property;
> + /**
> + * @zpos_property:
> + * Optional zpos property for this plane. See
> + * drm_plane_create_zpos_property().
> + */
> struct drm_property *zpos_property;
> + /**
> + * @rotation_property:
> + * Optional rotation property for this plane. See
> + * drm_plane_create_rotation_property().
> + */
> struct drm_property *rotation_property;
>
> /**
> --
> 2.18.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2018-07-13 15:20 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-09 8:40 [PATCH 00/15] bunch of kerneldocs polish and related cleanup Daniel Vetter
2018-07-09 8:40 ` [PATCH 01/15] drm: move drv test macros out of drmP.h Daniel Vetter
2018-07-12 13:52 ` Sean Paul
2018-07-09 8:40 ` [PATCH 02/15] drm: Drop drmP.h from drm_connector.c Daniel Vetter
2018-07-12 13:53 ` Sean Paul
2018-07-09 8:40 ` [PATCH 03/15] drm/doc: switch drm_connector_state to inline comments Daniel Vetter
2018-07-12 13:54 ` Sean Paul
2018-07-09 8:40 ` [PATCH 04/15] drm/doc: polish for sturct drm_connector Daniel Vetter
2018-07-12 14:01 ` Sean Paul
2018-07-09 8:40 ` [PATCH 05/15] drm: drop _mode_ from update_edit_property() Daniel Vetter
2018-07-13 14:59 ` Sean Paul
2018-07-13 16:05 ` Daniel Vetter
2018-07-09 8:40 ` [PATCH 06/15] drm: drop _mode_ from drm_mode_connector_attach_encoder Daniel Vetter
2018-07-13 15:01 ` Sean Paul
2018-07-09 8:40 ` [PATCH 07/15] drm: drop _mode_ from remaining connector functions Daniel Vetter
2018-07-13 15:05 ` Sean Paul
2018-07-09 8:40 ` [PATCH 08/15] drm: Switch drm_plane_state to inline kerneldoc style Daniel Vetter
2018-07-13 15:08 ` Sean Paul
2018-07-09 8:40 ` [PATCH 09/15] drm: switch drm_plane to inline comments Daniel Vetter
2018-07-13 15:20 ` Sean Paul [this message]
2018-07-09 8:40 ` [PATCH 10/15] drm: drop drmP.h include from drm_plane.c Daniel Vetter
2018-07-13 15:22 ` Sean Paul
2018-07-09 8:40 ` [PATCH 11/15] drm/doc: move struct drm_crtc to in-line comments Daniel Vetter
2018-07-13 15:27 ` Sean Paul
2018-07-09 8:40 ` [PATCH 12/15] drm/doc: Group the fb gem helpers better Daniel Vetter
2018-07-12 12:18 ` Noralf Trønnes
2018-07-09 8:40 ` [PATCH 13/15] drm/doc: Includ drm_of.c helpers Daniel Vetter
2018-07-13 15:28 ` Sean Paul
2018-07-09 8:40 ` [PATCH 14/15] drm/doc: use inline kerneldoc style for drm_crtc_state Daniel Vetter
2018-07-13 15:33 ` Sean Paul
2018-07-09 8:40 ` [PATCH 15/15] drm: drop drmP.h include from drm_crtc.c Daniel Vetter
2018-07-12 13:51 ` Sean Paul
2018-07-13 16:41 ` 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=20180713152057.GH20303@art_vandelay \
--to=seanpaul@chromium.org \
--cc=daniel.vetter@ffwll.ch \
--cc=daniel.vetter@intel.com \
--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