From: Eric Anholt Subject: Re: [PATCH 6/6] drm/doc: atomic overview, with graph Date: Tue, 28 Feb 2017 15:48:47 -0800 Message-ID: <87d1e13mhs.fsf@eliezer.anholt.net> References: <20170228171319.1786-1-daniel.vetter@ffwll.ch> <20170228171319.1786-7-daniel.vetter@ffwll.ch> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1721495531==" Return-path: Received: from anholt.net (anholt.net [50.246.234.109]) by gabe.freedesktop.org (Postfix) with ESMTP id DCD416E83A for ; Tue, 28 Feb 2017 23:48:51 +0000 (UTC) In-Reply-To: <20170228171319.1786-7-daniel.vetter@ffwll.ch> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: linux-doc@vger.kernel.org Cc: Daniel Vetter , Laurent Pinchart , DRI Development , Daniel Vetter List-Id: dri-devel@lists.freedesktop.org --===============1721495531== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Daniel Vetter 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 > Cc: Harry Wentland > Signed-off-by: Daniel Vetter 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 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/dr= m-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: >=20=20 > +.. _drm_atomic_helper: > + > Atomic Modeset Helper Functions Reference > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20=20 > 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:`d= rm_object_attach_property() > .. kernel-doc:: drivers/gpu/drm/drm_mode_object.c > :export: >=20=20 > +Atomic Mode Setting > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > + > + > +.. FIXME: The I want the below graph to be laid out so that the 2 subgra= ph > + clusters are below each another. But I failed. > + > +.. kernel-render:: DOT > + :alt: Mode Objects and Properties > + :caption: Mode Objects and Properties > + > + digraph { > + node [shape=3Dbox] > + > + subgraph cluster_state { > + style=3Ddashed > + label=3D"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=3Ddashed > + label=3D"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=3D"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. T= his > + 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 stat= e, "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 ` for planes, :c:type= :`struct > + drm_crtc_state ` for CRTCs and :c:type:`struct > + drm_connector_state + 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-standi= ng pile > + of structures within the :c:type:`drm_atomic_state ` > + container. Again drivers can subclass that container for their own sta= te > + 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" --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE/JuuFDWp9/ZkuCBXtdYpNtH8nugFAli2DF8ACgkQtdYpNtH8 nuj04g/9G9eTJaqIlgbCawY6KEEtsihxg+SThZ6FkwjiZXnJdrU/5bDmwRU96OSs vBIrSm7K8+JttgZbsHHBVEZNSQ6LPSO79vL4ePuD73kCyDLcNUjO+XMLfxOL1Ruh j6gTxvStKhHWKlCSaw2EobQvtw99AmhrMzZUtKtZkMnIteWt4o0I5W4yuEOFnpu3 lanXOnuq1o82u0NXaYMQG+A9hNkKMNm6sktxU6USAYso8VKJHh5zvD0patXaMZjl 8PNLWqcdCQN1000RYGJxKLTN9yuBVnc/tcCnLTi92G0QDoCT37sw+naPqc98eFm0 XyG/RLiOKKsdNHxBaSyzQdiCj6Hpq+xUFgWtA+yXzBX+VwWIEmZidWySW3oMh9Ye Jmw4v6Z+sVXLJYeA+lQHzrzzCldcZeBPoF51r13eL/C7ny7pt9kuNM0pMMET758u mkm2hOuRCq8JHhJXL9duMPRFtkARZW2R7CLOST3NRXjjI9D7Rqv4HCN4PIp0aDV3 Ah/lOBHAikSDyXvjCxvEApySHrFUJvw9C04geMwzmx/bz2Ae1fZ5f5akFbAVJBWc RDJBB0H/hojwWWc1p41KBaFFFrbIg3/Lgot5G+G+7CaQm5Woj7TcwAXV0Dzu6rzA 8MGmEEMdjp7oeId0qHGz5NUE+Bsw4PnoCAUJBzMkWipsm8MbALo= =TK8w -----END PGP SIGNATURE----- --=-=-=-- --===============1721495531== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============1721495531==--