[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <DG269FV5MZ8I.2VFNJXA0N2Y26@bootlin.com>
Date: Fri, 30 Jan 2026 20:31:11 +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 v5 20/25] drm/tilcdc: Use devm_drm_of_get_bridge()
helper
Hi Kory,
On Fri Jan 23, 2026 at 5:12 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>
I'm OK with this patch, based on the v4 discussion. I have a question
however, see below.
> --- 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)
> return 0;
> - else if (ret)
> - return ret;
> + else if (IS_ERR(bridge))
> + return PTR_ERR(bridge);
>
> encoder = drmm_simple_encoder_alloc(ddev, struct tilcdc_encoder,
> base, DRM_MODE_ENCODER_NONE);
> @@ -73,12 +70,5 @@ int tilcdc_encoder_create(struct drm_device *ddev)
> }
> priv->encoder = encoder;
>
> - if (panel) {
> - bridge = devm_drm_panel_bridge_add_typed(ddev->dev, panel,
> - DRM_MODE_CONNECTOR_DPI);
You are introducing a subtle difference here: while you pass the connector
type to devm_drm_panel_bridge_add_typed(), devm_drm_of_get_bridge() does
not take it and expects it to ahve been set previously and errors out if it
hasn't.
Can you ensure the connector type is alway set before this
devm_drm_of_get_bridge() call?
All the changes to the driver in the previous patches of this series make
it hard to find that out from here.
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Powered by blists - more mailing lists