From patchwork Tue Feb 28 17:13:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 9596329 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DBC45601D7 for ; Tue, 28 Feb 2017 17:13:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C708B20009 for ; Tue, 28 Feb 2017 17:13:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BBCBB28552; Tue, 28 Feb 2017 17:13:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 163DF2854E for ; Tue, 28 Feb 2017 17:13:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 83FE16E7A0; Tue, 28 Feb 2017 17:13:39 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id DA5A46E7A8 for ; Tue, 28 Feb 2017 17:13:33 +0000 (UTC) Received: by mail-wm0-x243.google.com with SMTP id v77so3404037wmv.0 for ; Tue, 28 Feb 2017 09:13:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FHnm74Ohz1pszdhXuJxpD/pxRBDwgkZYtRo7myr1NWw=; b=gXduw/imeVHA3tGpeD7rGoKvzDHWRcDTgR8stRGNdb0AqMBfr/aAUdE2VI2DXHYwry 055Kc7LgR1yMvZvDDSHu9I8nE1pfdcx3Ax7r3kQHcsM/0lUs3VNFMzO0zDXeMD2Xb0oM +Vzmy5bGf4h/EgljhFpeVDHPk/sSI2ug2Gb/Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FHnm74Ohz1pszdhXuJxpD/pxRBDwgkZYtRo7myr1NWw=; b=WLid7tbljaxnFmeatr5PLOj44ET+e1UX1yo87lfTRJ30sf39ZTuf3BLi8thr1DBG8M S0QSzJA9SzDwKqf7foll407M2hj2p3aMXpeumMVvDPfmYQwv3TzzZqF3QBtgnoX7vS0C /It/6i7n8n4BFdzdxMUsXHJC5giCx9Bc4/YLFkjhPVWtnVQXCqlsJxwnohDljdx0jXH2 MIDHuaSvpLze9LgFf9r1FXrtcNvuCOb7+rbCY8x5S1ciKHu17RqYN9WZuXERR/fBULMH SFYTuG2t85r/rFutqNDcN8UVQrAPRGNlEym6Z7GS7izc/8O/D/LrVWYTUsfYFKGDuBWE qYqA== X-Gm-Message-State: AMke39kLIOD2Uwgj2SCjVLb2dWtrdIpDyVBrg4T3k/tS0b3D3Kgo04SedfIO7k8N6+deqQ== X-Received: by 10.28.7.13 with SMTP id 13mr11949963wmh.16.1488302012426; Tue, 28 Feb 2017 09:13:32 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:56c9:0:decc:6e78:7e96:b452]) by smtp.gmail.com with ESMTPSA id 63sm3475618wmg.22.2017.02.28.09.13.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Feb 2017 09:13:31 -0800 (PST) From: Daniel Vetter To: linux-doc@vger.kernel.org Subject: [PATCH 6/6] drm/doc: atomic overview, with graph Date: Tue, 28 Feb 2017 18:13:19 +0100 Message-Id: <20170228171319.1786-7-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170228171319.1786-1-daniel.vetter@ffwll.ch> References: <20170228171319.1786-1-daniel.vetter@ffwll.ch> Cc: Daniel Vetter , Laurent Pinchart , DRI Development , Daniel Vetter X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Eric Anholt --- 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: + +- 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, + simplifying conversion of existing drivers. But auditing drivers for + correctness of the atomic_check code because really hard with that. + +- Lastly, for backwards compatibility and to support all use-cases, atomic + updates need to be incremental and be able to execute in parallel. Hardware + doesn't always allow it, but where possible plane updates on different CRTCs + should not interfere, and not get stalled due to output routing changing on + different CRTCs. + +Taken all together there's two consequence for the atomic design: + +- 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 ` + 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 + driver and modeset objects. This way rolling back an update boils down to + releasing memory and unreference objects like framebuffers. + +Read on in this chapter, and also in :ref:`drm_atomic_helper` for more detailed +coverage of specific topics. + Atomic Mode Setting Function Reference -====================================== +-------------------------------------- .. kernel-doc:: include/drm/drm_atomic.h :internal: