All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel.vetter@ffwll.ch>
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: [PATCH 3/6] drm/doc: Add KMS overview graphs
Date: Tue, 28 Feb 2017 18:13:16 +0100	[thread overview]
Message-ID: <20170228171319.1786-4-daniel.vetter@ffwll.ch> (raw)
In-Reply-To: <20170228171319.1786-1-daniel.vetter@ffwll.ch>

Oh, the shiny and pretties!

Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 Documentation/gpu/drm-kms-helpers.rst |   4 ++
 Documentation/gpu/drm-kms.rst         | 132 ++++++++++++++++++++++++++++++++++
 2 files changed, 136 insertions(+)

diff --git a/Documentation/gpu/drm-kms-helpers.rst b/Documentation/gpu/drm-kms-helpers.rst
index 03040aa14fe8..012b6ff3ec3f 100644
--- a/Documentation/gpu/drm-kms-helpers.rst
+++ b/Documentation/gpu/drm-kms-helpers.rst
@@ -114,6 +114,8 @@ Framebuffer CMA Helper Functions Reference
 .. kernel-doc:: drivers/gpu/drm/drm_fb_cma_helper.c
    :export:
 
+.. _drm_bridges:
+
 Bridges
 =======
 
@@ -139,6 +141,8 @@ Bridge Helper Reference
 .. kernel-doc:: drivers/gpu/drm/drm_bridge.c
    :export:
 
+.. _drm_panel_helper:
+
 Panel Helper Reference
 ======================
 
diff --git a/Documentation/gpu/drm-kms.rst b/Documentation/gpu/drm-kms.rst
index 4d4068855ec4..87d8162c9a34 100644
--- a/Documentation/gpu/drm-kms.rst
+++ b/Documentation/gpu/drm-kms.rst
@@ -17,6 +17,138 @@ be setup by initializing the following fields.
 
 Mode Configuration
 
+Overview
+========
+
+.. kernel-render:: DOT
+   :alt: KMS Display Pipeline
+   :caption: KMS Display Pipeline Overview
+
+   digraph "KMS" {
+      node [shape=box]
+
+      subgraph cluster_static {
+          style=dashed
+          label="Static Objects"
+
+          node [bgcolor=grey style=filled]
+          "drm_plane A" -> "drm_crtc"
+          "drm_plane B" -> "drm_crtc"
+          "drm_crtc" -> "drm_encoder A"
+          "drm_crtc" -> "drm_encoder B"
+      }
+
+      subgraph cluster_user_created {
+          style=dashed
+          label="Userspace-Created"
+
+          node [shape=oval]
+          "drm_framebuffer 1" -> "drm_plane A"
+          "drm_framebuffer 2" -> "drm_plane B"
+      }
+
+      subgraph cluster_connector {
+          style=dashed
+          label="Hotpluggable"
+
+          "drm_encoder A" -> "drm_connector A"
+          "drm_encoder B" -> "drm_connector B"
+      }
+   }
+
+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. Multiple (or just one, 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 chapter.
+
+For the output routing the first step are Encoders (represented by
+:c:type:`struct drm_encoder <drm_encoder>`, see `Encoder Abstraction`_). Those
+are really just internal artifacts of the helper libraries used to implement KMS
+drivers. But unfortunately encoders have been exposed to userspace. Besides that
+they make it unecessarily more complicated for userspace to figure out which
+connections between a CRTC and a connector, and what kind of cloning is
+supported, they serve no purpose in the userspace API. Futhermore the exposed
+restrictions are often wrongly set by drivers, and in many cases not powerful
+enough to express the real restrictions. A CRTC can be connected to multiple
+Encoders, but for an active CRTC there must be at least one encoder.
+
+The final, and real, endpoint in the display chain is the connector (represented
+by :c:type:`struct drm_connector <drm_connector>`, see `Connector
+Abstraction`_). Connectors can have different possible encoders, but the kernel
+driver does this selection. The use case is DVI, which could switch between an
+analog and a digital encoder. There is only ever one active connector for any
+encoder.
+
+Internally the output pipeline is a bit more complex and matches todays hardware
+more closely:
+
+.. kernel-render:: DOT
+   :alt: KMS Output Pipeline
+   :caption: KMS Output Pipeline
+
+   digraph "Output Pipeline" {
+      node [shape=box]
+
+      subgraph {
+          "drm_crtc" [bgcolor=grey style=filled]
+      }
+
+      subgraph cluster_internal {
+          style=dashed
+          label="Internal Pipeline"
+          {
+              node [bgcolor=grey style=filled]
+              "drm_encoder A";
+              "drm_encoder B";
+              "drm_encoder C";
+          }
+
+          {
+              node [bgcolor=grey style=filled]
+              "drm_encoder B" -> "drm_bridge B"
+              "drm_encoder C" -> "drm_bridge C1"
+              "drm_bridge C1" -> "drm_bridge C2";
+          }
+      }
+
+      "drm_crtc" -> "drm_encoder A"
+      "drm_crtc" -> "drm_encoder B"
+      "drm_crtc" -> "drm_encoder C"
+
+
+      subgraph cluster_output {
+          style=dashed
+          label="Outputs"
+
+          "drm_encoder A" -> "drm_connector A";
+          "drm_bridge B" -> "drm_connector B";
+          "drm_bridge C2" -> "drm_connector C";
+
+          "drm_panel"
+      }
+   }
+
+Internally two additional helper objects come into play. First, to be able to
+share code for encoders (sometimes on the same SoC, sometimes off-chip) one or
+more :ref:`drm_bridges` (represented by :c:type:`struct drm_bridge
+<drm_bridge>`) can be linked to an encoder. This link is static and cannot be
+changed, which means the cross-bar (if there is any) needs to be mapped between
+the CRTC and any encoders. Often for drivers with bridges there's no code left
+at the encoder level. Atomic drivers can leave out all the encoder callbacks to
+essentially only leave a dummy routing object behind, which is needed for
+backwards compatibility since encoders are exposed to userspace.
+
+The second objects are panels, represented by :c:type:`struct drm_panel
+<drm_panel>`, see :ref:`drm_panel_helper`. Panels do not have a fixed binding
+point, but are generally linked to the driver private structure which embeds
+:c:type:`struct drm_connector <drm_connector>`.
+
+Note that currently the bridge chaining and interactions with connectors and
+panels are still in-flux and not really fully sorted out yet.
+
 KMS Core Structures and Functions
 =================================
 
-- 
2.11.0

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

  parent reply	other threads:[~2017-02-28 17:13 UTC|newest]

Thread overview: 54+ 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 ` Daniel Vetter [this message]
2017-03-01 16:33   ` [PATCH 3/6] drm/doc: Add KMS overview graphs 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
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 3/6] drm/doc: Add KMS overview graphs Daniel Vetter
2016-12-19  7:44 [PATCH 0/6] diagrams for drm docs Daniel Vetter
2016-12-19  7:44 ` [PATCH 3/6] drm/doc: Add KMS overview graphs 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=20170228171319.1786-4-daniel.vetter@ffwll.ch \
    --to=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.