All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Anholt <eric@anholt.net>
To: linux-doc@vger.kernel.org
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	DRI Development <dri-devel@lists.freedesktop.org>,
	Daniel Vetter <daniel.vetter@intel.com>
Subject: Re: [PATCH 6/6] drm/doc: atomic overview, with graph
Date: Tue, 28 Feb 2017 15:48:47 -0800	[thread overview]
Message-ID: <87d1e13mhs.fsf@eliezer.anholt.net> (raw)
In-Reply-To: <20170228171319.1786-7-daniel.vetter@ffwll.ch>


[-- Attachment #1.1: Type: text/plain, Size: 5855 bytes --]

Daniel Vetter <daniel.vetter@ffwll.ch> writes:

> I want to split up a few more things and document some details better
> (like how exactly to subclass drm_atomic_state). And maybe also split
> up the helpers a bit per-topic, but this should be a ok-ish start for
> better atomic overview.
>
> One thing I failed at is getting DOT to layout the overview graph how
> I want it. The highlevel structure I want is:
>
> 	Free-standing State
>
> 	Current State
>
> i.e. one over the other. Currently it lays it out side-by-side, but
> not even that really - "Current State" is somewhat offset below. Makes
> the graph look like garbage, and also way too wide for proper
> rendering. Ideas appreciated.
>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Harry Wentland <harry.wentland@amd.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

Thanks for writing these docs.  I wish I had them back when I was
starting vc4's atomic code!  With the two little spelling nits fixed,
3-5 are:

Acked-by: Eric Anholt <eric@anholt.net>

A few copyedits on this one below, but it sounds like you don't want to
push quite yet while you sort out the rendering.

> ---
>  Documentation/gpu/drm-kms-helpers.rst |  2 +
>  Documentation/gpu/drm-kms.rst         | 85 ++++++++++++++++++++++++++++++++++-
>  2 files changed, 86 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/gpu/drm-kms-helpers.rst b/Documentation/gpu/drm-kms-helpers.rst
> index 050ebe81d256..ac53c0b893f6 100644
> --- a/Documentation/gpu/drm-kms-helpers.rst
> +++ b/Documentation/gpu/drm-kms-helpers.rst
> @@ -42,6 +42,8 @@ Modeset Helper Reference for Common Vtables
>  .. kernel-doc:: include/drm/drm_modeset_helper_vtables.h
>     :internal:
>  
> +.. _drm_atomic_helper:
> +
>  Atomic Modeset Helper Functions Reference
>  =========================================
>  
> diff --git a/Documentation/gpu/drm-kms.rst b/Documentation/gpu/drm-kms.rst
> index 20378881445f..979cee853bb1 100644
> --- a/Documentation/gpu/drm-kms.rst
> +++ b/Documentation/gpu/drm-kms.rst
> @@ -189,8 +189,91 @@ multiple times to different objects using :c:func:`drm_object_attach_property()
>  .. kernel-doc:: drivers/gpu/drm/drm_mode_object.c
>     :export:
>  
> +Atomic Mode Setting
> +===================
> +
> +
> +.. FIXME: The I want the below graph to be laid out so that the 2 subgraph
> +   clusters are below each another. But I failed.
> +
> +.. kernel-render:: DOT
> +   :alt: Mode Objects and Properties
> +   :caption: Mode Objects and Properties
> +
> +   digraph {
> +      node [shape=box]
> +
> +      subgraph cluster_state {
> +          style=dashed
> +          label="Free-standing state"
> +
> +          "drm_atomic_state" -> "duplicated drm_plane_state A"
> +          "drm_atomic_state" -> "duplicated drm_plane_state B"
> +          "drm_atomic_state" -> "duplicated drm_crtc_state"
> +          "drm_atomic_state" -> "duplicated drm_connector_state"
> +          "drm_atomic_state" -> "duplicated driver private state"
> +      }
> +
> +      subgraph cluster_current {
> +          style=dashed
> +          label="Current state"
> +
> +          "drm_device" -> "drm_plane A"
> +          "drm_device" -> "drm_plane B"
> +          "drm_device" -> "drm_crtc"
> +          "drm_device" -> "drm_connector"
> +          "drm_device" -> "driver private object"
> +
> +          "drm_plane A" -> "drm_plane_state A"
> +          "drm_plane B" -> "drm_plane_state B"
> +          "drm_crtc" -> "drm_crtc_state"
> +          "drm_connector" -> "drm_connector_state"
> +          "driver private object" -> "driver private state"
> +      }
> +
> +      "drm_atomic_state" -> "drm_device" [label="atomic_commit"]
> +   }
> +
> +Essentially atomic is transactional modeset (including planes) updates, but
> +compared to the usual transactional approach of try-commit and rollback on
> +failure atomic modesetting is a bit different:

Maybe reword:

"Atomic provides transactional modeset (including planes) updates, but a
bit differently from the usual transactional approach of try-commit and
rollback:"

> +- Firstly, no hardware changes are allowed when the commit would fail. This
> +  allows us to implement the DRM_MODE_ATOMIC_TEST_ONLY mode, which allows
> +  userspace to explore whether certain configurations would work or not.
> +
> +- This would still allows setting and rollback of just the software state,

"allow"

> +  simplifying conversion of existing drivers. But auditing drivers for
> +  correctness of the atomic_check code because really hard with that.

s/because/becomes/?

> +Taken all together there's two consequence for the atomic design:

"consequences"

> +
> +- The overall state is split up into per-object state structures:
> +  :c:type:`struct drm_plane_state <drm_plane_state>` for planes, :c:type:`struct
> +  drm_crtc_state <drm_crtc_state>` for CRTCs and :c:type:`struct
> +  drm_connector_state <drm_connector_state` for connectors. These are the only
> +  objects with userspace-visible and settable state. For internal state drivers
> +  can subclass these structures through embeddeding, or add entirely new state
> +  structures for their globally shared hardware functions.
> +
> +- An atomic update is assembled and validated as an enterily free-standing pile
> +  of structures within the :c:type:`drm_atomic_state <drm_atomic_state>`
> +  container. Again drivers can subclass that container for their own state
> +  structure tracking needs. Only when a state is commit is it applied to the

"is committed"

> +  driver and modeset objects. This way rolling back an update boils down to
> +  releasing memory and unreference objects like framebuffers.

"unreferencing"

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-02-28 23:48 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-28 17:13 [PATCH 0/6] more kernel-doc patches Daniel Vetter
2017-02-28 17:13 ` [PATCH 1/6] doc: Explain light-handed markup preference a bit better Daniel Vetter
2017-02-28 17:13 ` [PATCH 2/6] docs-rst: automatically convert Graphviz and SVG images Daniel Vetter
2017-03-01 15:56   ` Gabriel Krisman Bertazi
2017-03-02  7:12     ` Daniel Vetter
2017-03-02  8:23       ` Markus Heiser
2017-03-02 12:26   ` Laurent Pinchart
2017-03-02 13:54     ` Daniel Vetter
2017-03-02 14:14       ` Laurent Pinchart
2017-03-02 14:58         ` Markus Heiser
2017-03-02 15:11           ` Daniel Vetter
2017-03-02 15:17             ` Laurent Pinchart
2017-03-02 15:21             ` Markus Heiser
2017-03-02 15:45               ` Mauro Carvalho Chehab
2017-03-02 15:49                 ` Mauro Carvalho Chehab
2017-03-02 16:13                   ` Markus Heiser
2017-03-02 16:29                     ` Mauro Carvalho Chehab
2017-03-02 18:16                       ` Markus Heiser
2017-03-02 18:20                         ` Jonathan Corbet
2017-03-02 18:47                           ` Markus Heiser
2017-03-02 19:09                         ` Mauro Carvalho Chehab
2017-03-02 20:16                           ` Markus Heiser
2017-03-02 20:28                             ` Mauro Carvalho Chehab
2017-03-04 14:56                           ` docutils borkage (was: [PATCH 2/6] docs-rst: automatically convert Graphviz and SVG images) Jonathan Corbet
2017-03-05  2:23                             ` Mauro Carvalho Chehab
2017-03-02 15:22             ` [PATCH 2/6] docs-rst: automatically convert Graphviz and SVG images Jonathan Corbet
2017-03-02 15:53               ` Daniel Vetter
2017-03-02 16:01                 ` Mauro Carvalho Chehab
2017-03-02 19:49                   ` Daniel Vetter
2017-03-06 10:12   ` Daniel Vetter
2017-03-06 13:13     ` Markus Heiser
2017-03-06 15:03       ` Daniel Vetter
2017-02-28 17:13 ` [PATCH 3/6] drm/doc: Add KMS overview graphs Daniel Vetter
2017-03-01 16:33   ` Gabriel Krisman Bertazi
2017-03-02 14:34   ` Laurent Pinchart
2017-03-02 15:06     ` Daniel Vetter
2017-02-28 17:13 ` [PATCH 4/6] drm/doc: Consistent kerneldoc include order Daniel Vetter
2017-02-28 23:39   ` Eric Anholt
2017-02-28 17:13 ` [PATCH 5/6] drm/doc: diagram for mode objects and properties Daniel Vetter
2017-02-28 23:40   ` Eric Anholt
2017-03-01  8:27   ` [PATCH] " Daniel Vetter
2017-03-01 16:45     ` Gabriel Krisman Bertazi
2017-03-02 14:42     ` Laurent Pinchart
2017-02-28 17:13 ` [PATCH 6/6] drm/doc: atomic overview, with graph Daniel Vetter
2017-02-28 23:48   ` Eric Anholt [this message]
2017-03-01  9:57     ` Daniel Vetter
2017-03-01 17:42       ` Gabriel Krisman Bertazi
2017-03-02  7:16         ` Daniel Vetter
2017-03-01  8:35   ` [PATCH] " Daniel Vetter
2017-03-01 17:42     ` Eric Anholt
2017-03-02  7:19     ` Daniel Vetter
2017-03-02 14:41       ` Laurent Pinchart
  -- strict thread matches above, loose matches on Subject: below --
2017-03-02 15:16 [PATCH 1/6] doc: Explain light-handed markup preference a bit better Daniel Vetter
2017-03-02 15:16 ` [PATCH 6/6] drm/doc: atomic overview, with graph Daniel Vetter
2017-03-02 15:24   ` Gabriel Krisman Bertazi
2017-03-14 14:14     ` Daniel Vetter
2016-12-19  7:44 [PATCH 0/6] diagrams for drm docs Daniel Vetter
2016-12-19  7:44 ` [PATCH 6/6] drm/doc: atomic overview, with graph 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=87d1e13mhs.fsf@eliezer.anholt.net \
    --to=eric@anholt.net \
    --cc=daniel.vetter@ffwll.ch \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-doc@vger.kernel.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 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.