public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: "Luca Ceresoli" <luca.ceresoli@bootlin.com>
To: "Liu Ying" <victor.liu@nxp.com>, "Marek Vasut" <marex@denx.de>,
	"Stefan Agner" <stefan@agner.ch>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>, "Frank Li" <Frank.Li@nxp.com>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	"Pengutronix Kernel Team" <kernel@pengutronix.de>,
	"Fabio Estevam" <festevam@gmail.com>,
	"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>,
	"Rob Herring" <robh@kernel.org>,
	"Saravana Kannan" <saravanak@kernel.org>
Cc: "Damon Ding" <damon.ding@rock-chips.com>,
	"Kory Maincent (TI.com)" <kory.maincent@bootlin.com>,
	"Hervé Codina" <herve.codina@bootlin.com>,
	"Hui Pu" <Hui.Pu@gehealthcare.com>,
	"Ian Ray" <ian.ray@gehealthcare.com>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	dri-devel@lists.freedesktop.org, imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	"Adam Ford" <aford173@gmail.com>,
	"Alexander Stein" <alexander.stein@ew.tq-group.com>,
	"Christopher Obbard" <christopher.obbard@linaro.org>,
	"Daniel Scally" <dan.scally@ideasonboard.com>,
	"Emanuele Ghidoli" <emanuele.ghidoli@toradex.com>,
	"Fabio Estevam" <festevam@denx.de>,
	"Francesco Dolcini" <francesco.dolcini@toradex.com>,
	"Frieder Schrempf" <frieder.schrempf@kontron.de>,
	"Gilles Talis" <gilles.talis@gmail.com>,
	"Goran Rađenović" <goran.radni@gmail.com>,
	"Heiko Schocher" <hs@denx.de>,
	"Josua Mayer" <josua@solid-run.com>,
	"Kieran Bingham" <kieran.bingham@ideasonboard.com>,
	"Marco Felsch" <m.felsch@pengutronix.de>,
	"Martyn Welch" <martyn.welch@collabora.com>,
	"Oleksij Rempel" <o.rempel@pengutronix.de>,
	"Peng Fan" <peng.fan@nxp.com>,
	"Richard Hu" <richard.hu@technexion.com>,
	"Shengjiu Wang" <shengjiu.wang@nxp.com>,
	"Stefan Eichenberger" <stefan.eichenberger@toradex.com>,
	"Vitor Soares" <vitor.soares@toradex.com>
Subject: Re: [PATCH v2 10/10] drm/mxsfb/lcdif: use DRM_BRIDGE_ATTACH_NO_CONNECTOR and the bridge-connector
Date: Thu, 02 Apr 2026 10:28:45 +0200	[thread overview]
Message-ID: <DHIJ00VZ2O0H.1550LBTEFNT83@bootlin.com> (raw)
In-Reply-To: <1a8b1a34-89bd-436e-8b5c-64ea71e8f333@nxp.com>

Hello Liu,

On Thu Apr 2, 2026 at 6:55 AM CEST, Liu Ying wrote:
> Hi Luca,
>
> On Mon, Mar 30, 2026 at 09:25:51PM +0200, Luca Ceresoli wrote:
>> Convert this driver to DRM_BRIDGE_ATTACH_NO_CONNECTOR and to the
>> drm_bridge_connector framework which is the current DRM bridge best
>> practice.
>>
>> Tested-by: Martyn Welch <martyn.welch@collabora.com>
>> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> # TQMa8MPxL/MBa8MPxL
>> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>

>> @@ -86,11 +88,23 @@ static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif)
>>  					     "Failed to initialize encoder for endpoint%u\n",
>>  					     of_ep.id);
>>
>> -		ret = drm_bridge_attach(encoder, bridge, NULL, 0);
>> +		ret = drm_bridge_attach(encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR);
>
> It seems that only analogix-anx6345.c, analogix-anx78xx.c and analogix_dp_core.c
> don't allow DRM_BRIDGE_ATTACH_NO_CONNECTOR, since they error out when attaching
> the bridge with the flag:
>
> if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
>          DRM_ERROR("Fix bridge driver to make connector optional!");
>          return -EINVAL;
> }
>
> Looks like i.MX8MP platforms don't use these drivers.

Exactly. I have checked all the drivers involved with the i.MX8MP and all
of the support DRM_BRIDGE_ATTACH_NO_CONNECTOR.

While converting all drivers is surely a good goal, converting all of them
at once is not realistically doable. So the approach I took was to convert
one specifically (lcdif_drv.c) plus all those which would break because
they are used with the LCDIF.

> But, are we completely safe here by adding the flag?  You also mentioned
> "pitfalls" in commit mesg, which makes me a bit more worried.

I mentioned potential pitfalls in the cover letter mainly because of the DT
overlay insertion patch, which is somewhat tricky as it impacts many
boards.

Additionally it's not easy to spot all usages of this component by parsing
dozens of dts files, so I might have missed some.

So overall every patch sent has a potential for pitfalls, but for the
reasons above I think this series has a bit more.

Does this reassure you? :)

>>  		if (ret)
>>  			return dev_err_probe(dev, ret,
>>  					     "Failed to attach bridge for endpoint%u\n",
>>  					     of_ep.id);
>> +
>> +		connector = drm_bridge_connector_init(lcdif->drm, encoder);
>
> Also, kernel doc of drm_bridge_connector.c says:
>
>  * To make use of this helper, all bridges in the chain shall report bridge
>  * operation flags (&drm_bridge->ops) and bridge output type
>  * (&drm_bridge->type), as well as the DRM_BRIDGE_ATTACH_NO_CONNECTOR attach
>  * flag (none of the bridges shall create a DRM connector directly).
>
> Are you sure that we are safe to use this helper?

Yes. I have checked all in-tree dts[i] files for all the 3 LCDIFs.

For the LCDIF3, the pipeline is:

  LCDIF3 -> fsl,imx8mp-hdmi-pvi -> fsl,imx8mp-hdmi-tx -> HDMI connector

And the involved bridges are:

 * fsl,imx8mp-hdmi-pvi has ops = 0 (it doesn't set it) because it
   implements none the optional features mentioned by those flags, and it
   honors the DRM_BRIDGE_ATTACH_NO_CONNECTOR by propagating it

 * fsl,imx8mp-hdmi-tx is implemented based on dw-hdmi, which sets ops as
   appropriate and also propagates the DRM_BRIDGE_ATTACH_NO_CONNECTOR flag

 * display-connector (enabled via the DT overlay if needed) sets ops and
   makes DRM_BRIDGE_ATTACH_NO_CONNECTOR mandatory

The LCDIF2 involves the panel-bridge, display-connector and lvds-decoder
which also set ops as needed and propagate DRM_BRIDGE_ATTACH_NO_CONNECTOR
or make it mandatory.

The same applies to the drivers used with the LCDIF1: adv7511, tc358767 and
the panel bridge.

I assume this answers your doubts. Let me know if it doesn't.

Luca

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

  parent reply	other threads:[~2026-04-02  8:29 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-30 19:25 [PATCH v2 00/10] drm/mxsfb/lcdif: use DRM_BRIDGE_ATTACH_NO_CONNECTOR and the bridge-connector Luca Ceresoli
2026-03-30 19:25 ` [PATCH v2 01/10] drm/mxsfb/lcdif: simplify remote pointer management using __free Luca Ceresoli
2026-03-30 19:25 ` [PATCH v2 02/10] drm/mxsfb/lcdif: simplify ep " Luca Ceresoli
2026-04-02  3:50   ` Liu Ying
2026-03-30 19:25 ` [PATCH v2 03/10] drm/mxsfb/lcdif: use dev_err_probe() consistently in lcdif_attach_bridge Luca Ceresoli
2026-04-02  3:52   ` Liu Ying
2026-03-30 19:25 ` [PATCH v2 04/10] drm/mxsfb/lcdif: lcdif_attach_bridge: move iteration-specific variables declaration inside loop Luca Ceresoli
2026-04-02  3:57   ` Liu Ying
2026-03-30 19:25 ` [PATCH v2 05/10] drm/bridge: dw-hdmi: document the output_port field Luca Ceresoli
2026-03-31  7:21   ` Damon Ding
2026-04-02  7:46     ` Luca Ceresoli
2026-04-02  9:05       ` Damon Ding
2026-03-30 19:25 ` [PATCH v2 06/10] drm/bridge: dw-hdmi: warn on unsupported attach combination Luca Ceresoli
2026-03-31  7:25   ` Damon Ding
2026-04-02  9:14   ` Damon Ding
2026-04-02  9:57     ` Luca Ceresoli
2026-03-30 19:25 ` [PATCH v2 07/10] drm/bridge: dw-hdmi: move next_bridge lookup to attach time Luca Ceresoli
2026-03-31  7:24   ` Damon Ding
2026-04-02  3:59   ` Liu Ying
2026-03-30 19:25 ` [PATCH v2 08/10] drm/bridge: imx8mp-hdmi-tx: add an hdmi-connector when missing using a DT overlay at boot time Luca Ceresoli
2026-04-02  4:05   ` Liu Ying
2026-04-02  7:30     ` Luca Ceresoli
2026-03-30 19:25 ` [PATCH v2 09/10] drm/bridge: imx8mp-hdmi-tx: switch to DRM_BRIDGE_ATTACH_NO_CONNECTOR Luca Ceresoli
2026-04-02  4:08   ` Liu Ying
2026-03-30 19:25 ` [PATCH v2 10/10] drm/mxsfb/lcdif: use DRM_BRIDGE_ATTACH_NO_CONNECTOR and the bridge-connector Luca Ceresoli
2026-04-02  4:55   ` Liu Ying
2026-04-02  5:07     ` Liu Ying
2026-04-02  8:28     ` Luca Ceresoli [this message]
2026-04-03  9:48       ` Liu Ying

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=DHIJ00VZ2O0H.1550LBTEFNT83@bootlin.com \
    --to=luca.ceresoli@bootlin.com \
    --cc=Frank.Li@nxp.com \
    --cc=Hui.Pu@gehealthcare.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=aford173@gmail.com \
    --cc=airlied@gmail.com \
    --cc=alexander.stein@ew.tq-group.com \
    --cc=andrzej.hajda@intel.com \
    --cc=christopher.obbard@linaro.org \
    --cc=damon.ding@rock-chips.com \
    --cc=dan.scally@ideasonboard.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emanuele.ghidoli@toradex.com \
    --cc=festevam@denx.de \
    --cc=festevam@gmail.com \
    --cc=francesco.dolcini@toradex.com \
    --cc=frieder.schrempf@kontron.de \
    --cc=gilles.talis@gmail.com \
    --cc=goran.radni@gmail.com \
    --cc=herve.codina@bootlin.com \
    --cc=hs@denx.de \
    --cc=ian.ray@gehealthcare.com \
    --cc=imx@lists.linux.dev \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=josua@solid-run.com \
    --cc=kernel@pengutronix.de \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=kory.maincent@bootlin.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.felsch@pengutronix.de \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=marex@denx.de \
    --cc=martyn.welch@collabora.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=o.rempel@pengutronix.de \
    --cc=peng.fan@nxp.com \
    --cc=rfoss@kernel.org \
    --cc=richard.hu@technexion.com \
    --cc=robh@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=saravanak@kernel.org \
    --cc=shengjiu.wang@nxp.com \
    --cc=simona@ffwll.ch \
    --cc=stefan.eichenberger@toradex.com \
    --cc=stefan@agner.ch \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=tzimmermann@suse.de \
    --cc=victor.liu@nxp.com \
    --cc=vitor.soares@toradex.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox