[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DFSVNE16870S.ABQUMH9BWMDY@bootlin.com>
Date: Mon, 19 Jan 2026 22:18:12 +0100
From: "Luca Ceresoli" <luca.ceresoli@...tlin.com>
To: "Kory Maincent (TI.com)" <kory.maincent@...tlin.com>, "Jyri Sarha"
<jyri.sarha@....fi>, "Tomi Valkeinen" <tomi.valkeinen@...asonboard.com>,
"Maarten Lankhorst" <maarten.lankhorst@...ux.intel.com>, "Maxime Ripard"
<mripard@...nel.org>, "Thomas Zimmermann" <tzimmermann@...e.de>, "David
Airlie" <airlied@...il.com>, "Simona Vetter" <simona@...ll.ch>, "Rob
Herring" <robh@...nel.org>, "Krzysztof Kozlowski" <krzk+dt@...nel.org>,
"Conor Dooley" <conor+dt@...nel.org>, "Russell King"
<linux@...linux.org.uk>, "Bartosz Golaszewski" <brgl@...ev.pl>, "Tony
Lindgren" <tony@...mide.com>, "Andrzej Hajda" <andrzej.hajda@...el.com>,
"Neil Armstrong" <neil.armstrong@...aro.org>, "Robert Foss"
<rfoss@...nel.org>, "Laurent Pinchart" <Laurent.pinchart@...asonboard.com>,
"Jonas Karlman" <jonas@...boo.se>, "Jernej Skrabec"
<jernej.skrabec@...il.com>
Cc: "Markus Schneider-Pargmann" <msp@...libre.com>, "Bajjuri Praneeth"
<praneeth@...com>, "Louis Chauvet" <louis.chauvet@...tlin.com>, "Thomas
Petazzoni" <thomas.petazzoni@...tlin.com>, "Miguel Gazquez"
<miguel.gazquez@...tlin.com>, "Herve Codina" <herve.codina@...tlin.com>,
<dri-devel@...ts.freedesktop.org>, <devicetree@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <linux-arm-kernel@...ts.infradead.org>,
<linux-omap@...r.kernel.org>
Subject: Re: [PATCH v4 20/25] drm/tilcdc: Use devm_drm_of_get_bridge()
helper
Hi Köry, Maxime,
Maxime, I'd appreciate your opinion about the topic below.
On Fri Jan 16, 2026 at 6:02 PM CET, Kory Maincent (TI.com) wrote:
> Replace drm_of_find_panel_or_bridge() with the newer
> devm_drm_of_get_bridge() helper which simplifies the code by:
> - Automatically handling both panel and bridge cases internally
> - Managing the panel-to-bridge conversion when needed
> - Using devres for resource management, eliminating manual cleanup
>
> This removes the need for explicit panel-to-bridge conversion via
> devm_drm_panel_bridge_add_typed() and the associated error handling path.
>
> Signed-off-by: Kory Maincent (TI.com) <kory.maincent@...tlin.com>
> ---
>
> Change in v4:
> - New patch
> ---
> drivers/gpu/drm/tilcdc/tilcdc_encoder.c | 18 ++++--------------
> 1 file changed, 4 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_encoder.c b/drivers/gpu/drm/tilcdc/tilcdc_encoder.c
> index a34a10337f6a8..546fe7e6ee815 100644
> --- a/drivers/gpu/drm/tilcdc/tilcdc_encoder.c
> +++ b/drivers/gpu/drm/tilcdc/tilcdc_encoder.c
> @@ -55,15 +55,12 @@ int tilcdc_encoder_create(struct drm_device *ddev)
> struct tilcdc_drm_private *priv = ddev_to_tilcdc_priv(ddev);
> struct tilcdc_encoder *encoder;
> struct drm_bridge *bridge;
> - struct drm_panel *panel;
> - int ret;
>
> - ret = drm_of_find_panel_or_bridge(ddev->dev->of_node, 0, 0,
> - &panel, &bridge);
> - if (ret == -ENODEV)
> + bridge = devm_drm_of_get_bridge(ddev->dev, ddev->dev->of_node, 0, 0);
> + if (PTR_ERR(bridge) == -ENODEV)
This patch is technically OK in the sense that the code before and after
would be equivalent. However if it were me I would not do this change. The
reason is that both drm_of_find_panel_or_bridge() and *_of_get_bridge() are
problematic when introducing drm_bridge hotplug, which is the long-term
goal I am working for, but *_of_get_bridge() is more problematic than
drm_of_find_panel_or_bridge().
These functions are still there and not deprecated because there is
currently no better replacement (and drm_bridge hotplug is not yet
supported because of this and other things still to be done). To have a
replacement, the panel_bridge lifetime needs to be reworked first and
that's not going to happen overnight. So, all in all, if this patch is not
crucial to your series I'd consider dropping it. But if it is important I'm
fine with applying it, it won't make a huge difference.
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Powered by blists - more mailing lists