All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Luca Ceresoli" <luca.ceresoli@bootlin.com>
To: "Maxime Ripard" <mripard@kernel.org>,
	"Luca Ceresoli" <luca.ceresoli@bootlin.com>
Cc: "Andrzej Hajda" <andrzej.hajda@intel.com>,
	"Neil Armstrong" <neil.armstrong@linaro.org>,
	"Robert Foss" <rfoss@kernel.org>,
	"Laurent Pinchart" <Laurent.pinchart@ideasonboard.com>,
	"Jonas Karlman" <jonas@kwiboo.se>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Jessica Zhang" <jesszhan0024@gmail.com>,
	"Laurentiu Palcu" <laurentiu.palcu@oss.nxp.com>,
	"Lucas Stach" <l.stach@pengutronix.de>,
	"Frank Li" <Frank.Li@nxp.com>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	"Pengutronix Kernel Team" <kernel@pengutronix.de>,
	"Fabio Estevam" <festevam@gmail.com>,
	"Paul Cercueil" <paul@crapouillou.net>,
	"Paul Kocialkowski" <paulk@sys-base.io>,
	"Linus Walleij" <linusw@kernel.org>,
	"Inki Dae" <inki.dae@samsung.com>,
	"Jagan Teki" <jagan@amarulasolutions.com>,
	"Marek Szyprowski" <m.szyprowski@samsung.com>,
	"Sean Paul" <sean@poorly.run>, "Jonathan Corbet" <corbet@lwn.net>,
	"Shuah Khan" <skhan@linuxfoundation.org>,
	"Randy Dunlap" <rdunlap@infradead.org>,
	"Albert Esteve" <aesteve@redhat.com>,
	"Anusha Srivatsa" <asrivats@redhat.com>,
	"Dmitry Baryshkov" <dmitry.baryshkov@oss.qualcomm.com>,
	"Hui Pu" <Hui.Pu@gehealthcare.com>,
	"Ian Ray" <ian.ray@gehealthcare.com>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
	<imx@lists.linux.dev>, <linux-arm-kernel@lists.infradead.org>,
	<linux-mips@vger.kernel.org>,
	<linux-rockchip@lists.infradead.org>,
	<linux-stm32@st-md-mailman.stormreply.com>,
	<asahi@lists.linux.dev>, <linux-arm-msm@vger.kernel.org>,
	<freedreno@lists.freedesktop.org>, <linux-tegra@vger.kernel.org>,
	<linux-doc@vger.kernel.org>, <linux-samsung-soc@vger.kernel.org>
Subject: Re: [PATCH v3 12/19] drm/mcde: dsi: don't create a panel_bridge
Date: Thu, 24 Sep 2026 09:01:18 +0200	[thread overview]
Message-ID: <DLNCQEG62F5N.O98WAO4U2FJO@bootlin.com> (raw)
In-Reply-To: <arInho2bsfJiCgjV@houat>

Hi Linus, Maxime,

On Tue Sep 22, 2026 at 9:09 AM CEST, Maxime Ripard wrote:
> On Wed, Sep 16, 2026 at 03:45:36PM +0200, Luca Ceresoli wrote:
>> Now a panel_bridge is automatically created for every drm_panel and the
>> panel-bridge API is just a deprecated wrapper to access it.
>>
>> Update and simplify the code by just getting a reference to the
>> already-existing bridge using of_drm_find_and_get_bridge().
>>
>> Also keep the "connected to non-panel bridge (unsupported)\n" error logic
>> by using the drm_bridge_is_panel() function.
>>
>> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>

[...]

>> @@ -1102,40 +1100,21 @@ static int mcde_dsi_bind(struct device *dev, struct device *master,
>>
>>  	/* Look for a panel as a child to this node */
>>  	for_each_available_child_of_node_scoped(dev->of_node, child) {
>> -		panel = of_drm_find_panel(child);
>> -		if (IS_ERR(panel)) {
>> -			dev_err(dev, "failed to find panel try bridge (%ld)\n",
>> -				PTR_ERR(panel));
>> -			panel = NULL;
>> -
>> -			bridge = of_drm_find_and_get_bridge(child);
>> -			if (!bridge) {
>> -				dev_err(dev, "failed to find bridge\n");
>> -				return -EINVAL;
>> -			}
>> +		bridge = of_drm_find_and_get_bridge(child);
>> +		if (!bridge) {
>> +			dev_err(dev, "failed to find bridge\n");
>> +			return -EINVAL;
>>  		}
>>
>> -		if (panel || bridge)
>> -			break;
>> +		break;
>>  	}
>> -	if (panel) {
>> -		bridge = drm_panel_bridge_add_typed(panel,
>> -						    DRM_MODE_CONNECTOR_DSI);
>> -		drm_panel_put(panel);
>> -		if (IS_ERR(bridge)) {
>> -			dev_err(dev, "error adding panel bridge\n");
>> -			return PTR_ERR(bridge);
>> -		}
>> -		drm_bridge_get(bridge);
>> -		dev_info(dev, "connected to panel\n");
>> -		d->panel = panel;
>> -	} else if (bridge) {
>> +	if (!bridge) {
>> +		dev_err(dev, "no bridge\n");
>> +		return -ENODEV;
>> +	} else if (!drm_bridge_is_panel(bridge)) {
>>  		/* TODO: AV8100 HDMI encoder goes here for example */
>>  		dev_info(dev, "connected to non-panel bridge (unsupported)\n");
>>  		return -ENODEV;
>
> I wonder if we still need that branch. Every panel is a bridge now, and
> it looks like we don't have any specific panel handling in this driver,
> so I guess it supports bridges already?
>
> Linus, do you know why this condition was here in the first place?

I had the same thought while writing the patch, but I chose to be
conservative.

Linus, unless you have more info I'm going to apply the patch as
is. Removing this special case would be welcome as a later patch.

Luca

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

WARNING: multiple messages have this Message-ID (diff)
From: "Luca Ceresoli" <luca.ceresoli@bootlin.com>
To: "Maxime Ripard" <mripard@kernel.org>,
	"Luca Ceresoli" <luca.ceresoli@bootlin.com>
Cc: "Andrzej Hajda" <andrzej.hajda@intel.com>,
	"Neil Armstrong" <neil.armstrong@linaro.org>,
	"Robert Foss" <rfoss@kernel.org>,
	"Laurent Pinchart" <Laurent.pinchart@ideasonboard.com>,
	"Jonas Karlman" <jonas@kwiboo.se>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Jessica Zhang" <jesszhan0024@gmail.com>,
	"Laurentiu Palcu" <laurentiu.palcu@oss.nxp.com>,
	"Lucas Stach" <l.stach@pengutronix.de>,
	"Frank Li" <Frank.Li@nxp.com>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	"Pengutronix Kernel Team" <kernel@pengutronix.de>,
	"Fabio Estevam" <festevam@gmail.com>,
	"Paul Cercueil" <paul@crapouillou.net>,
	"Paul Kocialkowski" <paulk@sys-base.io>,
	"Linus Walleij" <linusw@kernel.org>,
	"Inki Dae" <inki.dae@samsung.com>,
	"Jagan Teki" <jagan@amarulasolutions.com>,
	"Marek Szyprowski" <m.szyprowski@samsung.com>,
	"Sean Paul" <sean@poorly.run>, "Jonathan Corbet" <corbet@lwn.net>,
	"Shuah Khan" <skhan@linuxfoundation.org>,
	"Randy Dunlap" <rdunlap@infradead.org>,
	"Albert Esteve" <aesteve@redhat.com>,
	"Anusha Srivatsa" <asrivats@redhat.com>,
	"Dmitry Baryshkov" <dmitry.baryshkov@oss.qualcomm.com>,
	"Hui Pu" <Hui.Pu@gehealthcare.com>,
	"Ian Ray" <ian.ray@gehealthcare.com>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
	<imx@lists.linux.dev>, <linux-arm-kernel@lists.infradead.org>,
	<linux-mips@vger.kernel.org>,
	<linux-rockchip@lists.infradead.org>,
	<linux-stm32@st-md-mailman.stormreply.com>,
	<asahi@lists.linux.dev>, <linux-arm-msm@vger.kernel.org>,
	<freedreno@lists.freedesktop.org>, <linux-tegra@vger.kernel.org>,
	<linux-doc@vger.kernel.org>, <linux-samsung-soc@vger.kernel.org>
Subject: Re: [PATCH v3 12/19] drm/mcde: dsi: don't create a panel_bridge
Date: Thu, 24 Sep 2026 09:01:18 +0200	[thread overview]
Message-ID: <DLNCQEG62F5N.O98WAO4U2FJO@bootlin.com> (raw)
In-Reply-To: <arInho2bsfJiCgjV@houat>

Hi Linus, Maxime,

On Tue Sep 22, 2026 at 9:09 AM CEST, Maxime Ripard wrote:
> On Wed, Sep 16, 2026 at 03:45:36PM +0200, Luca Ceresoli wrote:
>> Now a panel_bridge is automatically created for every drm_panel and the
>> panel-bridge API is just a deprecated wrapper to access it.
>>
>> Update and simplify the code by just getting a reference to the
>> already-existing bridge using of_drm_find_and_get_bridge().
>>
>> Also keep the "connected to non-panel bridge (unsupported)\n" error logic
>> by using the drm_bridge_is_panel() function.
>>
>> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>

[...]

>> @@ -1102,40 +1100,21 @@ static int mcde_dsi_bind(struct device *dev, struct device *master,
>>
>>  	/* Look for a panel as a child to this node */
>>  	for_each_available_child_of_node_scoped(dev->of_node, child) {
>> -		panel = of_drm_find_panel(child);
>> -		if (IS_ERR(panel)) {
>> -			dev_err(dev, "failed to find panel try bridge (%ld)\n",
>> -				PTR_ERR(panel));
>> -			panel = NULL;
>> -
>> -			bridge = of_drm_find_and_get_bridge(child);
>> -			if (!bridge) {
>> -				dev_err(dev, "failed to find bridge\n");
>> -				return -EINVAL;
>> -			}
>> +		bridge = of_drm_find_and_get_bridge(child);
>> +		if (!bridge) {
>> +			dev_err(dev, "failed to find bridge\n");
>> +			return -EINVAL;
>>  		}
>>
>> -		if (panel || bridge)
>> -			break;
>> +		break;
>>  	}
>> -	if (panel) {
>> -		bridge = drm_panel_bridge_add_typed(panel,
>> -						    DRM_MODE_CONNECTOR_DSI);
>> -		drm_panel_put(panel);
>> -		if (IS_ERR(bridge)) {
>> -			dev_err(dev, "error adding panel bridge\n");
>> -			return PTR_ERR(bridge);
>> -		}
>> -		drm_bridge_get(bridge);
>> -		dev_info(dev, "connected to panel\n");
>> -		d->panel = panel;
>> -	} else if (bridge) {
>> +	if (!bridge) {
>> +		dev_err(dev, "no bridge\n");
>> +		return -ENODEV;
>> +	} else if (!drm_bridge_is_panel(bridge)) {
>>  		/* TODO: AV8100 HDMI encoder goes here for example */
>>  		dev_info(dev, "connected to non-panel bridge (unsupported)\n");
>>  		return -ENODEV;
>
> I wonder if we still need that branch. Every panel is a bridge now, and
> it looks like we don't have any specific panel handling in this driver,
> so I guess it supports bridges already?
>
> Linus, do you know why this condition was here in the first place?

I had the same thought while writing the patch, but I chose to be
conservative.

Linus, unless you have more info I'm going to apply the patch as
is. Removing this special case would be welcome as a later patch.

Luca

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

  reply	other threads:[~2026-09-24  7:01 UTC|newest]

Thread overview: 116+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-16 13:45 [PATCH v3 00/19] drm/panel: embed a drm_bridge into every drm_panel Luca Ceresoli
2026-09-16 13:45 ` Luca Ceresoli
2026-09-16 13:45 ` [PATCH v3 01/19] drm: of: move drm_of_find_panel_or_bridge() from drm_of.c to drm_panel.c Luca Ceresoli
2026-09-16 13:45   ` Luca Ceresoli
2026-09-21 15:06   ` Maxime Ripard
2026-09-21 15:06     ` Maxime Ripard
2026-09-16 13:45 ` [PATCH v3 02/19] drm: of: remove now unnecessary forward declarations Luca Ceresoli
2026-09-16 13:45   ` Luca Ceresoli
2026-09-21 15:06   ` Maxime Ripard
2026-09-21 15:06     ` Maxime Ripard
2026-09-16 13:45 ` [PATCH v3 03/19] drm/panel: move to a new module Luca Ceresoli
2026-09-16 13:45   ` Luca Ceresoli
2026-09-16 13:45 ` [PATCH v3 04/19] drm/bridge: panel: move all code to drm_panel.c Luca Ceresoli
2026-09-16 13:45   ` Luca Ceresoli
2026-09-21 15:08   ` Maxime Ripard
2026-09-21 15:08     ` Maxime Ripard
2026-09-16 13:45 ` [PATCH v3 05/19] drm/panel: embed a drm_bridge into every drm_panel Luca Ceresoli
2026-09-16 13:45   ` Luca Ceresoli
2026-09-22  6:56   ` Maxime Ripard
2026-09-22  6:56     ` Maxime Ripard
2026-09-16 13:45 ` [PATCH v3 06/19] drm/bridge: remove devm_drm_put_bridge() Luca Ceresoli
2026-09-16 13:45   ` Luca Ceresoli
2026-09-22  6:57   ` Maxime Ripard
2026-09-22  6:57     ` Maxime Ripard
2026-09-16 13:45 ` [PATCH v3 07/19] drm/panel: deprecate panel-bridge APIs Luca Ceresoli
2026-09-16 13:45   ` Luca Ceresoli
2026-09-22  6:57   ` Maxime Ripard
2026-09-22  6:57     ` Maxime Ripard
2026-10-01  6:59   ` Linus Walleij
2026-10-01  6:59     ` Linus Walleij
2026-09-16 13:45 ` [PATCH v3 08/19] drm/todo: add entry for removing the panel_bridge API Luca Ceresoli
2026-09-16 13:45   ` Luca Ceresoli
2026-09-22  6:58   ` Maxime Ripard
2026-09-22  6:58     ` Maxime Ripard
2026-10-01  6:59   ` Linus Walleij
2026-10-01  6:59     ` Linus Walleij
2026-09-16 13:45 ` [PATCH v3 09/19] drm/bridge: tc358767: don't create a panel_bridge Luca Ceresoli
2026-09-16 13:45   ` Luca Ceresoli
2026-09-22  6:59   ` Maxime Ripard
2026-09-22  6:59     ` Maxime Ripard
2026-09-16 13:45 ` [PATCH v3 10/19] drm/bridge: waveshare-dsi: " Luca Ceresoli
2026-09-16 13:45   ` Luca Ceresoli
2026-09-22  6:59   ` Maxime Ripard
2026-09-22  6:59     ` Maxime Ripard
2026-09-16 13:45 ` [PATCH v3 11/19] drm/mcde: dsi: remove unused includes Luca Ceresoli
2026-09-16 13:45   ` Luca Ceresoli
2026-09-20 22:26   ` Linus Walleij
2026-09-20 22:26     ` Linus Walleij
2026-09-22  6:59   ` Maxime Ripard
2026-09-22  6:59     ` Maxime Ripard
2026-09-16 13:45 ` [PATCH v3 12/19] drm/mcde: dsi: don't create a panel_bridge Luca Ceresoli
2026-09-16 13:45   ` Luca Ceresoli
2026-09-20 22:26   ` Linus Walleij
2026-09-20 22:26     ` Linus Walleij
2026-09-22  7:09   ` Maxime Ripard
2026-09-22  7:09     ` Maxime Ripard
2026-09-24  7:01     ` Luca Ceresoli [this message]
2026-09-24  7:01       ` Luca Ceresoli
2026-09-24  7:51       ` Linus Walleij
2026-09-24  7:51         ` Linus Walleij
2026-09-24  8:57         ` Maxime Ripard
2026-09-24  8:57           ` Maxime Ripard
2026-09-25 16:25           ` Linus Walleij
2026-09-25 16:25             ` Linus Walleij
2026-09-25 16:33             ` Luca Ceresoli
2026-09-25 16:33               ` Luca Ceresoli
2026-09-26 15:14               ` Maxime Ripard
2026-09-26 15:14                 ` Maxime Ripard
2026-09-16 13:45 ` [PATCH v3 13/19] drm/bridge: fsl-ldb: " Luca Ceresoli
2026-09-16 13:45   ` Luca Ceresoli
2026-09-21 14:22   ` Laurentiu Palcu
2026-09-21 14:22     ` Laurentiu Palcu
2026-09-22  7:09   ` Maxime Ripard
2026-09-22  7:09     ` Maxime Ripard
2026-09-16 13:45 ` [PATCH v3 14/19] drm/bridge: samsung-dsim: " Luca Ceresoli
2026-09-16 13:45   ` Luca Ceresoli
2026-09-22  7:10   ` Maxime Ripard
2026-09-22  7:10     ` Maxime Ripard
2026-09-16 13:45 ` [PATCH v3 15/19] drm/bridge: tc358768: " Luca Ceresoli
2026-09-16 13:45   ` Luca Ceresoli
2026-09-22  7:10   ` Maxime Ripard
2026-09-22  7:10     ` Maxime Ripard
2026-09-16 13:45 ` [PATCH v3 16/19] drm/bridge: ssd2825: " Luca Ceresoli
2026-09-16 13:45   ` Luca Ceresoli
2026-09-22  7:21   ` Maxime Ripard
2026-09-22  7:21     ` Maxime Ripard
2026-09-16 13:45 ` [PATCH v3 17/19] drm/omap: dss: " Luca Ceresoli
2026-09-16 13:45   ` Luca Ceresoli
2026-09-22  7:21   ` Maxime Ripard
2026-09-22  7:21     ` Maxime Ripard
2026-09-16 13:45 ` [PATCH v3 18/19] drm/tve200: " Luca Ceresoli
2026-09-16 13:45   ` Luca Ceresoli
2026-09-17 15:14   ` Luca Ceresoli
2026-09-17 15:14     ` Luca Ceresoli
2026-09-22  7:28   ` Maxime Ripard
2026-09-22  7:28     ` Maxime Ripard
2026-10-01  7:00   ` Linus Walleij
2026-10-01  7:00     ` Linus Walleij
2026-09-16 13:45 ` [PATCH v3 19/19] drm/bridge: analogix_dp: " Luca Ceresoli
2026-09-16 13:45   ` Luca Ceresoli
2026-09-21  3:07   ` Damon Ding
2026-09-21  3:07     ` Damon Ding
2026-09-21  6:34     ` Damon Ding
2026-09-21  6:34       ` Damon Ding
2026-09-22  8:07       ` Luca Ceresoli
2026-09-22  8:07         ` Luca Ceresoli
2026-09-22  8:54         ` Damon Ding
2026-09-22  8:54           ` Damon Ding
2026-09-22  8:12     ` Luca Ceresoli
2026-09-22  8:12       ` Luca Ceresoli
2026-09-22  8:22       ` Heiko Stuebner
2026-09-22  8:22         ` Heiko Stuebner
2026-09-22  8:57         ` Damon Ding
2026-09-22  8:57           ` Damon Ding
2026-09-28  8:48 ` [PATCH v3 00/19] drm/panel: embed a drm_bridge into every drm_panel Luca Ceresoli
2026-09-28  8:48   ` Luca Ceresoli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DLNCQEG62F5N.O98WAO4U2FJO@bootlin.com \
    --to=luca.ceresoli@bootlin.com \
    --cc=Frank.Li@nxp.com \
    --cc=Hui.Pu@gehealthcare.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=aesteve@redhat.com \
    --cc=airlied@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=asahi@lists.linux.dev \
    --cc=asrivats@redhat.com \
    --cc=corbet@lwn.net \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=festevam@gmail.com \
    --cc=freedreno@lists.freedesktop.org \
    --cc=ian.ray@gehealthcare.com \
    --cc=imx@lists.linux.dev \
    --cc=inki.dae@samsung.com \
    --cc=jagan@amarulasolutions.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=jesszhan0024@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=kernel@pengutronix.de \
    --cc=l.stach@pengutronix.de \
    --cc=laurentiu.palcu@oss.nxp.com \
    --cc=linusw@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=linux-tegra@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=paul@crapouillou.net \
    --cc=paulk@sys-base.io \
    --cc=rdunlap@infradead.org \
    --cc=rfoss@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=sean@poorly.run \
    --cc=simona@ffwll.ch \
    --cc=skhan@linuxfoundation.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.