Hi Maxime,

Thank you for the patch.

On Thu, May 20, 2021 at 04:24:35PM +0200, Maxime Ripard wrote:
> 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.
> 
> Let's document what we expect.
> 
> Cc: Alexandre Belloni <alexandre.bell...@bootlin.com>
> Cc: Alexandre Torgue <alexandre.tor...@foss.st.com>
> Cc: Alex Deucher <alexander.deuc...@amd.com>
> Cc: Alison Wang <alison.w...@nxp.com>
> Cc: Alyssa Rosenzweig <alyssa.rosenzw...@collabora.com>
> Cc: Andrew Jeffery <and...@aj.id.au>
> Cc: Andrzej Hajda <a.ha...@samsung.com>
> Cc: Anitha Chrisanthus <anitha.chrisant...@intel.com>
> Cc: Benjamin Gaignard <benjamin.gaign...@linaro.org>
> Cc: Ben Skeggs <bske...@redhat.com>
> Cc: Boris Brezillon <bbrezil...@kernel.org>
> Cc: Brian Starkey <brian.star...@arm.com>
> Cc: Chen Feng <puck.c...@hisilicon.com>
> Cc: Chen-Yu Tsai <w...@csie.org>
> Cc: Christian Gmeiner <christian.gmei...@gmail.com>
> Cc: "Christian König" <christian.koe...@amd.com>
> Cc: Chun-Kuang Hu <chunkuang...@kernel.org>
> Cc: Edmund Dea <edmund.j....@intel.com>
> Cc: Eric Anholt <e...@anholt.net>
> Cc: Fabio Estevam <feste...@gmail.com>
> Cc: Gerd Hoffmann <kra...@redhat.com>
> Cc: Haneen Mohammed <hamohammed...@gmail.com>
> Cc: Hans de Goede <hdego...@redhat.com>
> Cc: "Heiko Stübner" <he...@sntech.de>
> Cc: Huang Rui <ray.hu...@amd.com>
> Cc: Hyun Kwon <hyun.k...@xilinx.com>
> Cc: Inki Dae <inki....@samsung.com>
> Cc: Jani Nikula <jani.nik...@linux.intel.com>
> Cc: Jernej Skrabec <jernej.skra...@siol.net>
> Cc: Jerome Brunet <jbru...@baylibre.com>
> Cc: Joel Stanley <j...@jms.id.au>
> Cc: John Stultz <john.stu...@linaro.org>
> Cc: Jonas Karlman <jo...@kwiboo.se>
> Cc: Jonathan Hunter <jonath...@nvidia.com>
> Cc: Joonas Lahtinen <joonas.lahti...@linux.intel.com>
> Cc: Joonyoung Shim <jy0922.s...@samsung.com>
> Cc: Jyri Sarha <jyri.sa...@iki.fi>
> Cc: Kevin Hilman <khil...@baylibre.com>
> Cc: Kieran Bingham <kieran.bingham+rene...@ideasonboard.com>
> Cc: Krzysztof Kozlowski <krzysztof.kozlow...@canonical.com>
> Cc: Kyungmin Park <kyungmin.p...@samsung.com>
> Cc: Laurent Pinchart <laurent.pinch...@ideasonboard.com>
> Cc: Linus Walleij <linus.wall...@linaro.org>
> Cc: Liviu Dudau <liviu.du...@arm.com>
> Cc: Lucas Stach <l.st...@pengutronix.de>
> Cc: Ludovic Desroches <ludovic.desroc...@microchip.com>
> Cc: Marek Vasut <ma...@denx.de>
> Cc: Martin Blumenstingl <martin.blumensti...@googlemail.com>
> Cc: Matthias Brugger <matthias....@gmail.com>
> Cc: Maxime Coquelin <mcoquelin.st...@gmail.com>
> Cc: Maxime Ripard <mrip...@kernel.org>
> Cc: Melissa Wen <melissa....@gmail.com>
> Cc: Neil Armstrong <narmstr...@baylibre.com>
> Cc: Nicolas Ferre <nicolas.fe...@microchip.com>
> Cc: "Noralf Trønnes" <nor...@tronnes.org>
> Cc: NXP Linux Team <linux-...@nxp.com>
> Cc: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com>
> Cc: Patrik Jakobsson <patrik.r.jakobs...@gmail.com>
> Cc: Paul Cercueil <p...@crapouillou.net>
> Cc: Pengutronix Kernel Team <ker...@pengutronix.de>
> Cc: Philippe Cornu <philippe.co...@foss.st.com>
> Cc: Philipp Zabel <p.za...@pengutronix.de>
> Cc: Qiang Yu <yuq...@gmail.com>
> Cc: Rob Clark <robdcl...@gmail.com>
> Cc: Robert Foss <robert.f...@linaro.org>
> Cc: Rob Herring <r...@kernel.org>
> Cc: Rodrigo Siqueira <rodrigosiqueiram...@gmail.com>
> Cc: Rodrigo Vivi <rodrigo.v...@intel.com>
> Cc: Roland Scheidegger <srol...@vmware.com>
> Cc: Russell King <li...@armlinux.org.uk>
> Cc: Sam Ravnborg <s...@ravnborg.org>
> Cc: Sandy Huang <h...@rock-chips.com>
> Cc: Sascha Hauer <s.ha...@pengutronix.de>
> Cc: Sean Paul <s...@poorly.run>
> Cc: Seung-Woo Kim <sw0312....@samsung.com>
> Cc: Shawn Guo <shawn...@kernel.org>
> Cc: Stefan Agner <ste...@agner.ch>
> Cc: Steven Price <steven.pr...@arm.com>
> Cc: Sumit Semwal <sumit.sem...@linaro.org>
> Cc: Thierry Reding <thierry.red...@gmail.com>
> Cc: Tian Tao <tiant...@hisilicon.com>
> Cc: Tomeu Vizoso <tomeu.viz...@collabora.com>
> Cc: Tomi Valkeinen <to...@kernel.org>
> Cc: VMware Graphics <linux-graphics-maintai...@vmware.com>
> Cc: Xinliang Liu <xinliang....@linaro.org>
> Cc: Xinwei Kong <kong.kongxin...@hisilicon.com>
> Cc: Yannick Fertre <yannick.fer...@foss.st.com>
> Cc: Zack Rusin <za...@vmware.com>
> Reviewed-by: Daniel Vetter <daniel.vet...@ffwll.ch>
> Signed-off-by: Maxime Ripard <max...@cerno.tech>
> 
> ---
> 
> Changes from v2:
>   - Typos and wording reported by Daniel and Alex
> ---
>  Documentation/gpu/drm-kms.rst | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> 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 
> developers.
>  For the driver APIs, see the other sections.
>  
> +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

s/need/needs/

> +requirements, in addition to the one mentioned above.:

s/above./above/

> +
> +- It must be standardized, with some documentation to describe how the
> +  property can be used.
> +
> +- 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 want to
> +  precompute, like :c:type:`struct drm_clip_rect <drm_clip_rect>` for planes.

Does this effectively mean that we completely forbid driver-specific
properties ? While I agree that we should strive for standardization,
there are two issues that worry me. The first one is simple, we may need
to control features that would be very device-specific, and
standardizing properties doesn't seem to make much sense in that case.

The second issue relates to properties that could be applicable to
multiple devices, but for which we have a single driver. Designing a
standard with a single data point usually leads to a bad design. I'm not
sure how to handle this correctly though, as we certainly don't want
this to be taken as an excuse to create driver-specific properties when
generic properties would make sense.

> +- An IGT test must be submitted where reasonable.
> +
>  Property Types and Blob Property Support
>  ----------------------------------------
>  

-- 
Regards,

Laurent Pinchart

Reply via email to