Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp35057402rwd; Mon, 10 Jul 2023 01:47:57 -0700 (PDT) X-Google-Smtp-Source: APBJJlGpJ3SMzOwWymEVVka4Rta1kOX7AaO+Qzuqv86ZaFf3TpPSLdaSvvLKHIOz17jWsIxT/6Cr X-Received: by 2002:aa7:d052:0:b0:51e:2a56:91d6 with SMTP id n18-20020aa7d052000000b0051e2a5691d6mr10331358edo.19.1688978876775; Mon, 10 Jul 2023 01:47:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688978876; cv=none; d=google.com; s=arc-20160816; b=Bz5DQ5hA5E7yghjh2rIb5VVePWY4KlQ6QVWtTaWGPCyPd2xdcLRqM2q3Eq9qaoWzXR ofMns/RRSH9QMykLTbJQf0iZE1hEUWi2h71V55mCIlL+KGw6fmVJerJov61Gog6Xiajv vu03+tqlF9FTJCB61vfi7kOPlkWt8e20JOOJZ8oWPsDB5cTlNVoDZisQcY8uSzGrqlXV LpvHuyO4Tm7VfUPtzjGZorrcLXWc0cwU0Mr1UDTLSXxdbVl7OrxYw8Di/o7K57V1RSyn 7G00LbVuZp8IOz5sgT+P3sxVoZl4b9SqPjQUzn7katnMnlMt3/yBKH6F69srwE278mnl vJBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=U+wwP6BZLzF4aBD+iXkaOcxcJALLks32tIeZUMT3jig=; fh=EFnlg6rY+S9xqpga+ocykUjWZgrVlB7jzYzsdYr1uMc=; b=h26IhBenTIij7e2Zl56MpWaVmwe1ZqiFZtURFxfAsBhYzZLzvkXkNMsbgOI0vKUoII fy7vYOE9ggsjYV1QocsjVGLpnkMTF+LVwDmbpD00wsAAgomzbBLL+Gt2ZdrCbVUkF2FJ FnKdt8ffks6IPnfZtCDoUBjFwupcddV8zqC2zpAmrx30tterA5GH6WE4yZQe4wv58z9I SeJRq5O9kIZ/Fx3dKx6oBF9mH3LUGu5nGz2iUx5uLjsOuG41wPSTtmCp+wQG3STea7cI AIkOypHYHa6Ge1mZ7bYrRBBDgodmDIOX9k/Awokv2zEC/SYJGMhTkFqDaOd4CijruEvP 0ywQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=LUI5nhWN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w10-20020aa7cb4a000000b0051a595dc64bsi7900297edt.105.2023.07.10.01.47.33; Mon, 10 Jul 2023 01:47:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=LUI5nhWN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229830AbjGJIbE (ORCPT + 99 others); Mon, 10 Jul 2023 04:31:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230501AbjGJIbB (ORCPT ); Mon, 10 Jul 2023 04:31:01 -0400 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92804E6 for ; Mon, 10 Jul 2023 01:30:59 -0700 (PDT) Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2b6fdaf6eefso63278631fa.0 for ; Mon, 10 Jul 2023 01:30:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688977858; x=1691569858; h=mime-version:references:in-reply-to:message-id:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=U+wwP6BZLzF4aBD+iXkaOcxcJALLks32tIeZUMT3jig=; b=LUI5nhWNqI9r+4yE8lFZyyJsSVi0Bao3yiv/RMb6OBnuPaUXqKLz2xA14FApN2TndE +2a379MRuZAGcVBAnWhchUXI/8qEWlAAmTcFhbED9GrOZ3o2OtYokGICA42KLx6A+pgD 6Coze1rBwsd0EF6R1iVBGha4vqgvRbu6+6mzrFVJA3Louc66HVHKZTurrJHtUNIuG3Iy g2xvwAb68boZmKgOBfBInM65ZB19LfjeblgpEXw8kVyRJZ8e5pKODI6IU7g9rKo9B1ug Rcrm66K3+urS1CRYhZe4841jjpL7/PE0/IY2dLv8Pkhzagii7Mx4K54uQ/x/TKXhMpIt 23BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688977858; x=1691569858; h=mime-version:references:in-reply-to:message-id:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=U+wwP6BZLzF4aBD+iXkaOcxcJALLks32tIeZUMT3jig=; b=JhfEk0dkn/EZO7bt+N3PUBxa24dwoNHcLuthmpAOTV5Kkl8LE1WzqSDE7OvkaFfmvv EqaD2HyXzia6SWnx7KZF5y+cfTJBO1vUhk5VRBlAX8tkDHX7sMMPaJ/SLLKDsZejAWgX I4deLEJUBIySy/l0ZVe4x1sJJVheT5uVN3fIHJgb3Wil85xJeGMYs0cBk7ePcpmby8GZ 2glOB66qAm/HwxRsVjaTi6SG11Gq+gErEQT1br5iYmjUkfaYnBA3OPc39ISCV6c8hkHK dEdW+MVhdQWODpKiHi88jInVyiEnA+JmUNJ07cABXVXfJ2qPaoe6Ygmf1989/EIEdtao f2IA== X-Gm-Message-State: ABy/qLbxVG4WCp5XQ7Pr03sZwfCVLsuyvjo6aY0jmTbLqneeDyloo3WZ 92ZUvTFg9p4lyNgNMWg5J7Y= X-Received: by 2002:a2e:88cf:0:b0:2b6:a804:4cc with SMTP id a15-20020a2e88cf000000b002b6a80404ccmr8805171ljk.53.1688977857370; Mon, 10 Jul 2023 01:30:57 -0700 (PDT) Received: from eldfell ([194.136.85.206]) by smtp.gmail.com with ESMTPSA id c24-20020a05651c015800b002b6fed37b18sm1843654ljd.101.2023.07.10.01.30.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jul 2023 01:30:57 -0700 (PDT) Date: Mon, 10 Jul 2023 11:30:54 +0300 From: Pekka Paalanen To: =?UTF-8?B?QW5kcsOp?= Almeida Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, wayland-devel@lists.freedesktop.org, kernel-dev@igalia.com, alexander.deucher@amd.com, christian.koenig@amd.com, pierre-eric.pelloux-prayer@amd.com, Simon Ser , Rob Clark , Daniel Vetter , Daniel Stone , 'Marek =?UTF-8?B?T2zFocOhayc=?= , Dave Airlie , Michel =?UTF-8?B?RMOkbnplcg==?= , Randy Dunlap , hwentlan@amd.com, joshua@froggi.es, ville.syrjala@linux.intel.com Subject: Re: [PATCH v5 6/6] drm/doc: Define KMS atomic state set Message-ID: <20230710113054.316a9f31@eldfell> In-Reply-To: <20230707224059.305474-7-andrealmeid@igalia.com> References: <20230707224059.305474-1-andrealmeid@igalia.com> <20230707224059.305474-7-andrealmeid@igalia.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.37; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/_cBaQ_yD9IwDg/Rsy2Dl+2I"; protocol="application/pgp-signature"; micalg=pgp-sha256 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Sig_/_cBaQ_yD9IwDg/Rsy2Dl+2I Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Fri, 7 Jul 2023 19:40:59 -0300 Andr=C3=A9 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=C3=A9 Almeida > --- > v4: total rework by Pekka > --- > Documentation/gpu/drm-uapi.rst | 41 ++++++++++++++++++++++++++++++++++ > 1 file changed, 41 insertions(+) Thank you for polishing that email into a proper patch! For patches 1 and 2: Acked-by: Pekka Paalanen Thanks, pq > diff --git a/Documentation/gpu/drm-uapi.rst b/Documentation/gpu/drm-uapi.= rst > index 65fb3036a580..6a1662c08901 100644 > --- a/Documentation/gpu/drm-uapi.rst > +++ b/Documentation/gpu/drm-uapi.rst > @@ -486,3 +486,44 @@ and the CRTC index is its position in this array. > =20 > .. kernel-doc:: include/uapi/drm/drm_mode.h > :internal: > + > +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 automatical= ly avoid > +no-operation changes, so it is safe and even expected for userspace to s= end > +redundant property settings. No-operation changes do not count towards = actually > +needed changes, e.g. setting MODE_ID to a different blob with identical > +contents as the current KMS state shall not be a modeset on its own. > + > +A "modeset" is a change in KMS state that might enable, disable, or temp= orarily > +disrupt the emitted video signal, possibly causing visible glitches on s= creen. A > +modeset may also take considerably more time to complete than other kind= s of > +changes, and the video sink might also need time to adapt to the new sig= nal > +properties. Therefore a modeset must be explicitly allowed with the flag > +DRM_MODE_ATOMIC_ALLOW_MODESET. This in combination with > +DRM_MODE_ATOMIC_TEST_ONLY allows userspace to determine if a state chang= e is > +likely to cause visible disruption on screen and avoid such changes when= end > +users do not expect them. > + > +An atomic commit with the flag DRM_MODE_PAGE_FLIP_ASYNC is allowed to > +effectively change only the FB_ID property on any planes. No-operation c= hanges > +are ignored as always. Changing any other property will cause the commit= to be > +rejected. --Sig_/_cBaQ_yD9IwDg/Rsy2Dl+2I Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEJQjwWQChkWOYOIONI1/ltBGqqqcFAmSrwb4ACgkQI1/ltBGq qqcBAg//RoZa8NlDML/orFXTdrRJYvLDZ4R3Cek3ssDoj7yBDQy6HnXaLJwHwkf9 WhkN28UTOu00/CsmgAVT2P3Cuz5ebS7zJsLkBqS7OzLqWx+8+WodZW8BswZvRilo EhrDGDDd+/8LFd57y2XFyuIMiwfDkK3ME17zl0s0fiGXtOixe4O3Q/vHajdBTp84 JpLJ+fxnD2T4/R7mva7YxPPNbSxX/rTwkmcedf16MEfk6KX3LIVrGWQ+6jIyXMKQ ztC+R9R9SQ17WKMVck70nq82NwfF+VaFf78szBGnBkVTIn7jTRoyCPLn5mtLxzxT AS9/5y4JUbtb8d7Q/pG6eOdr25oUhJjSqhGBz83qicAn2U+dcwi9QzehyD9Kqd9S 9NUjc8WN8mZSzt+8Pef528m3Ts7JrF57HJ4BTehuFhqXl/taJSJVGF8uBj4ZHiMk JUT4d/VUfsUnfWv59S8I9AyupcpvEFQnMW7r/RGJL3M9vNV3YVo4SEAlllmtTnA0 l9Gi9o78iAc8vCdu5s+BWLyOe0rGkER1yAHJq+5LYWRpB+FWVIjcwS24JoBs9P15 6Ba2dhHeN2/mljk/QD8HQrGrvWJPj+x9jY/YyZYETnwRQaFZnCtZeldoFh2WIvZb 4YVxdUuDvOSuzYwIXWWaV+t17+iWBkk6yTyWzC1hO4vDosoMtQw= =LMkp -----END PGP SIGNATURE----- --Sig_/_cBaQ_yD9IwDg/Rsy2Dl+2I--