Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp878470rdb; Fri, 1 Dec 2023 00:29:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IEu+4OJcJif2yefOLhfU6rVrXVZywuDXQxuRQkh+aLGCxpQ30lVu3ktxYfmedOqMt9wkos/ X-Received: by 2002:a05:6870:498a:b0:1bb:509a:824f with SMTP id ho10-20020a056870498a00b001bb509a824fmr30286633oab.55.1701419361603; Fri, 01 Dec 2023 00:29:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701419361; cv=none; d=google.com; s=arc-20160816; b=aAV5KAdyErmcShH4EUuQIQcC/+uUB0vxZkyIUY8PX+fPTepJt+2uHr9UCuWl8+HUnV QcWIGZHqBwOhEJxR+AqVOssqhozs7Z4zdoMVrWY7MDj28qV+ZDF9hsP0WaGujJ6ybWbG wIRgmua7Rmt/SUnyh7AxG/BCDukWFM092xTl7lzQEgRlgXgrQqn5qUZkOqw1BHO7tEcG 8IA3CHiic0yUoPmbi33ox/x2IDt6KK8ilirlVvC1SFxzxFA5PTbQOjo4+Cuk8dV0xLxs B4fmdFqjAipdsJ1+Bbat20LQOU27ZcgrfhcNUsKCQQDnnFhi3d/JmQlINA/fOZAvNDzI SNbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=PGCEu+jPHgDyCAzm7Ec8bzWFBjM+ZC0YGRu2ybbSol8=; fh=ydvJ6SYrsEkf+nYu6ct0x4mBF7IJB5zQrbBXBlJNOzE=; b=h+FALNoD1WawoxU2J3+vNWRodfr3YnWqglWxwuu9IsQ+GdTbPXdmA9MMqQ39KrHbb3 Pxq+ccS+0McpMXbnaRzAMw6PxrFsDSrTtLYFG/F7eMAcg9Q+On2VlzHzXD6XTpzdi/0K d8KyS6tlrjF60XiI4Vvrfn23yIsNHBtp/mVAr+8l4WaLFcqAilx0mTpQtCuw5zzONBlp aAgYVW3NgwE9ZmipJ5SKCmQyJ/AYfC4eR1/iyDpgnN+FIg0xAjOsW9t/cqWBLJ3UhSG2 qmnAgwZf9CYfg4kjFGYPLrl04rObh2wkeP5gQrwRwYka5I8wcNkjgEOYLmXTpIIXmbS/ T/uA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=q6qm3KCU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id y127-20020a636485000000b005acb92781fbsi3042253pgb.415.2023.12.01.00.29.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 00:29:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=q6qm3KCU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 17ECE832CBF4; Fri, 1 Dec 2023 00:29:19 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377802AbjLAI3D (ORCPT + 99 others); Fri, 1 Dec 2023 03:29:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229479AbjLAI3C (ORCPT ); Fri, 1 Dec 2023 03:29:02 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAC82170C for ; Fri, 1 Dec 2023 00:29:08 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34BEAC433C7; Fri, 1 Dec 2023 08:29:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701419348; bh=PnBJTUzXr7trutbP5JjWc1usFAZdvAOna/UdT9PCGkE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=q6qm3KCURWENxNbXN6B1mbytWuCWGTQyQhrJ67zFwzeYnJd6hEV5h0Od3bvRQ7ZOa dcuyzKQ8qwRGv4lPZPy5YeFuP5n08bn8nGmmhK5hO0C0vsL2zezxWq3Zu8vn/NKOz2 fl+P6EG1r9jkVEEY+KDdULI9BSQj6v6XSMX0g0pbru0tQiDQKHzFqoDL8+JZpDYURa hoi0ljEiDQ5MsncIicG1ELRVunjp26/ahPh5J20TbMxibtbV7iq/nK7SoLB333UDrF T/XGGMDQOA+aBGdmiPppWsnBmhPo7eUPdDsU0734BU98CDaUhSoaWhEn7VlX4Pyn0O KphjgnoKiV40Q== Date: Fri, 1 Dec 2023 09:29:05 +0100 From: Maxime Ripard To: =?utf-8?B?QW5kcsOp?= Almeida Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel-dev@igalia.com, alexander.deucher@amd.com, christian.koenig@amd.com, Simon Ser , Rob Clark , Pekka Paalanen , daniel@ffwll.ch, Daniel Stone , 'Marek =?utf-8?B?T2zFocOhayc=?= , Dave Airlie , Michel =?utf-8?Q?D=C3=A4nzer?= , Randy Dunlap , Jonathan Corbet , linux-doc@vger.kernel.org, Thomas Zimmermann , Maarten Lankhorst , Pekka Paalanen Subject: Re: [PATCH] drm/doc: Define KMS atomic state set Message-ID: References: <20231130200740.53454-1-andrealmeid@igalia.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="rfhua6m3ln4gsubv" Content-Disposition: inline In-Reply-To: <20231130200740.53454-1-andrealmeid@igalia.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 01 Dec 2023 00:29:19 -0800 (PST) --rfhua6m3ln4gsubv Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Thu, Nov 30, 2023 at 05:07:40PM -0300, Andr=E9 Almeida wrote: > From: Pekka Paalanen >=20 > Specify how the atomic state is maintained between userspace and > kernel, plus the special case for async flips. >=20 > Signed-off-by: Pekka Paalanen > Signed-off-by: Andr=E9 Almeida > --- >=20 > This is a standalone patch from the following serie, the other patches are > already merged: > https://lore.kernel.org/lkml/20231122161941.320564-1-andrealmeid@igalia.c= om/ >=20 > Documentation/gpu/drm-uapi.rst | 47 ++++++++++++++++++++++++++++++++++ > 1 file changed, 47 insertions(+) >=20 > diff --git a/Documentation/gpu/drm-uapi.rst b/Documentation/gpu/drm-uapi.= rst > index 370d820be248..d0693f902a5c 100644 > --- a/Documentation/gpu/drm-uapi.rst > +++ b/Documentation/gpu/drm-uapi.rst > @@ -570,3 +570,50 @@ dma-buf interoperability > =20 > Please see Documentation/userspace-api/dma-buf-alloc-exchange.rst for > information on how dma-buf is integrated and exposed within DRM. > + > +KMS atomic state > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > + > +An atomic commit can change multiple KMS properties in an atomic fashion, > +without ever applying intermediate or partial state changes. Either the= whole > +commit succeeds or fails, and it will never be applied partially. This i= s the > +fundamental improvement of the atomic API over the older non-atomic API = which is > +referred to as the "legacy API". Applying intermediate state could unex= pectedly > +fail, cause visible glitches, or delay reaching the final state. > + > +An atomic commit can be flagged with DRM_MODE_ATOMIC_TEST_ONLY, which me= ans the > +complete state change is validated but not applied. Userspace should us= e this > +flag to validate any state change before asking to apply it. If validati= on fails > +for any reason, userspace should attempt to fall back to another, perhaps > +simpler, final state. This allows userspace to probe for various config= urations > +without causing visible glitches on screen and without the need to undo a > +probing change. > + > +The changes recorded in an atomic commit apply on top the current KMS st= ate in > +the kernel. Hence, the complete new KMS state is the complete old KMS st= ate with > +the committed property settings done on top. The kernel will try to avoid That part is pretty confusing to me. What are you calling the current and old KMS state? What's confusing to me is that, yes, what you're saying is true for a given object: if it was part of the commit, the new state is the old state + whatever the new state changed. However, if that object wasn't part of the commit at all, then it's completely out of the old or new global KMS state. So yeah, individual object KMS state are indeed complete, but drm_atomic_state definitely isn't. And it's the whole point of functions like drm_atomic_get_crtc_state() vs drm_atomic_get_old/new_crtc_state: the old/new variants only return a state if it was part of drm_atomic_state to begin with. drm_atomic_get_crtc_state() brings the crtc state into drm_atomic_state if it wasn't part of it. Maxime --rfhua6m3ln4gsubv Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHQEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCZWmZUQAKCRDj7w1vZxhR xS0HAP90i/BOMmRuVrjPxnOxAXZYyqDfs9rubl1YOTWN6l7MnQD3eKv6YT4StIim 5Q/WsvPjodwnqiSTSEiN57YWIo13Dg== =rh3S -----END PGP SIGNATURE----- --rfhua6m3ln4gsubv--