From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1CEF9C07E96 for ; Tue, 6 Jul 2021 08:52:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EF5E761995 for ; Tue, 6 Jul 2021 08:52:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230343AbhGFIyv (ORCPT ); Tue, 6 Jul 2021 04:54:51 -0400 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:50177 "EHLO new1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230295AbhGFIyu (ORCPT ); Tue, 6 Jul 2021 04:54:50 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 19983580670; Tue, 6 Jul 2021 04:52:12 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 06 Jul 2021 04:52:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=xb1ShrMpK8ostpGwMFZCsoZYETx HiphoxAX6Pb3wC5k=; b=ZCV9iuaTvRyGFKWCMmtOelU+0kN6oMjQWnrxYPOn9i4 RnwWxv9mEXtN+0RJu18PNOBzJgVvzoBeWNwM9jMNRCjLRr8INbHTSt6opquohGIl 5oBW/Hn42adUViFWQij+8AIFNLcs7HTMJjjxlymaKh0Bsv9OCL0z6djxAte4inHe +t99cn/L/XCmrl62a9umObf6+07FqOhaChCDgcBR9MNQGBwUo5DYMIOF8ogjlbyJ 8Wtyq2kEK5HcEw0u8/EFTrNeq2c1NPcrIxsR29QJU9h8wX0f1KXzX9x6CiSE2JNz 4h1G1VOFatfKkI5bc5WsxFflYQJUn7nOJf4uARLoxOw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=xb1Shr MpK8ostpGwMFZCsoZYETxHiphoxAX6Pb3wC5k=; b=gUTumXogpffvEC9hNM2J6U BrjncaXbkURl4CGhFCpJpCodRU5Vd8hUraRWgIA/Uy3Y3VqsIL8swZjRHMFbHN+l Jp2k0AyhghnEA7ipboW5OJ3I0Cuo6BkUZ+2pOe535Rii5MSA9ab8U4j3ptT2Oe+f /TLgYXEiwbGGaPkRwboljNoaJXFBFNM9383aB/g9l+5QUsecwe87EHjGqo/WWPwS PVRow+Y2N8HcKw7OqH4V356Uts9Ky6ueym8qyVz3daR/59mSRDN1msUC+C1M/MUw nk3FUK/oMMRhRwlnd1EpuqOjtkNSAMoPOafrYbKe4cJoofrW00FPF1eUqCLC4Igg == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfeejiedgtdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddunecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepuddvudfhkeekhefgffetffelgffftdehffduffegveetffehueeivddvjedv gfevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmh grgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 6 Jul 2021 04:52:03 -0400 (EDT) Date: Tue, 6 Jul 2021 10:52:02 +0200 From: Maxime Ripard To: Pekka Paalanen Cc: dri-devel@lists.freedesktop.org, Daniel Vetter , David Airlie , Maarten Lankhorst , Thomas Zimmermann , Xinliang Liu , Anitha Chrisanthus , Jonathan Hunter , Jerome Brunet , Kevin Hilman , Ludovic Desroches , NXP Linux Team , Sascha Hauer , Roland Scheidegger , Sean Paul , Hyun Kwon , Andrew Jeffery , Seung-Woo Kim , Noralf =?utf-8?Q?Tr=C3=B8nnes?= , Pengutronix Kernel Team , Alex Deucher , Laurent Pinchart , Alexandre Belloni , linux-doc@vger.kernel.org, Edmund Dea , Eric Anholt , Thierry Reding , Krzysztof Kozlowski , Steven Price , VMware Graphics , Ben Skeggs , Martin Blumenstingl , Rodrigo Siqueira , Boris Brezillon , Sandy Huang , Kyungmin Park , Maxime Coquelin , Haneen Mohammed , Neil Armstrong , Melissa Wen , Gerd Hoffmann , Benjamin Gaignard , Sam Ravnborg , Jonathan Corbet , Xinwei Kong , Chen-Yu Tsai , Joel Stanley , Alyssa Rosenzweig , Chun-Kuang Hu , Jonas Karlman , Chen Feng , Alison Wang , Rodrigo Vivi , Tomeu Vizoso , Tomi Valkeinen , Kieran Bingham , Tian Tao , Shawn Guo , Christian =?utf-8?B?S8O2bmln?= , Daniel Vetter , Liviu Dudau , Alexandre Torgue , Paul Cercueil , Andrzej Hajda , Huang Rui , Marek Vasut , Joonyoung Shim , Oleksandr Andrushchenko , Russell King , Philippe Cornu , Hans de Goede , Matthias Brugger , Jernej Skrabec , Pekka Paalanen , Yannick Fertre , Nicolas Ferre , Robert Foss , Rob Clark , Qiang Yu , Jyri Sarha Subject: Re: [PATCH v4] Documentation: gpu: Mention the requirements for new properties Message-ID: <20210706085202.6o4fapfmq7osj5wf@gilmour> References: <20210616143842.632829-1-maxime@cerno.tech> <20210617112036.7373fdab@eldfell> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="rwvg6s6irn2y2r5k" Content-Disposition: inline In-Reply-To: <20210617112036.7373fdab@eldfell> Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org --rwvg6s6irn2y2r5k Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Pekka, On Thu, Jun 17, 2021 at 11:20:36AM +0300, Pekka Paalanen wrote: > On Wed, 16 Jun 2021 16:38:42 +0200 > Maxime Ripard wrote: >=20 > > New KMS properties come with a bunch of requirements to avoid each > > driver from running their own, inconsistent, set of properties, > > eventually leading to issues like property conflicts, inconsistencies > > between drivers and semantics, etc. > >=20 > > Let's document what we expect. > >=20 > > Cc: Alexandre Belloni > > Cc: Alexandre Torgue > > Cc: Alex Deucher > > Cc: Alison Wang > > Cc: Alyssa Rosenzweig > > Cc: Andrew Jeffery > > Cc: Andrzej Hajda > > Cc: Anitha Chrisanthus > > Cc: Benjamin Gaignard > > Cc: Ben Skeggs > > Cc: Boris Brezillon > > Cc: Brian Starkey > > Cc: Chen Feng > > Cc: Chen-Yu Tsai > > Cc: Christian Gmeiner > > Cc: "Christian K=F6nig" > > Cc: Chun-Kuang Hu > > Cc: Edmund Dea > > Cc: Eric Anholt > > Cc: Fabio Estevam > > Cc: Gerd Hoffmann > > Cc: Haneen Mohammed > > Cc: Hans de Goede > > Cc: "Heiko St=FCbner" > > Cc: Huang Rui > > Cc: Hyun Kwon > > Cc: Inki Dae > > Cc: Jani Nikula > > Cc: Jernej Skrabec > > Cc: Jerome Brunet > > Cc: Joel Stanley > > Cc: John Stultz > > Cc: Jonas Karlman > > Cc: Jonathan Hunter > > Cc: Joonas Lahtinen > > Cc: Joonyoung Shim > > Cc: Jyri Sarha > > Cc: Kevin Hilman > > Cc: Kieran Bingham > > Cc: Krzysztof Kozlowski > > Cc: Kyungmin Park > > Cc: Laurent Pinchart > > Cc: Linus Walleij > > Cc: Liviu Dudau > > Cc: Lucas Stach > > Cc: Ludovic Desroches > > Cc: Marek Vasut > > Cc: Martin Blumenstingl > > Cc: Matthias Brugger > > Cc: Maxime Coquelin > > Cc: Maxime Ripard > > Cc: Melissa Wen > > Cc: Neil Armstrong > > Cc: Nicolas Ferre > > Cc: "Noralf Tr=F8nnes" > > Cc: NXP Linux Team > > Cc: Oleksandr Andrushchenko > > Cc: Patrik Jakobsson > > Cc: Paul Cercueil > > Cc: Pekka Paalanen > > Cc: Pengutronix Kernel Team > > Cc: Philippe Cornu > > Cc: Philipp Zabel > > Cc: Qiang Yu > > Cc: Rob Clark > > Cc: Robert Foss > > Cc: Rob Herring > > Cc: Rodrigo Siqueira > > Cc: Rodrigo Vivi > > Cc: Roland Scheidegger > > Cc: Russell King > > Cc: Sam Ravnborg > > Cc: Sandy Huang > > Cc: Sascha Hauer > > Cc: Sean Paul > > Cc: Seung-Woo Kim > > Cc: Shawn Guo > > Cc: Simon Ser > > Cc: Stefan Agner > > Cc: Steven Price > > Cc: Sumit Semwal > > Cc: Thierry Reding > > Cc: Tian Tao > > Cc: Tomeu Vizoso > > Cc: Tomi Valkeinen > > Cc: VMware Graphics > > Cc: Xinliang Liu > > Cc: Xinwei Kong > > Cc: Yannick Fertre > > Cc: Zack Rusin > > Reviewed-by: Daniel Vetter > > Signed-off-by: Maxime Ripard > >=20 > > --- > >=20 > > Changes from v3: > > - Roll back to the v2 > > - Add Simon and Pekka in Cc > >=20 > > Changes from v2: > > - Take into account the feedback from Laurent and Lidiu to no longer > > force generic properties, but prefix vendor-specific properties with > > the vendor name > >=20 > > Changes from v1: > > - Typos and wording reported by Daniel and Alex > > --- > > Documentation/gpu/drm-kms.rst | 19 +++++++++++++++++++ > > 1 file changed, 19 insertions(+) > >=20 > > diff --git a/Documentation/gpu/drm-kms.rst b/Documentation/gpu/drm-kms.= rst > > index 87e5023e3f55..c28b464dd397 100644 > > --- a/Documentation/gpu/drm-kms.rst > > +++ b/Documentation/gpu/drm-kms.rst > > @@ -463,6 +463,25 @@ KMS Properties > > This section of the documentation is primarily aimed at user-space dev= elopers. > > For the driver APIs, see the other sections. > > =20 > > +Requirements > > +------------ > > + > > +KMS drivers might need to add extra properties to support new features. > > +Each new property introduced in a driver need to meet a few > > +requirements, in addition to the one mentioned above.: > > + > > +- It must be standardized, with some documentation to describe how the > > + property can be used. >=20 > Hi, >=20 > I might replace "some" with "full" documentation. Also not only how it > can be used but also what it does. >=20 > FYI, some common things that tend to be forgotten IME: > - Spell out exactly the name string for the property in the > documentation so that it is unambiguous what string userspace should > look for. > - The same for string names of enum values. > - Explicitly document what each enum value means, do not trust that the > value name describes it well enough. > - Explain how the property interacts with other, existing properties. >=20 > Not sure if these should be written down here or anywhere though. > Interaction with other properties is kind of important. >=20 > > + > > +- It must provide a generic helper in the core code to register that > > + property on the object it attaches to. > > + > > +- Its content must be decoded by the core and provided in the object's > > + associated state structure. That includes anything drivers might wan= t to > > + precompute, like :c:type:`struct drm_clip_rect ` for = planes. > > + > > +- An IGT test must be submitted where reasonable. >=20 > Would it be too much to replace "where reasonable" with "if it is at > all possible to write a test."? >=20 > > + >=20 > How about adding the following somewhere? >=20 > - The initial state of the property (set during driver initialization) > must match how the driver+hardware behaved before introducing this > property. It may be some fixed value or it may be inherited from e.g. > the firmware that booted the system. How the initial state is > determined must also be documented, that is, where does it come from. >=20 > The initial state must not be called "default", because I want to > reserve the term default for something else if possible: the phrase > "reset everything to defaults", which is a whole another discussion. I've taken into account your previous comments, thanks > How about also saying that fbcon/fbdev must set this property when > taking over? That sounds to be like a common omission leading to funky > KMS state in fbcon. The value fbdev sets it to only needs to make > sense to fbdev, and it does not need to be ~~the initial value~~ nor the > default value. Or are we hoping to kill fbcon in favor of a userspace > kmscon soon? ;-) >=20 > Ooh, maybe the KMS property documentation should also say what value > fbdev will set the property to. That's kind of UABI, because userspace > probably implicitly relies on it in many cases. ...which means fbdev > should set the property to its initial value, otherwise userspace will > break. I'm not sure about this one: fbdev and fbcon are still optional features of the kernel and can be disabled at the user discretion. Having any part of the user-space rely on the fbdev behavior seems a bit broken, especially when we have a mechanism to retrieve the state when the application starts. Maxime --rwvg6s6irn2y2r5k Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYOQZsQAKCRDj7w1vZxhR xcAOAQDgiPmqHT2po3pKn0nOdvI8OHOSf965Rdk+pXb4g0/FYAD/QiqJF39WtEjQ HH/6r47VwthjKZxzENH4ZoYQwPDddQo= =GIQI -----END PGP SIGNATURE----- --rwvg6s6irn2y2r5k--