* [PATCH v3 2/4] drm/bridge: imx8mp-hdmi-tx: switch to bridge DRM_BRIDGE_ATTACH_NO_CONNECTOR
2024-12-31 19:28 [PATCH v3 1/4] drm: bridge: dw_hdmi: Add flag to indicate output port is optional Marek Vasut
@ 2024-12-31 19:28 ` Marek Vasut
2025-01-02 4:55 ` Dmitry Baryshkov
2025-01-03 9:42 ` Liu Ying
2024-12-31 19:28 ` [PATCH v3 3/4] drm/lcdif: add DRM_BRIDGE_ATTACH_NO_CONNECTOR flag to drm_bridge_attach Marek Vasut
` (3 subsequent siblings)
4 siblings, 2 replies; 19+ messages in thread
From: Marek Vasut @ 2024-12-31 19:28 UTC (permalink / raw)
To: dri-devel
Cc: Marek Vasut, Andrzej Hajda, David Airlie, Fabio Estevam,
Jernej Skrabec, Jonas Karlman, Laurent Pinchart, Liu Ying,
Maarten Lankhorst, Maxime Ripard, Neil Armstrong,
Pengutronix Kernel Team, Robert Foss, Sascha Hauer, Shawn Guo,
Simona Vetter, Stefan Agner, Thomas Zimmermann, imx,
linux-arm-kernel
The dw-hdmi output_port is set to 1 in order to look for a connector
next bridge in order to get DRM_BRIDGE_ATTACH_NO_CONNECTOR working.
The output_port set to 1 makes the DW HDMI driver core look up the
next bridge in DT, where the next bridge is often the hdmi-connector .
Similar to 0af5e0b41110 ("drm/meson: encoder_hdmi: switch to bridge DRM_BRIDGE_ATTACH_NO_CONNECTOR")
Note that looking at the upstream arch/arm64/boot/dts/freescale/imx8mp*dts ,
the oldest commit which adds HDMI support is commit:
3e67a1ddd56d ("arm64: dts: imx8mp: Enable HDMI on TQMa8MPxL/MBa8MPxL")
That already contains the HDMI connector node. Most follow up additions
of HDMI support to another devices has been a variation of the same commit,
including connector node, which is the proper way of eanbling HDMI on the
i.MX8MP.
The rest should be covered by output_port_optional which should make systems
with DTs without HDMI connector node work, but such DTs should be updated and
the HDMI connector node should be added.
Signed-off-by: Marek Vasut <marex@denx.de>
---
Cc: Andrzej Hajda <andrzej.hajda@intel.com>
Cc: David Airlie <airlied@gmail.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Jernej Skrabec <jernej.skrabec@gmail.com>
Cc: Jonas Karlman <jonas@kwiboo.se>
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Cc: Liu Ying <victor.liu@nxp.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Neil Armstrong <neil.armstrong@linaro.org>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: Robert Foss <rfoss@kernel.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Simona Vetter <simona@ffwll.ch>
Cc: Stefan Agner <stefan@agner.ch>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: dri-devel@lists.freedesktop.org
Cc: imx@lists.linux.dev
Cc: linux-arm-kernel@lists.infradead.org
---
V2: No change
V3: - Update commit message
- Move select DRM_DISPLAY_CONNECTOR to DRM_IMX8MP_DW_HDMI_BRIDGE
- Enable output_port_optional
---
drivers/gpu/drm/bridge/imx/Kconfig | 1 +
drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c | 2 ++
2 files changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/bridge/imx/Kconfig b/drivers/gpu/drm/bridge/imx/Kconfig
index 9a480c6abb856..db5c8a76193ac 100644
--- a/drivers/gpu/drm/bridge/imx/Kconfig
+++ b/drivers/gpu/drm/bridge/imx/Kconfig
@@ -17,6 +17,7 @@ config DRM_IMX8MP_DW_HDMI_BRIDGE
tristate "Freescale i.MX8MP HDMI-TX bridge support"
depends on OF
depends on COMMON_CLK
+ select DRM_DISPLAY_CONNECTOR
select DRM_DW_HDMI
imply DRM_IMX8MP_HDMI_PVI
imply PHY_FSL_SAMSUNG_HDMI_PHY
diff --git a/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c b/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c
index 1e7a789ec2890..3d63200e468bf 100644
--- a/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c
+++ b/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c
@@ -101,6 +101,8 @@ static int imx8mp_dw_hdmi_probe(struct platform_device *pdev)
plat_data->phy_name = "SAMSUNG HDMI TX PHY";
plat_data->priv_data = hdmi;
plat_data->phy_force_vendor = true;
+ plat_data->output_port = 1;
+ plat_data->output_port_optional = true;
hdmi->dw_hdmi = dw_hdmi_probe(pdev, plat_data);
if (IS_ERR(hdmi->dw_hdmi))
--
2.45.2
^ permalink raw reply related [flat|nested] 19+ messages in thread* Re: [PATCH v3 2/4] drm/bridge: imx8mp-hdmi-tx: switch to bridge DRM_BRIDGE_ATTACH_NO_CONNECTOR
2024-12-31 19:28 ` [PATCH v3 2/4] drm/bridge: imx8mp-hdmi-tx: switch to bridge DRM_BRIDGE_ATTACH_NO_CONNECTOR Marek Vasut
@ 2025-01-02 4:55 ` Dmitry Baryshkov
2025-01-02 23:22 ` Marek Vasut
2025-01-03 9:42 ` Liu Ying
1 sibling, 1 reply; 19+ messages in thread
From: Dmitry Baryshkov @ 2025-01-02 4:55 UTC (permalink / raw)
To: Marek Vasut
Cc: dri-devel, Andrzej Hajda, David Airlie, Fabio Estevam,
Jernej Skrabec, Jonas Karlman, Laurent Pinchart, Liu Ying,
Maarten Lankhorst, Maxime Ripard, Neil Armstrong,
Pengutronix Kernel Team, Robert Foss, Sascha Hauer, Shawn Guo,
Simona Vetter, Stefan Agner, Thomas Zimmermann, imx,
linux-arm-kernel
On Tue, Dec 31, 2024 at 08:28:49PM +0100, Marek Vasut wrote:
> The dw-hdmi output_port is set to 1 in order to look for a connector
> next bridge in order to get DRM_BRIDGE_ATTACH_NO_CONNECTOR working.
> The output_port set to 1 makes the DW HDMI driver core look up the
> next bridge in DT, where the next bridge is often the hdmi-connector .
>
> Similar to 0af5e0b41110 ("drm/meson: encoder_hdmi: switch to bridge DRM_BRIDGE_ATTACH_NO_CONNECTOR")
>
> Note that looking at the upstream arch/arm64/boot/dts/freescale/imx8mp*dts ,
> the oldest commit which adds HDMI support is commit:
>
> 3e67a1ddd56d ("arm64: dts: imx8mp: Enable HDMI on TQMa8MPxL/MBa8MPxL")
>
> That already contains the HDMI connector node. Most follow up additions
> of HDMI support to another devices has been a variation of the same commit,
> including connector node, which is the proper way of eanbling HDMI on the
> i.MX8MP.
>
> The rest should be covered by output_port_optional which should make systems
> with DTs without HDMI connector node work, but such DTs should be updated and
> the HDMI connector node should be added.
>
> Signed-off-by: Marek Vasut <marex@denx.de>
> ---
> Cc: Andrzej Hajda <andrzej.hajda@intel.com>
> Cc: David Airlie <airlied@gmail.com>
> Cc: Fabio Estevam <festevam@gmail.com>
> Cc: Jernej Skrabec <jernej.skrabec@gmail.com>
> Cc: Jonas Karlman <jonas@kwiboo.se>
> Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
> Cc: Liu Ying <victor.liu@nxp.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Neil Armstrong <neil.armstrong@linaro.org>
> Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
> Cc: Robert Foss <rfoss@kernel.org>
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> Cc: Shawn Guo <shawnguo@kernel.org>
> Cc: Simona Vetter <simona@ffwll.ch>
> Cc: Stefan Agner <stefan@agner.ch>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: dri-devel@lists.freedesktop.org
> Cc: imx@lists.linux.dev
> Cc: linux-arm-kernel@lists.infradead.org
> ---
> V2: No change
> V3: - Update commit message
> - Move select DRM_DISPLAY_CONNECTOR to DRM_IMX8MP_DW_HDMI_BRIDGE
> - Enable output_port_optional
> ---
> drivers/gpu/drm/bridge/imx/Kconfig | 1 +
> drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c | 2 ++
> 2 files changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/bridge/imx/Kconfig b/drivers/gpu/drm/bridge/imx/Kconfig
> index 9a480c6abb856..db5c8a76193ac 100644
> --- a/drivers/gpu/drm/bridge/imx/Kconfig
> +++ b/drivers/gpu/drm/bridge/imx/Kconfig
> @@ -17,6 +17,7 @@ config DRM_IMX8MP_DW_HDMI_BRIDGE
> tristate "Freescale i.MX8MP HDMI-TX bridge support"
> depends on OF
> depends on COMMON_CLK
> + select DRM_DISPLAY_CONNECTOR
I was going to write that it is not to be selected by anybody, but then
I stumbled upon meson driver, which also selects the symbol.
I still think that it is not to be selected by your driver as there is
no direct dependency (and there can be other bridges inbetween or the
bridge chain can end up with some other bridge). Such decisions belong
to defconfig or distribution's kernel config file.
> select DRM_DW_HDMI
> imply DRM_IMX8MP_HDMI_PVI
> imply PHY_FSL_SAMSUNG_HDMI_PHY
> diff --git a/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c b/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c
> index 1e7a789ec2890..3d63200e468bf 100644
> --- a/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c
> +++ b/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c
> @@ -101,6 +101,8 @@ static int imx8mp_dw_hdmi_probe(struct platform_device *pdev)
> plat_data->phy_name = "SAMSUNG HDMI TX PHY";
> plat_data->priv_data = hdmi;
> plat_data->phy_force_vendor = true;
> + plat_data->output_port = 1;
> + plat_data->output_port_optional = true;
>
> hdmi->dw_hdmi = dw_hdmi_probe(pdev, plat_data);
> if (IS_ERR(hdmi->dw_hdmi))
> --
> 2.45.2
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [PATCH v3 2/4] drm/bridge: imx8mp-hdmi-tx: switch to bridge DRM_BRIDGE_ATTACH_NO_CONNECTOR
2025-01-02 4:55 ` Dmitry Baryshkov
@ 2025-01-02 23:22 ` Marek Vasut
2025-01-03 5:37 ` Dmitry Baryshkov
0 siblings, 1 reply; 19+ messages in thread
From: Marek Vasut @ 2025-01-02 23:22 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: dri-devel, Andrzej Hajda, David Airlie, Fabio Estevam,
Jernej Skrabec, Jonas Karlman, Laurent Pinchart, Liu Ying,
Maarten Lankhorst, Maxime Ripard, Neil Armstrong,
Pengutronix Kernel Team, Robert Foss, Sascha Hauer, Shawn Guo,
Simona Vetter, Stefan Agner, Thomas Zimmermann, imx,
linux-arm-kernel
On 1/2/25 5:55 AM, Dmitry Baryshkov wrote:
> On Tue, Dec 31, 2024 at 08:28:49PM +0100, Marek Vasut wrote:
>> The dw-hdmi output_port is set to 1 in order to look for a connector
>> next bridge in order to get DRM_BRIDGE_ATTACH_NO_CONNECTOR working.
>> The output_port set to 1 makes the DW HDMI driver core look up the
>> next bridge in DT, where the next bridge is often the hdmi-connector .
>>
>> Similar to 0af5e0b41110 ("drm/meson: encoder_hdmi: switch to bridge DRM_BRIDGE_ATTACH_NO_CONNECTOR")
>>
>> Note that looking at the upstream arch/arm64/boot/dts/freescale/imx8mp*dts ,
>> the oldest commit which adds HDMI support is commit:
>>
>> 3e67a1ddd56d ("arm64: dts: imx8mp: Enable HDMI on TQMa8MPxL/MBa8MPxL")
>>
>> That already contains the HDMI connector node. Most follow up additions
>> of HDMI support to another devices has been a variation of the same commit,
>> including connector node, which is the proper way of eanbling HDMI on the
>> i.MX8MP.
>>
>> The rest should be covered by output_port_optional which should make systems
>> with DTs without HDMI connector node work, but such DTs should be updated and
>> the HDMI connector node should be added.
>>
>> Signed-off-by: Marek Vasut <marex@denx.de>
>> ---
>> Cc: Andrzej Hajda <andrzej.hajda@intel.com>
>> Cc: David Airlie <airlied@gmail.com>
>> Cc: Fabio Estevam <festevam@gmail.com>
>> Cc: Jernej Skrabec <jernej.skrabec@gmail.com>
>> Cc: Jonas Karlman <jonas@kwiboo.se>
>> Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
>> Cc: Liu Ying <victor.liu@nxp.com>
>> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>> Cc: Maxime Ripard <mripard@kernel.org>
>> Cc: Neil Armstrong <neil.armstrong@linaro.org>
>> Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
>> Cc: Robert Foss <rfoss@kernel.org>
>> Cc: Sascha Hauer <s.hauer@pengutronix.de>
>> Cc: Shawn Guo <shawnguo@kernel.org>
>> Cc: Simona Vetter <simona@ffwll.ch>
>> Cc: Stefan Agner <stefan@agner.ch>
>> Cc: Thomas Zimmermann <tzimmermann@suse.de>
>> Cc: dri-devel@lists.freedesktop.org
>> Cc: imx@lists.linux.dev
>> Cc: linux-arm-kernel@lists.infradead.org
>> ---
>> V2: No change
>> V3: - Update commit message
>> - Move select DRM_DISPLAY_CONNECTOR to DRM_IMX8MP_DW_HDMI_BRIDGE
>> - Enable output_port_optional
>> ---
>> drivers/gpu/drm/bridge/imx/Kconfig | 1 +
>> drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c | 2 ++
>> 2 files changed, 3 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/bridge/imx/Kconfig b/drivers/gpu/drm/bridge/imx/Kconfig
>> index 9a480c6abb856..db5c8a76193ac 100644
>> --- a/drivers/gpu/drm/bridge/imx/Kconfig
>> +++ b/drivers/gpu/drm/bridge/imx/Kconfig
>> @@ -17,6 +17,7 @@ config DRM_IMX8MP_DW_HDMI_BRIDGE
>> tristate "Freescale i.MX8MP HDMI-TX bridge support"
>> depends on OF
>> depends on COMMON_CLK
>> + select DRM_DISPLAY_CONNECTOR
>
> I was going to write that it is not to be selected by anybody, but then
> I stumbled upon meson driver, which also selects the symbol.
>
> I still think that it is not to be selected by your driver as there is
> no direct dependency (and there can be other bridges inbetween or the
> bridge chain can end up with some other bridge). Such decisions belong
> to defconfig or distribution's kernel config file.
Wouldn't that only lead to unnecessary surprises on user side ?
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [PATCH v3 2/4] drm/bridge: imx8mp-hdmi-tx: switch to bridge DRM_BRIDGE_ATTACH_NO_CONNECTOR
2025-01-02 23:22 ` Marek Vasut
@ 2025-01-03 5:37 ` Dmitry Baryshkov
0 siblings, 0 replies; 19+ messages in thread
From: Dmitry Baryshkov @ 2025-01-03 5:37 UTC (permalink / raw)
To: Marek Vasut
Cc: dri-devel, Andrzej Hajda, David Airlie, Fabio Estevam,
Jernej Skrabec, Jonas Karlman, Laurent Pinchart, Liu Ying,
Maarten Lankhorst, Maxime Ripard, Neil Armstrong,
Pengutronix Kernel Team, Robert Foss, Sascha Hauer, Shawn Guo,
Simona Vetter, Stefan Agner, Thomas Zimmermann, imx,
linux-arm-kernel
On Fri, Jan 03, 2025 at 12:22:34AM +0100, Marek Vasut wrote:
> On 1/2/25 5:55 AM, Dmitry Baryshkov wrote:
> > On Tue, Dec 31, 2024 at 08:28:49PM +0100, Marek Vasut wrote:
> > > The dw-hdmi output_port is set to 1 in order to look for a connector
> > > next bridge in order to get DRM_BRIDGE_ATTACH_NO_CONNECTOR working.
> > > The output_port set to 1 makes the DW HDMI driver core look up the
> > > next bridge in DT, where the next bridge is often the hdmi-connector .
> > >
> > > Similar to 0af5e0b41110 ("drm/meson: encoder_hdmi: switch to bridge DRM_BRIDGE_ATTACH_NO_CONNECTOR")
> > >
> > > Note that looking at the upstream arch/arm64/boot/dts/freescale/imx8mp*dts ,
> > > the oldest commit which adds HDMI support is commit:
> > >
> > > 3e67a1ddd56d ("arm64: dts: imx8mp: Enable HDMI on TQMa8MPxL/MBa8MPxL")
> > >
> > > That already contains the HDMI connector node. Most follow up additions
> > > of HDMI support to another devices has been a variation of the same commit,
> > > including connector node, which is the proper way of eanbling HDMI on the
> > > i.MX8MP.
> > >
> > > The rest should be covered by output_port_optional which should make systems
> > > with DTs without HDMI connector node work, but such DTs should be updated and
> > > the HDMI connector node should be added.
> > >
> > > Signed-off-by: Marek Vasut <marex@denx.de>
> > > ---
> > > Cc: Andrzej Hajda <andrzej.hajda@intel.com>
> > > Cc: David Airlie <airlied@gmail.com>
> > > Cc: Fabio Estevam <festevam@gmail.com>
> > > Cc: Jernej Skrabec <jernej.skrabec@gmail.com>
> > > Cc: Jonas Karlman <jonas@kwiboo.se>
> > > Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
> > > Cc: Liu Ying <victor.liu@nxp.com>
> > > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > > Cc: Maxime Ripard <mripard@kernel.org>
> > > Cc: Neil Armstrong <neil.armstrong@linaro.org>
> > > Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
> > > Cc: Robert Foss <rfoss@kernel.org>
> > > Cc: Sascha Hauer <s.hauer@pengutronix.de>
> > > Cc: Shawn Guo <shawnguo@kernel.org>
> > > Cc: Simona Vetter <simona@ffwll.ch>
> > > Cc: Stefan Agner <stefan@agner.ch>
> > > Cc: Thomas Zimmermann <tzimmermann@suse.de>
> > > Cc: dri-devel@lists.freedesktop.org
> > > Cc: imx@lists.linux.dev
> > > Cc: linux-arm-kernel@lists.infradead.org
> > > ---
> > > V2: No change
> > > V3: - Update commit message
> > > - Move select DRM_DISPLAY_CONNECTOR to DRM_IMX8MP_DW_HDMI_BRIDGE
> > > - Enable output_port_optional
> > > ---
> > > drivers/gpu/drm/bridge/imx/Kconfig | 1 +
> > > drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c | 2 ++
> > > 2 files changed, 3 insertions(+)
> > >
> > > diff --git a/drivers/gpu/drm/bridge/imx/Kconfig b/drivers/gpu/drm/bridge/imx/Kconfig
> > > index 9a480c6abb856..db5c8a76193ac 100644
> > > --- a/drivers/gpu/drm/bridge/imx/Kconfig
> > > +++ b/drivers/gpu/drm/bridge/imx/Kconfig
> > > @@ -17,6 +17,7 @@ config DRM_IMX8MP_DW_HDMI_BRIDGE
> > > tristate "Freescale i.MX8MP HDMI-TX bridge support"
> > > depends on OF
> > > depends on COMMON_CLK
> > > + select DRM_DISPLAY_CONNECTOR
> >
> > I was going to write that it is not to be selected by anybody, but then
> > I stumbled upon meson driver, which also selects the symbol.
> >
> > I still think that it is not to be selected by your driver as there is
> > no direct dependency (and there can be other bridges inbetween or the
> > bridge chain can end up with some other bridge). Such decisions belong
> > to defconfig or distribution's kernel config file.
> Wouldn't that only lead to unnecessary surprises on user side ?
This is of no concerns to Kconfig. You can't select all drivers that can
possibly be used with your platform / driver. `git grep
DRM_DISPLAY_CONNECTOR`.
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v3 2/4] drm/bridge: imx8mp-hdmi-tx: switch to bridge DRM_BRIDGE_ATTACH_NO_CONNECTOR
2024-12-31 19:28 ` [PATCH v3 2/4] drm/bridge: imx8mp-hdmi-tx: switch to bridge DRM_BRIDGE_ATTACH_NO_CONNECTOR Marek Vasut
2025-01-02 4:55 ` Dmitry Baryshkov
@ 2025-01-03 9:42 ` Liu Ying
1 sibling, 0 replies; 19+ messages in thread
From: Liu Ying @ 2025-01-03 9:42 UTC (permalink / raw)
To: Marek Vasut, dri-devel
Cc: Andrzej Hajda, David Airlie, Fabio Estevam, Jernej Skrabec,
Jonas Karlman, Laurent Pinchart, Maarten Lankhorst, Maxime Ripard,
Neil Armstrong, Pengutronix Kernel Team, Robert Foss,
Sascha Hauer, Shawn Guo, Simona Vetter, Stefan Agner,
Thomas Zimmermann, imx, linux-arm-kernel, alexander.stein
On 01/01/2025, Marek Vasut wrote:
> The dw-hdmi output_port is set to 1 in order to look for a connector
> next bridge in order to get DRM_BRIDGE_ATTACH_NO_CONNECTOR working.
> The output_port set to 1 makes the DW HDMI driver core look up the
> next bridge in DT, where the next bridge is often the hdmi-connector .
>
> Similar to 0af5e0b41110 ("drm/meson: encoder_hdmi: switch to bridge DRM_BRIDGE_ATTACH_NO_CONNECTOR")
>
> Note that looking at the upstream arch/arm64/boot/dts/freescale/imx8mp*dts ,
> the oldest commit which adds HDMI support is commit:
>
> 3e67a1ddd56d ("arm64: dts: imx8mp: Enable HDMI on TQMa8MPxL/MBa8MPxL")
>
> That already contains the HDMI connector node. Most follow up additions
> of HDMI support to another devices has been a variation of the same commit,
> including connector node, which is the proper way of eanbling HDMI on the
> i.MX8MP.
>
> The rest should be covered by output_port_optional which should make systems
> with DTs without HDMI connector node work, but such DTs should be updated and
> the HDMI connector node should be added.
>
> Signed-off-by: Marek Vasut <marex@denx.de>
> ---
> Cc: Andrzej Hajda <andrzej.hajda@intel.com>
> Cc: David Airlie <airlied@gmail.com>
> Cc: Fabio Estevam <festevam@gmail.com>
> Cc: Jernej Skrabec <jernej.skrabec@gmail.com>
> Cc: Jonas Karlman <jonas@kwiboo.se>
> Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
> Cc: Liu Ying <victor.liu@nxp.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Neil Armstrong <neil.armstrong@linaro.org>
> Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
> Cc: Robert Foss <rfoss@kernel.org>
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> Cc: Shawn Guo <shawnguo@kernel.org>
> Cc: Simona Vetter <simona@ffwll.ch>
> Cc: Stefan Agner <stefan@agner.ch>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: dri-devel@lists.freedesktop.org
> Cc: imx@lists.linux.dev
> Cc: linux-arm-kernel@lists.infradead.org
> ---
> V2: No change
> V3: - Update commit message
> - Move select DRM_DISPLAY_CONNECTOR to DRM_IMX8MP_DW_HDMI_BRIDGE
> - Enable output_port_optional
> ---
> drivers/gpu/drm/bridge/imx/Kconfig | 1 +
> drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c | 2 ++
> 2 files changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/bridge/imx/Kconfig b/drivers/gpu/drm/bridge/imx/Kconfig
> index 9a480c6abb856..db5c8a76193ac 100644
> --- a/drivers/gpu/drm/bridge/imx/Kconfig
> +++ b/drivers/gpu/drm/bridge/imx/Kconfig
> @@ -17,6 +17,7 @@ config DRM_IMX8MP_DW_HDMI_BRIDGE
> tristate "Freescale i.MX8MP HDMI-TX bridge support"
> depends on OF
> depends on COMMON_CLK
> + select DRM_DISPLAY_CONNECTOR
> select DRM_DW_HDMI
> imply DRM_IMX8MP_HDMI_PVI
> imply PHY_FSL_SAMSUNG_HDMI_PHY
> diff --git a/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c b/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c
> index 1e7a789ec2890..3d63200e468bf 100644
> --- a/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c
> +++ b/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c
> @@ -101,6 +101,8 @@ static int imx8mp_dw_hdmi_probe(struct platform_device *pdev)
> plat_data->phy_name = "SAMSUNG HDMI TX PHY";
> plat_data->priv_data = hdmi;
> plat_data->phy_force_vendor = true;
> + plat_data->output_port = 1;
I mentioned Dmitry's comments in my reply on v2:
https://lore.kernel.org/all/vvsj6ri2ke25nzocbq736yv7rphzma6pn3yk2uh7iu43zfe2sa@2fwye4k4w6he/
It looks like your patch set still fails to keep the behaviour of
dw_hdmi_connector_create() as part of those comments. Note that it won't be
called when the connector is created by the display controller drivers. CEC
is impacted at least in theory and Alexander tried to test it with my previous
patch set.
> + plat_data->output_port_optional = true;
>
> hdmi->dw_hdmi = dw_hdmi_probe(pdev, plat_data);
> if (IS_ERR(hdmi->dw_hdmi))
--
Regards,
Liu Ying
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v3 3/4] drm/lcdif: add DRM_BRIDGE_ATTACH_NO_CONNECTOR flag to drm_bridge_attach
2024-12-31 19:28 [PATCH v3 1/4] drm: bridge: dw_hdmi: Add flag to indicate output port is optional Marek Vasut
2024-12-31 19:28 ` [PATCH v3 2/4] drm/bridge: imx8mp-hdmi-tx: switch to bridge DRM_BRIDGE_ATTACH_NO_CONNECTOR Marek Vasut
@ 2024-12-31 19:28 ` Marek Vasut
2025-01-02 17:58 ` Dmitry Baryshkov
2024-12-31 19:28 ` [PATCH v3 4/4] drm/mxsfb: " Marek Vasut
` (2 subsequent siblings)
4 siblings, 1 reply; 19+ messages in thread
From: Marek Vasut @ 2024-12-31 19:28 UTC (permalink / raw)
To: dri-devel
Cc: Marek Vasut, Dmitry Baryshkov, Andrzej Hajda, David Airlie,
Fabio Estevam, Jernej Skrabec, Jonas Karlman, Laurent Pinchart,
Liu Ying, Maarten Lankhorst, Maxime Ripard, Neil Armstrong,
Pengutronix Kernel Team, Robert Foss, Sascha Hauer, Shawn Guo,
Simona Vetter, Stefan Agner, Thomas Zimmermann, imx,
linux-arm-kernel
Commit a25b988ff83f ("drm/bridge: Extend bridge API to disable connector creation")
added DRM_BRIDGE_ATTACH_NO_CONNECTOR bridge flag and all bridges handle
this flag in some way since then.
Newly added bridge drivers must no longer contain the connector creation and
will fail probing if this flag isn't set.
In order to be able to connect to those newly added bridges as well,
make use of drm_bridge_connector API and have the connector initialized
by the display controller.
Based on 2e87bf389e13 ("drm/rockchip: add DRM_BRIDGE_ATTACH_NO_CONNECTOR flag to drm_bridge_attach")
This makes LT9611 work with i.MX8M Plus.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Marek Vasut <marex@denx.de>
---
Cc: Andrzej Hajda <andrzej.hajda@intel.com>
Cc: David Airlie <airlied@gmail.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Jernej Skrabec <jernej.skrabec@gmail.com>
Cc: Jonas Karlman <jonas@kwiboo.se>
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Cc: Liu Ying <victor.liu@nxp.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Neil Armstrong <neil.armstrong@linaro.org>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: Robert Foss <rfoss@kernel.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Simona Vetter <simona@ffwll.ch>
Cc: Stefan Agner <stefan@agner.ch>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: dri-devel@lists.freedesktop.org
Cc: imx@lists.linux.dev
Cc: linux-arm-kernel@lists.infradead.org
---
V2: Add RB from Dmitry
V3: - Select DRM_DISPLAY_HELPER
- Use return dev_err_probe() directly
- Add missing of_node_put(ep)
- Add test using drm_bridge_get_next_bridge() to try and determine
if the HDMI connector was missing in DT or not, and if it was
missing, if it was created by the HDMI bridge driver.
---
drivers/gpu/drm/mxsfb/Kconfig | 2 ++
drivers/gpu/drm/mxsfb/lcdif_drv.c | 30 ++++++++++++++++++++++++++++--
2 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/mxsfb/Kconfig b/drivers/gpu/drm/mxsfb/Kconfig
index 264e74f455547..fe98674d5a298 100644
--- a/drivers/gpu/drm/mxsfb/Kconfig
+++ b/drivers/gpu/drm/mxsfb/Kconfig
@@ -12,6 +12,7 @@ config DRM_MXSFB
select DRM_CLIENT_SELECTION
select DRM_MXS
select DRM_KMS_HELPER
+ select DRM_BRIDGE_CONNECTOR
select DRM_GEM_DMA_HELPER
select DRM_PANEL
select DRM_PANEL_BRIDGE
@@ -28,6 +29,7 @@ config DRM_IMX_LCDIF
depends on COMMON_CLK
depends on ARCH_MXC || COMPILE_TEST
select DRM_CLIENT_SELECTION
+ select DRM_DISPLAY_HELPER
select DRM_MXS
select DRM_KMS_HELPER
select DRM_GEM_DMA_HELPER
diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdif_drv.c
index 8ee00f59ca821..dc39adabb3cd9 100644
--- a/drivers/gpu/drm/mxsfb/lcdif_drv.c
+++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c
@@ -17,6 +17,7 @@
#include <drm/clients/drm_client_setup.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_bridge.h>
+#include <drm/drm_bridge_connector.h>
#include <drm/drm_drv.h>
#include <drm/drm_encoder.h>
#include <drm/drm_fbdev_dma.h>
@@ -48,8 +49,10 @@ static const struct drm_encoder_funcs lcdif_encoder_funcs = {
static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif)
{
struct device *dev = lcdif->drm->dev;
+ struct drm_device *drm = lcdif->drm;
+ struct drm_connector *connector;
struct device_node *ep;
- struct drm_bridge *bridge;
+ struct drm_bridge *bridge, *nextbridge;
int ret;
for_each_endpoint_of_node(dev->of_node, ep) {
@@ -97,13 +100,36 @@ static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif)
return ret;
}
- ret = drm_bridge_attach(encoder, bridge, NULL, 0);
+ ret = drm_bridge_attach(encoder, bridge, NULL,
+ DRM_BRIDGE_ATTACH_NO_CONNECTOR);
if (ret) {
of_node_put(ep);
return dev_err_probe(dev, ret,
"Failed to attach bridge for endpoint%u\n",
of_ep.id);
}
+
+ nextbridge = drm_bridge_get_next_bridge(bridge);
+ nextbridge = drm_bridge_get_next_bridge(nextbridge);
+ /* Test if connector node in DT, if not, it was created already */
+ if (!nextbridge)
+ continue;
+
+ connector = drm_bridge_connector_init(drm, encoder);
+ if (IS_ERR(connector)) {
+ of_node_put(ep);
+ return dev_err_probe(drm->dev, PTR_ERR(connector),
+ "Failed to initialize bridge connector: %pe\n",
+ connector);
+ }
+
+ ret = drm_connector_attach_encoder(connector, encoder);
+ if (ret < 0) {
+ of_node_put(ep);
+ drm_connector_cleanup(connector);
+ return dev_err_probe(drm->dev, ret,
+ "Failed to attach encoder.\n");
+ }
}
return 0;
--
2.45.2
^ permalink raw reply related [flat|nested] 19+ messages in thread* Re: [PATCH v3 3/4] drm/lcdif: add DRM_BRIDGE_ATTACH_NO_CONNECTOR flag to drm_bridge_attach
2024-12-31 19:28 ` [PATCH v3 3/4] drm/lcdif: add DRM_BRIDGE_ATTACH_NO_CONNECTOR flag to drm_bridge_attach Marek Vasut
@ 2025-01-02 17:58 ` Dmitry Baryshkov
2025-01-02 23:20 ` Marek Vasut
0 siblings, 1 reply; 19+ messages in thread
From: Dmitry Baryshkov @ 2025-01-02 17:58 UTC (permalink / raw)
To: Marek Vasut
Cc: dri-devel, Andrzej Hajda, David Airlie, Fabio Estevam,
Jernej Skrabec, Jonas Karlman, Laurent Pinchart, Liu Ying,
Maarten Lankhorst, Maxime Ripard, Neil Armstrong,
Pengutronix Kernel Team, Robert Foss, Sascha Hauer, Shawn Guo,
Simona Vetter, Stefan Agner, Thomas Zimmermann, imx,
linux-arm-kernel
On Tue, Dec 31, 2024 at 08:28:50PM +0100, Marek Vasut wrote:
> Commit a25b988ff83f ("drm/bridge: Extend bridge API to disable connector creation")
> added DRM_BRIDGE_ATTACH_NO_CONNECTOR bridge flag and all bridges handle
> this flag in some way since then.
> Newly added bridge drivers must no longer contain the connector creation and
> will fail probing if this flag isn't set.
>
> In order to be able to connect to those newly added bridges as well,
> make use of drm_bridge_connector API and have the connector initialized
> by the display controller.
>
> Based on 2e87bf389e13 ("drm/rockchip: add DRM_BRIDGE_ATTACH_NO_CONNECTOR flag to drm_bridge_attach")
>
> This makes LT9611 work with i.MX8M Plus.
>
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> Signed-off-by: Marek Vasut <marex@denx.de>
> ---
> Cc: Andrzej Hajda <andrzej.hajda@intel.com>
> Cc: David Airlie <airlied@gmail.com>
> Cc: Fabio Estevam <festevam@gmail.com>
> Cc: Jernej Skrabec <jernej.skrabec@gmail.com>
> Cc: Jonas Karlman <jonas@kwiboo.se>
> Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
> Cc: Liu Ying <victor.liu@nxp.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Neil Armstrong <neil.armstrong@linaro.org>
> Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
> Cc: Robert Foss <rfoss@kernel.org>
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> Cc: Shawn Guo <shawnguo@kernel.org>
> Cc: Simona Vetter <simona@ffwll.ch>
> Cc: Stefan Agner <stefan@agner.ch>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: dri-devel@lists.freedesktop.org
> Cc: imx@lists.linux.dev
> Cc: linux-arm-kernel@lists.infradead.org
> ---
> V2: Add RB from Dmitry
> V3: - Select DRM_DISPLAY_HELPER
> - Use return dev_err_probe() directly
> - Add missing of_node_put(ep)
> - Add test using drm_bridge_get_next_bridge() to try and determine
> if the HDMI connector was missing in DT or not, and if it was
> missing, if it was created by the HDMI bridge driver.
> ---
> drivers/gpu/drm/mxsfb/Kconfig | 2 ++
> drivers/gpu/drm/mxsfb/lcdif_drv.c | 30 ++++++++++++++++++++++++++++--
> 2 files changed, 30 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/mxsfb/Kconfig b/drivers/gpu/drm/mxsfb/Kconfig
> index 264e74f455547..fe98674d5a298 100644
> --- a/drivers/gpu/drm/mxsfb/Kconfig
> +++ b/drivers/gpu/drm/mxsfb/Kconfig
> @@ -12,6 +12,7 @@ config DRM_MXSFB
> select DRM_CLIENT_SELECTION
> select DRM_MXS
> select DRM_KMS_HELPER
> + select DRM_BRIDGE_CONNECTOR
Shouldn't this chunk go to another patch?
> select DRM_GEM_DMA_HELPER
> select DRM_PANEL
> select DRM_PANEL_BRIDGE
> @@ -28,6 +29,7 @@ config DRM_IMX_LCDIF
> depends on COMMON_CLK
> depends on ARCH_MXC || COMPILE_TEST
> select DRM_CLIENT_SELECTION
> + select DRM_DISPLAY_HELPER
> select DRM_MXS
> select DRM_KMS_HELPER
> select DRM_GEM_DMA_HELPER
> diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdif_drv.c
> index 8ee00f59ca821..dc39adabb3cd9 100644
> --- a/drivers/gpu/drm/mxsfb/lcdif_drv.c
> +++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c
> @@ -17,6 +17,7 @@
> #include <drm/clients/drm_client_setup.h>
> #include <drm/drm_atomic_helper.h>
> #include <drm/drm_bridge.h>
> +#include <drm/drm_bridge_connector.h>
> #include <drm/drm_drv.h>
> #include <drm/drm_encoder.h>
> #include <drm/drm_fbdev_dma.h>
> @@ -48,8 +49,10 @@ static const struct drm_encoder_funcs lcdif_encoder_funcs = {
> static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif)
> {
> struct device *dev = lcdif->drm->dev;
> + struct drm_device *drm = lcdif->drm;
> + struct drm_connector *connector;
> struct device_node *ep;
> - struct drm_bridge *bridge;
> + struct drm_bridge *bridge, *nextbridge;
> int ret;
>
> for_each_endpoint_of_node(dev->of_node, ep) {
> @@ -97,13 +100,36 @@ static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif)
> return ret;
> }
>
> - ret = drm_bridge_attach(encoder, bridge, NULL, 0);
> + ret = drm_bridge_attach(encoder, bridge, NULL,
> + DRM_BRIDGE_ATTACH_NO_CONNECTOR);
> if (ret) {
> of_node_put(ep);
> return dev_err_probe(dev, ret,
> "Failed to attach bridge for endpoint%u\n",
> of_ep.id);
> }
> +
> + nextbridge = drm_bridge_get_next_bridge(bridge);
> + nextbridge = drm_bridge_get_next_bridge(nextbridge);
> + /* Test if connector node in DT, if not, it was created already */
By whom? And why? There is no display-connector bridge, but there is a
normal bridge chain, you have passed DRM_BRIDGE_ATTACH_NO_CONNECTOR, so
now it's a proper time to create drm_bridge_connector. You have added
the next_bridge_optional flag, but it should just prevent the dw driver
from returning the error if there is no next_bridge.
> + if (!nextbridge)
> + continue;
> +
> + connector = drm_bridge_connector_init(drm, encoder);
> + if (IS_ERR(connector)) {
> + of_node_put(ep);
> + return dev_err_probe(drm->dev, PTR_ERR(connector),
> + "Failed to initialize bridge connector: %pe\n",
> + connector);
> + }
> +
> + ret = drm_connector_attach_encoder(connector, encoder);
> + if (ret < 0) {
> + of_node_put(ep);
> + drm_connector_cleanup(connector);
> + return dev_err_probe(drm->dev, ret,
> + "Failed to attach encoder.\n");
> + }
> }
>
> return 0;
> --
> 2.45.2
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [PATCH v3 3/4] drm/lcdif: add DRM_BRIDGE_ATTACH_NO_CONNECTOR flag to drm_bridge_attach
2025-01-02 17:58 ` Dmitry Baryshkov
@ 2025-01-02 23:20 ` Marek Vasut
2025-01-03 5:36 ` Dmitry Baryshkov
0 siblings, 1 reply; 19+ messages in thread
From: Marek Vasut @ 2025-01-02 23:20 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: dri-devel, Andrzej Hajda, David Airlie, Fabio Estevam,
Jernej Skrabec, Jonas Karlman, Laurent Pinchart, Liu Ying,
Maarten Lankhorst, Maxime Ripard, Neil Armstrong,
Pengutronix Kernel Team, Robert Foss, Sascha Hauer, Shawn Guo,
Simona Vetter, Stefan Agner, Thomas Zimmermann, imx,
linux-arm-kernel
On 1/2/25 6:58 PM, Dmitry Baryshkov wrote:
[...]
>> @@ -97,13 +100,36 @@ static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif)
>> return ret;
>> }
>>
>> - ret = drm_bridge_attach(encoder, bridge, NULL, 0);
>> + ret = drm_bridge_attach(encoder, bridge, NULL,
>> + DRM_BRIDGE_ATTACH_NO_CONNECTOR);
>> if (ret) {
>> of_node_put(ep);
>> return dev_err_probe(dev, ret,
>> "Failed to attach bridge for endpoint%u\n",
>> of_ep.id);
>> }
>> +
>> + nextbridge = drm_bridge_get_next_bridge(bridge);
>> + nextbridge = drm_bridge_get_next_bridge(nextbridge);
>> + /* Test if connector node in DT, if not, it was created already */
>
> By whom? And why?
By the HDMI bridge driver, see 1/4.
> There is no display-connector bridge, but there is a
> normal bridge chain, you have passed DRM_BRIDGE_ATTACH_NO_CONNECTOR, so
> now it's a proper time to create drm_bridge_connector. You have added
> the next_bridge_optional flag, but it should just prevent the dw driver
> from returning the error if there is no next_bridge.
So what exactly should I do here ?
If dw_hdmi_parse_dt() only exits with 0 if there is no connector node in
DT, I don't get any output on the HDMI. I have to create a connector in
the HDMI bridge driver instead and not here, right ?
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [PATCH v3 3/4] drm/lcdif: add DRM_BRIDGE_ATTACH_NO_CONNECTOR flag to drm_bridge_attach
2025-01-02 23:20 ` Marek Vasut
@ 2025-01-03 5:36 ` Dmitry Baryshkov
0 siblings, 0 replies; 19+ messages in thread
From: Dmitry Baryshkov @ 2025-01-03 5:36 UTC (permalink / raw)
To: Marek Vasut
Cc: dri-devel, Andrzej Hajda, David Airlie, Fabio Estevam,
Jernej Skrabec, Jonas Karlman, Laurent Pinchart, Liu Ying,
Maarten Lankhorst, Maxime Ripard, Neil Armstrong,
Pengutronix Kernel Team, Robert Foss, Sascha Hauer, Shawn Guo,
Simona Vetter, Stefan Agner, Thomas Zimmermann, imx,
linux-arm-kernel
On Fri, Jan 03, 2025 at 12:20:19AM +0100, Marek Vasut wrote:
> On 1/2/25 6:58 PM, Dmitry Baryshkov wrote:
>
> [...]
>
> > > @@ -97,13 +100,36 @@ static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif)
> > > return ret;
> > > }
> > > - ret = drm_bridge_attach(encoder, bridge, NULL, 0);
> > > + ret = drm_bridge_attach(encoder, bridge, NULL,
> > > + DRM_BRIDGE_ATTACH_NO_CONNECTOR);
> > > if (ret) {
> > > of_node_put(ep);
> > > return dev_err_probe(dev, ret,
> > > "Failed to attach bridge for endpoint%u\n",
> > > of_ep.id);
> > > }
> > > +
> > > + nextbridge = drm_bridge_get_next_bridge(bridge);
> > > + nextbridge = drm_bridge_get_next_bridge(nextbridge);
> > > + /* Test if connector node in DT, if not, it was created already */
> >
> > By whom? And why?
>
> By the HDMI bridge driver, see 1/4.
>
> > There is no display-connector bridge, but there is a
> > normal bridge chain, you have passed DRM_BRIDGE_ATTACH_NO_CONNECTOR, so
> > now it's a proper time to create drm_bridge_connector. You have added
> > the next_bridge_optional flag, but it should just prevent the dw driver
> > from returning the error if there is no next_bridge.
> So what exactly should I do here ?
>
> If dw_hdmi_parse_dt() only exits with 0 if there is no connector node in DT,
> I don't get any output on the HDMI. I have to create a connector in the HDMI
> bridge driver instead and not here, right ?
No. Please make dw_hdmi_parse_dt() return 0 if there is no connector and
the flag is set. Then create drm_bridge_connector here.
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH v3 4/4] drm/mxsfb: add DRM_BRIDGE_ATTACH_NO_CONNECTOR flag to drm_bridge_attach
2024-12-31 19:28 [PATCH v3 1/4] drm: bridge: dw_hdmi: Add flag to indicate output port is optional Marek Vasut
2024-12-31 19:28 ` [PATCH v3 2/4] drm/bridge: imx8mp-hdmi-tx: switch to bridge DRM_BRIDGE_ATTACH_NO_CONNECTOR Marek Vasut
2024-12-31 19:28 ` [PATCH v3 3/4] drm/lcdif: add DRM_BRIDGE_ATTACH_NO_CONNECTOR flag to drm_bridge_attach Marek Vasut
@ 2024-12-31 19:28 ` Marek Vasut
2024-12-31 20:31 ` [PATCH v3 1/4] drm: bridge: dw_hdmi: Add flag to indicate output port is optional Laurent Pinchart
2025-01-02 4:51 ` Dmitry Baryshkov
4 siblings, 0 replies; 19+ messages in thread
From: Marek Vasut @ 2024-12-31 19:28 UTC (permalink / raw)
To: dri-devel
Cc: Marek Vasut, Dmitry Baryshkov, Andrzej Hajda, David Airlie,
Fabio Estevam, Jernej Skrabec, Jonas Karlman, Laurent Pinchart,
Liu Ying, Maarten Lankhorst, Maxime Ripard, Neil Armstrong,
Pengutronix Kernel Team, Robert Foss, Sascha Hauer, Shawn Guo,
Simona Vetter, Stefan Agner, Thomas Zimmermann, imx,
linux-arm-kernel
Commit a25b988ff83f ("drm/bridge: Extend bridge API to disable connector creation")
added DRM_BRIDGE_ATTACH_NO_CONNECTOR bridge flag and all bridges handle
this flag in some way since then.
Newly added bridge drivers must no longer contain the connector creation and
will fail probing if this flag isn't set.
In order to be able to connect to those newly added bridges as well,
make use of drm_bridge_connector API and have the connector initialized
by the display controller.
Based on 2e87bf389e13 ("drm/rockchip: add DRM_BRIDGE_ATTACH_NO_CONNECTOR flag to drm_bridge_attach")
This makes LT9611 work with i.MX8M Mini.
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Marek Vasut <marex@denx.de>
---
Cc: Andrzej Hajda <andrzej.hajda@intel.com>
Cc: David Airlie <airlied@gmail.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Jernej Skrabec <jernej.skrabec@gmail.com>
Cc: Jonas Karlman <jonas@kwiboo.se>
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Cc: Liu Ying <victor.liu@nxp.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Neil Armstrong <neil.armstrong@linaro.org>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: Robert Foss <rfoss@kernel.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Simona Vetter <simona@ffwll.ch>
Cc: Stefan Agner <stefan@agner.ch>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: dri-devel@lists.freedesktop.org
Cc: imx@lists.linux.dev
Cc: linux-arm-kernel@lists.infradead.org
---
V2: Cache connector from drm_bridge_connector_init()
V3: - Add RB from Dmitry
- Select DRM_DISPLAY_HELPER
- Use return dev_err_probe() directly
- Drop the single use fail path
---
drivers/gpu/drm/mxsfb/Kconfig | 2 ++
drivers/gpu/drm/mxsfb/mxsfb_drv.c | 31 ++++++++++++++++++++-----------
2 files changed, 22 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/mxsfb/Kconfig b/drivers/gpu/drm/mxsfb/Kconfig
index fe98674d5a298..eb51d38455a6c 100644
--- a/drivers/gpu/drm/mxsfb/Kconfig
+++ b/drivers/gpu/drm/mxsfb/Kconfig
@@ -10,6 +10,7 @@ config DRM_MXSFB
depends on COMMON_CLK
depends on ARCH_MXS || ARCH_MXC || COMPILE_TEST
select DRM_CLIENT_SELECTION
+ select DRM_DISPLAY_HELPER
select DRM_MXS
select DRM_KMS_HELPER
select DRM_BRIDGE_CONNECTOR
@@ -32,6 +33,7 @@ config DRM_IMX_LCDIF
select DRM_DISPLAY_HELPER
select DRM_MXS
select DRM_KMS_HELPER
+ select DRM_BRIDGE_CONNECTOR
select DRM_GEM_DMA_HELPER
select DRM_PANEL
select DRM_PANEL_BRIDGE
diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
index 59020862cf65e..07784c4f5be48 100644
--- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
+++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
@@ -20,6 +20,7 @@
#include <drm/clients/drm_client_setup.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_bridge.h>
+#include <drm/drm_bridge_connector.h>
#include <drm/drm_connector.h>
#include <drm/drm_drv.h>
#include <drm/drm_fbdev_dma.h>
@@ -119,9 +120,9 @@ static const struct drm_mode_config_helper_funcs mxsfb_mode_config_helpers = {
static int mxsfb_attach_bridge(struct mxsfb_drm_private *mxsfb)
{
struct drm_device *drm = mxsfb->drm;
- struct drm_connector_list_iter iter;
- struct drm_panel *panel;
+ struct drm_connector *connector;
struct drm_bridge *bridge;
+ struct drm_panel *panel;
int ret;
ret = drm_of_find_panel_or_bridge(drm->dev->of_node, 0, 0, &panel,
@@ -139,19 +140,27 @@ static int mxsfb_attach_bridge(struct mxsfb_drm_private *mxsfb)
if (!bridge)
return -ENODEV;
- ret = drm_bridge_attach(&mxsfb->encoder, bridge, NULL, 0);
+ ret = drm_bridge_attach(&mxsfb->encoder, bridge, NULL,
+ DRM_BRIDGE_ATTACH_NO_CONNECTOR);
if (ret)
return dev_err_probe(drm->dev, ret, "Failed to attach bridge\n");
- mxsfb->bridge = bridge;
+ connector = drm_bridge_connector_init(drm, &mxsfb->encoder);
+ if (IS_ERR(connector)) {
+ return dev_err_probe(drm->dev, PTR_ERR(connector),
+ "Failed to initialize bridge connector: %pe\n",
+ connector);
+ }
- /*
- * Get hold of the connector. This is a bit of a hack, until the bridge
- * API gives us bus flags and formats.
- */
- drm_connector_list_iter_begin(drm, &iter);
- mxsfb->connector = drm_connector_list_iter_next(&iter);
- drm_connector_list_iter_end(&iter);
+ ret = drm_connector_attach_encoder(connector, &mxsfb->encoder);
+ if (ret < 0) {
+ drm_connector_cleanup(connector);
+ return dev_err_probe(drm->dev, ret,
+ "Failed to attach encoder.\n");
+ }
+
+ mxsfb->bridge = bridge;
+ mxsfb->connector = connector;
return 0;
}
--
2.45.2
^ permalink raw reply related [flat|nested] 19+ messages in thread* Re: [PATCH v3 1/4] drm: bridge: dw_hdmi: Add flag to indicate output port is optional
2024-12-31 19:28 [PATCH v3 1/4] drm: bridge: dw_hdmi: Add flag to indicate output port is optional Marek Vasut
` (2 preceding siblings ...)
2024-12-31 19:28 ` [PATCH v3 4/4] drm/mxsfb: " Marek Vasut
@ 2024-12-31 20:31 ` Laurent Pinchart
2024-12-31 21:10 ` Marek Vasut
2025-01-02 4:51 ` Dmitry Baryshkov
4 siblings, 1 reply; 19+ messages in thread
From: Laurent Pinchart @ 2024-12-31 20:31 UTC (permalink / raw)
To: Marek Vasut
Cc: dri-devel, Andrzej Hajda, David Airlie, Fabio Estevam,
Jernej Skrabec, Jonas Karlman, Liu Ying, Maarten Lankhorst,
Maxime Ripard, Neil Armstrong, Pengutronix Kernel Team,
Robert Foss, Sascha Hauer, Shawn Guo, Simona Vetter, Stefan Agner,
Thomas Zimmermann, imx, linux-arm-kernel
Hi Marek,
Thank you for the patch.
On Tue, Dec 31, 2024 at 08:28:48PM +0100, Marek Vasut wrote:
> Add a flag meant purely to work around broken i.MX8MP DTs which enable
> HDMI but do not contain the HDMI connector node. This flag allows such
> DTs to work by creating the connector in the HDMI bridge driver. Do not
> use this flag, do not proliferate this flag, please fix your DTs.
What's the rationale for this, what prevents fixing DT instead of using
this flag ? Adding such a flag will most likely open the door to
proliferation.
If you can't fix the DT on particular boards, patching it could be an
option. We had a similar problem on Renesas boards, which we fixed with
a DT overlay, see commit 81c0e3dd82927064 ("drm: rcar-du: Fix legacy DT
to create LVDS encoder nodes"). This made the workaround self-contained,
and allowed dropping it several kernel versions later (in commit
841281fe52a769fe, "drm: rcar-du: Drop LVDS device tree backward
compatibility").
> Signed-off-by: Marek Vasut <marex@denx.de>
> ---
> Cc: Andrzej Hajda <andrzej.hajda@intel.com>
> Cc: David Airlie <airlied@gmail.com>
> Cc: Fabio Estevam <festevam@gmail.com>
> Cc: Jernej Skrabec <jernej.skrabec@gmail.com>
> Cc: Jonas Karlman <jonas@kwiboo.se>
> Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
> Cc: Liu Ying <victor.liu@nxp.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Neil Armstrong <neil.armstrong@linaro.org>
> Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
> Cc: Robert Foss <rfoss@kernel.org>
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> Cc: Shawn Guo <shawnguo@kernel.org>
> Cc: Simona Vetter <simona@ffwll.ch>
> Cc: Stefan Agner <stefan@agner.ch>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: dri-devel@lists.freedesktop.org
> Cc: imx@lists.linux.dev
> Cc: linux-arm-kernel@lists.infradead.org
> ---
> V3: New patch
> ---
> drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 12 ++++++++----
> include/drm/bridge/dw_hdmi.h | 2 ++
> 2 files changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> index 996733ed2c004..852e73c0f686f 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> @@ -2893,9 +2893,13 @@ static int dw_hdmi_bridge_attach(struct drm_bridge *bridge,
> {
> struct dw_hdmi *hdmi = bridge->driver_private;
>
> - if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)
> - return drm_bridge_attach(bridge->encoder, hdmi->next_bridge,
> - bridge, flags);
> + if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
> + if (hdmi->plat_data->output_port_optional && !hdmi->next_bridge)
> + return dw_hdmi_connector_create(hdmi);
> + else
> + return drm_bridge_attach(bridge->encoder, hdmi->next_bridge,
> + bridge, flags);
> + }
>
> return dw_hdmi_connector_create(hdmi);
> }
> @@ -3298,7 +3302,7 @@ static int dw_hdmi_parse_dt(struct dw_hdmi *hdmi)
> hdmi->plat_data->output_port,
> -1);
> if (!remote)
> - return -ENODEV;
> + return hdmi->plat_data->output_port_optional ? 0 : -ENODEV;
>
> hdmi->next_bridge = of_drm_find_bridge(remote);
> of_node_put(remote);
> diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h
> index 6a46baa0737cd..3bb6e633424a8 100644
> --- a/include/drm/bridge/dw_hdmi.h
> +++ b/include/drm/bridge/dw_hdmi.h
> @@ -127,6 +127,8 @@ struct dw_hdmi_plat_data {
> struct regmap *regm;
>
> unsigned int output_port;
> + /* Used purely by MX8MP HDMI to work around broken DTs without HDMI connector node. */
> + bool output_port_optional;
>
> unsigned long input_bus_encoding;
> bool use_drm_infoframe;
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [PATCH v3 1/4] drm: bridge: dw_hdmi: Add flag to indicate output port is optional
2024-12-31 20:31 ` [PATCH v3 1/4] drm: bridge: dw_hdmi: Add flag to indicate output port is optional Laurent Pinchart
@ 2024-12-31 21:10 ` Marek Vasut
2025-01-01 22:36 ` Laurent Pinchart
0 siblings, 1 reply; 19+ messages in thread
From: Marek Vasut @ 2024-12-31 21:10 UTC (permalink / raw)
To: Laurent Pinchart
Cc: dri-devel, Andrzej Hajda, David Airlie, Fabio Estevam,
Jernej Skrabec, Jonas Karlman, Liu Ying, Maarten Lankhorst,
Maxime Ripard, Neil Armstrong, Pengutronix Kernel Team,
Robert Foss, Sascha Hauer, Shawn Guo, Simona Vetter, Stefan Agner,
Thomas Zimmermann, imx, linux-arm-kernel
On 12/31/24 9:31 PM, Laurent Pinchart wrote:
> Hi Marek,
Hi,
> Thank you for the patch.
>
> On Tue, Dec 31, 2024 at 08:28:48PM +0100, Marek Vasut wrote:
>> Add a flag meant purely to work around broken i.MX8MP DTs which enable
>> HDMI but do not contain the HDMI connector node. This flag allows such
>> DTs to work by creating the connector in the HDMI bridge driver. Do not
>> use this flag, do not proliferate this flag, please fix your DTs.
>
> What's the rationale for this, what prevents fixing DT instead of using
> this flag ? Adding such a flag will most likely open the door to
> proliferation.
See the V2 series discussion, there are a few in-tree DTs which do not
have the HDMI connector node. The rationale is there might be more and
they might come from vendors, so this flag is necessary to work around
those DTs.
> If you can't fix the DT on particular boards, patching it could be an
> option. We had a similar problem on Renesas boards, which we fixed with
> a DT overlay, see commit 81c0e3dd82927064 ("drm: rcar-du: Fix legacy DT
> to create LVDS encoder nodes"). This made the workaround self-contained,
> and allowed dropping it several kernel versions later (in commit
> 841281fe52a769fe, "drm: rcar-du: Drop LVDS device tree backward
> compatibility").
Frankly, I would much rather fix the few in-tree DTs and mandate the
HDMI connector node in DT, which would keep the code simple, rather than
maintain a backward compatibility workaround for problem which might not
even exist.
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [PATCH v3 1/4] drm: bridge: dw_hdmi: Add flag to indicate output port is optional
2024-12-31 21:10 ` Marek Vasut
@ 2025-01-01 22:36 ` Laurent Pinchart
2025-01-02 1:15 ` Marek Vasut
2025-01-02 3:26 ` Dmitry Baryshkov
0 siblings, 2 replies; 19+ messages in thread
From: Laurent Pinchart @ 2025-01-01 22:36 UTC (permalink / raw)
To: Marek Vasut
Cc: dri-devel, Andrzej Hajda, David Airlie, Fabio Estevam,
Jernej Skrabec, Jonas Karlman, Liu Ying, Maarten Lankhorst,
Maxime Ripard, Neil Armstrong, Pengutronix Kernel Team,
Robert Foss, Sascha Hauer, Shawn Guo, Simona Vetter, Stefan Agner,
Thomas Zimmermann, imx, linux-arm-kernel
On Tue, Dec 31, 2024 at 10:10:51PM +0100, Marek Vasut wrote:
> On 12/31/24 9:31 PM, Laurent Pinchart wrote:
> > Hi Marek,
>
> Hi,
>
> > Thank you for the patch.
> >
> > On Tue, Dec 31, 2024 at 08:28:48PM +0100, Marek Vasut wrote:
> >> Add a flag meant purely to work around broken i.MX8MP DTs which enable
> >> HDMI but do not contain the HDMI connector node. This flag allows such
> >> DTs to work by creating the connector in the HDMI bridge driver. Do not
> >> use this flag, do not proliferate this flag, please fix your DTs.
> >
> > What's the rationale for this, what prevents fixing DT instead of using
> > this flag ? Adding such a flag will most likely open the door to
> > proliferation.
>
> See the V2 series discussion, there are a few in-tree DTs which do not
> have the HDMI connector node. The rationale is there might be more and
> they might come from vendors, so this flag is necessary to work around
> those DTs.
>
> > If you can't fix the DT on particular boards, patching it could be an
> > option. We had a similar problem on Renesas boards, which we fixed with
> > a DT overlay, see commit 81c0e3dd82927064 ("drm: rcar-du: Fix legacy DT
> > to create LVDS encoder nodes"). This made the workaround self-contained,
> > and allowed dropping it several kernel versions later (in commit
> > 841281fe52a769fe, "drm: rcar-du: Drop LVDS device tree backward
> > compatibility").
>
> Frankly, I would much rather fix the few in-tree DTs and mandate the
> HDMI connector node in DT, which would keep the code simple, rather than
> maintain a backward compatibility workaround for problem which might not
> even exist.
The in-tree device tree sources should be converted as part of the
series, I don't see a point trying to maintain backward compatibility
for in-tree DT sources.
For out-of-tree sources it depends on how likely the problem is. There's
no regression if nobody is affected. I personally like restricting
backward compatibility to the strict minimum, to ensure that all new DTs
will use proper bindings. Making the backward compatibility code
self-contained helps there, and we could also print a loud warning
(WARN_ON() seems appropriate) and set a date for the removal of the
workaround.
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [PATCH v3 1/4] drm: bridge: dw_hdmi: Add flag to indicate output port is optional
2025-01-01 22:36 ` Laurent Pinchart
@ 2025-01-02 1:15 ` Marek Vasut
2025-01-02 3:26 ` Dmitry Baryshkov
1 sibling, 0 replies; 19+ messages in thread
From: Marek Vasut @ 2025-01-02 1:15 UTC (permalink / raw)
To: Laurent Pinchart
Cc: dri-devel, Andrzej Hajda, David Airlie, Fabio Estevam,
Jernej Skrabec, Jonas Karlman, Liu Ying, Maarten Lankhorst,
Maxime Ripard, Neil Armstrong, Pengutronix Kernel Team,
Robert Foss, Sascha Hauer, Shawn Guo, Simona Vetter, Stefan Agner,
Thomas Zimmermann, imx, linux-arm-kernel
On 1/1/25 11:36 PM, Laurent Pinchart wrote:
> On Tue, Dec 31, 2024 at 10:10:51PM +0100, Marek Vasut wrote:
>> On 12/31/24 9:31 PM, Laurent Pinchart wrote:
>>> Hi Marek,
>>
>> Hi,
>>
>>> Thank you for the patch.
>>>
>>> On Tue, Dec 31, 2024 at 08:28:48PM +0100, Marek Vasut wrote:
>>>> Add a flag meant purely to work around broken i.MX8MP DTs which enable
>>>> HDMI but do not contain the HDMI connector node. This flag allows such
>>>> DTs to work by creating the connector in the HDMI bridge driver. Do not
>>>> use this flag, do not proliferate this flag, please fix your DTs.
>>>
>>> What's the rationale for this, what prevents fixing DT instead of using
>>> this flag ? Adding such a flag will most likely open the door to
>>> proliferation.
>>
>> See the V2 series discussion, there are a few in-tree DTs which do not
>> have the HDMI connector node. The rationale is there might be more and
>> they might come from vendors, so this flag is necessary to work around
>> those DTs.
>>
>>> If you can't fix the DT on particular boards, patching it could be an
>>> option. We had a similar problem on Renesas boards, which we fixed with
>>> a DT overlay, see commit 81c0e3dd82927064 ("drm: rcar-du: Fix legacy DT
>>> to create LVDS encoder nodes"). This made the workaround self-contained,
>>> and allowed dropping it several kernel versions later (in commit
>>> 841281fe52a769fe, "drm: rcar-du: Drop LVDS device tree backward
>>> compatibility").
>>
>> Frankly, I would much rather fix the few in-tree DTs and mandate the
>> HDMI connector node in DT, which would keep the code simple, rather than
>> maintain a backward compatibility workaround for problem which might not
>> even exist.
>
> The in-tree device tree sources should be converted as part of the
> series, I don't see a point trying to maintain backward compatibility
> for in-tree DT sources.
That's fine, that I can do.
> For out-of-tree sources it depends on how likely the problem is. There's
> no regression if nobody is affected. I personally like restricting
> backward compatibility to the strict minimum, to ensure that all new DTs
> will use proper bindings. Making the backward compatibility code
> self-contained helps there, and we could also print a loud warning
> (WARN_ON() seems appropriate) and set a date for the removal of the
> workaround.
The other alternative would be to not add the workaround at all, and
wait if someone is going to complain about broken downstream DT. If so,
then it can be added. I would much rather prefer this simple option,
because I have this feeling there are not going to be (m)any broken
downstream DTs, but I might be wrong about that.
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [PATCH v3 1/4] drm: bridge: dw_hdmi: Add flag to indicate output port is optional
2025-01-01 22:36 ` Laurent Pinchart
2025-01-02 1:15 ` Marek Vasut
@ 2025-01-02 3:26 ` Dmitry Baryshkov
2025-01-02 8:30 ` Laurent Pinchart
1 sibling, 1 reply; 19+ messages in thread
From: Dmitry Baryshkov @ 2025-01-02 3:26 UTC (permalink / raw)
To: Laurent Pinchart, devicetree, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: Marek Vasut, dri-devel, Andrzej Hajda, David Airlie,
Fabio Estevam, Jernej Skrabec, Jonas Karlman, Liu Ying,
Maarten Lankhorst, Maxime Ripard, Neil Armstrong,
Pengutronix Kernel Team, Robert Foss, Sascha Hauer, Shawn Guo,
Simona Vetter, Stefan Agner, Thomas Zimmermann, imx,
linux-arm-kernel
On Thu, Jan 02, 2025 at 12:36:20AM +0200, Laurent Pinchart wrote:
> On Tue, Dec 31, 2024 at 10:10:51PM +0100, Marek Vasut wrote:
> > On 12/31/24 9:31 PM, Laurent Pinchart wrote:
> > > Hi Marek,
> >
> > Hi,
> >
> > > Thank you for the patch.
> > >
> > > On Tue, Dec 31, 2024 at 08:28:48PM +0100, Marek Vasut wrote:
> > >> Add a flag meant purely to work around broken i.MX8MP DTs which enable
> > >> HDMI but do not contain the HDMI connector node. This flag allows such
> > >> DTs to work by creating the connector in the HDMI bridge driver. Do not
> > >> use this flag, do not proliferate this flag, please fix your DTs.
> > >
> > > What's the rationale for this, what prevents fixing DT instead of using
> > > this flag ? Adding such a flag will most likely open the door to
> > > proliferation.
> >
> > See the V2 series discussion, there are a few in-tree DTs which do not
> > have the HDMI connector node. The rationale is there might be more and
> > they might come from vendors, so this flag is necessary to work around
> > those DTs.
> >
> > > If you can't fix the DT on particular boards, patching it could be an
> > > option. We had a similar problem on Renesas boards, which we fixed with
> > > a DT overlay, see commit 81c0e3dd82927064 ("drm: rcar-du: Fix legacy DT
> > > to create LVDS encoder nodes"). This made the workaround self-contained,
> > > and allowed dropping it several kernel versions later (in commit
> > > 841281fe52a769fe, "drm: rcar-du: Drop LVDS device tree backward
> > > compatibility").
> >
> > Frankly, I would much rather fix the few in-tree DTs and mandate the
> > HDMI connector node in DT, which would keep the code simple, rather than
> > maintain a backward compatibility workaround for problem which might not
> > even exist.
>
> The in-tree device tree sources should be converted as part of the
> series, I don't see a point trying to maintain backward compatibility
> for in-tree DT sources.
DT is an ABI. We are supposed to keep backwards compatibility with
existing device trees (at least for a while). I'm adding DT list and
maintainers to be able to provide comments on this topic.
> For out-of-tree sources it depends on how likely the problem is. There's
> no regression if nobody is affected. I personally like restricting
> backward compatibility to the strict minimum, to ensure that all new DTs
> will use proper bindings. Making the backward compatibility code
> self-contained helps there, and we could also print a loud warning
> (WARN_ON() seems appropriate) and set a date for the removal of the
> workaround.
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [PATCH v3 1/4] drm: bridge: dw_hdmi: Add flag to indicate output port is optional
2025-01-02 3:26 ` Dmitry Baryshkov
@ 2025-01-02 8:30 ` Laurent Pinchart
2025-01-03 5:33 ` Dmitry Baryshkov
0 siblings, 1 reply; 19+ messages in thread
From: Laurent Pinchart @ 2025-01-02 8:30 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: devicetree, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Marek Vasut, dri-devel, Andrzej Hajda, David Airlie,
Fabio Estevam, Jernej Skrabec, Jonas Karlman, Liu Ying,
Maarten Lankhorst, Maxime Ripard, Neil Armstrong,
Pengutronix Kernel Team, Robert Foss, Sascha Hauer, Shawn Guo,
Simona Vetter, Stefan Agner, Thomas Zimmermann, imx,
linux-arm-kernel
On Thu, Jan 02, 2025 at 05:26:50AM +0200, Dmitry Baryshkov wrote:
> On Thu, Jan 02, 2025 at 12:36:20AM +0200, Laurent Pinchart wrote:
> > On Tue, Dec 31, 2024 at 10:10:51PM +0100, Marek Vasut wrote:
> > > On 12/31/24 9:31 PM, Laurent Pinchart wrote:
> > > > Hi Marek,
> > >
> > > Hi,
> > >
> > > > Thank you for the patch.
> > > >
> > > > On Tue, Dec 31, 2024 at 08:28:48PM +0100, Marek Vasut wrote:
> > > >> Add a flag meant purely to work around broken i.MX8MP DTs which enable
> > > >> HDMI but do not contain the HDMI connector node. This flag allows such
> > > >> DTs to work by creating the connector in the HDMI bridge driver. Do not
> > > >> use this flag, do not proliferate this flag, please fix your DTs.
> > > >
> > > > What's the rationale for this, what prevents fixing DT instead of using
> > > > this flag ? Adding such a flag will most likely open the door to
> > > > proliferation.
> > >
> > > See the V2 series discussion, there are a few in-tree DTs which do not
> > > have the HDMI connector node. The rationale is there might be more and
> > > they might come from vendors, so this flag is necessary to work around
> > > those DTs.
> > >
> > > > If you can't fix the DT on particular boards, patching it could be an
> > > > option. We had a similar problem on Renesas boards, which we fixed with
> > > > a DT overlay, see commit 81c0e3dd82927064 ("drm: rcar-du: Fix legacy DT
> > > > to create LVDS encoder nodes"). This made the workaround self-contained,
> > > > and allowed dropping it several kernel versions later (in commit
> > > > 841281fe52a769fe, "drm: rcar-du: Drop LVDS device tree backward
> > > > compatibility").
> > >
> > > Frankly, I would much rather fix the few in-tree DTs and mandate the
> > > HDMI connector node in DT, which would keep the code simple, rather than
> > > maintain a backward compatibility workaround for problem which might not
> > > even exist.
> >
> > The in-tree device tree sources should be converted as part of the
> > series, I don't see a point trying to maintain backward compatibility
> > for in-tree DT sources.
>
> DT is an ABI. We are supposed to keep backwards compatibility with
> existing device trees (at least for a while). I'm adding DT list and
> maintainers to be able to provide comments on this topic.
Backward compatibility is about supporting old DT binaries with a newer
kernel. There's no need to support old DT bindings in in-kernel DT
sources. By definition, if someone compiles a DT from a newer kernel and
installs it along with the newer kernel, there's no "backward"
direction.
The backward compatibility requirements aim at ensuring no breakage when
upgrading the kernel without upgrading the device tree. As I mentioned,
there is no regression if nobody is affected in the first place. Proving
there is no affected DT in the wild is difficult though.
> > For out-of-tree sources it depends on how likely the problem is. There's
> > no regression if nobody is affected. I personally like restricting
> > backward compatibility to the strict minimum, to ensure that all new DTs
> > will use proper bindings. Making the backward compatibility code
> > self-contained helps there, and we could also print a loud warning
> > (WARN_ON() seems appropriate) and set a date for the removal of the
> > workaround.
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [PATCH v3 1/4] drm: bridge: dw_hdmi: Add flag to indicate output port is optional
2025-01-02 8:30 ` Laurent Pinchart
@ 2025-01-03 5:33 ` Dmitry Baryshkov
0 siblings, 0 replies; 19+ messages in thread
From: Dmitry Baryshkov @ 2025-01-03 5:33 UTC (permalink / raw)
To: Laurent Pinchart
Cc: devicetree, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Marek Vasut, dri-devel, Andrzej Hajda, David Airlie,
Fabio Estevam, Jernej Skrabec, Jonas Karlman, Liu Ying,
Maarten Lankhorst, Maxime Ripard, Neil Armstrong,
Pengutronix Kernel Team, Robert Foss, Sascha Hauer, Shawn Guo,
Simona Vetter, Stefan Agner, Thomas Zimmermann, imx,
linux-arm-kernel
On Thu, Jan 02, 2025 at 10:30:38AM +0200, Laurent Pinchart wrote:
> On Thu, Jan 02, 2025 at 05:26:50AM +0200, Dmitry Baryshkov wrote:
> > On Thu, Jan 02, 2025 at 12:36:20AM +0200, Laurent Pinchart wrote:
> > > On Tue, Dec 31, 2024 at 10:10:51PM +0100, Marek Vasut wrote:
> > > > On 12/31/24 9:31 PM, Laurent Pinchart wrote:
> > > > > Hi Marek,
> > > >
> > > > Hi,
> > > >
> > > > > Thank you for the patch.
> > > > >
> > > > > On Tue, Dec 31, 2024 at 08:28:48PM +0100, Marek Vasut wrote:
> > > > >> Add a flag meant purely to work around broken i.MX8MP DTs which enable
> > > > >> HDMI but do not contain the HDMI connector node. This flag allows such
> > > > >> DTs to work by creating the connector in the HDMI bridge driver. Do not
> > > > >> use this flag, do not proliferate this flag, please fix your DTs.
> > > > >
> > > > > What's the rationale for this, what prevents fixing DT instead of using
> > > > > this flag ? Adding such a flag will most likely open the door to
> > > > > proliferation.
> > > >
> > > > See the V2 series discussion, there are a few in-tree DTs which do not
> > > > have the HDMI connector node. The rationale is there might be more and
> > > > they might come from vendors, so this flag is necessary to work around
> > > > those DTs.
> > > >
> > > > > If you can't fix the DT on particular boards, patching it could be an
> > > > > option. We had a similar problem on Renesas boards, which we fixed with
> > > > > a DT overlay, see commit 81c0e3dd82927064 ("drm: rcar-du: Fix legacy DT
> > > > > to create LVDS encoder nodes"). This made the workaround self-contained,
> > > > > and allowed dropping it several kernel versions later (in commit
> > > > > 841281fe52a769fe, "drm: rcar-du: Drop LVDS device tree backward
> > > > > compatibility").
> > > >
> > > > Frankly, I would much rather fix the few in-tree DTs and mandate the
> > > > HDMI connector node in DT, which would keep the code simple, rather than
> > > > maintain a backward compatibility workaround for problem which might not
> > > > even exist.
> > >
> > > The in-tree device tree sources should be converted as part of the
> > > series, I don't see a point trying to maintain backward compatibility
> > > for in-tree DT sources.
> >
> > DT is an ABI. We are supposed to keep backwards compatibility with
> > existing device trees (at least for a while). I'm adding DT list and
> > maintainers to be able to provide comments on this topic.
>
> Backward compatibility is about supporting old DT binaries with a newer
> kernel. There's no need to support old DT bindings in in-kernel DT
> sources. By definition, if someone compiles a DT from a newer kernel and
> installs it along with the newer kernel, there's no "backward"
> direction.
Hmm, nobody is asking to provide compatibility with old DT bindings.
However supporting DTs with no extra "display-connector" bridge after
the DW bridge is exactly "supporting old DT binaries" in my opinion.
> The backward compatibility requirements aim at ensuring no breakage when
> upgrading the kernel without upgrading the device tree. As I mentioned,
> there is no regression if nobody is affected in the first place. Proving
> there is no affected DT in the wild is difficult though.
>
> > > For out-of-tree sources it depends on how likely the problem is. There's
> > > no regression if nobody is affected. I personally like restricting
> > > backward compatibility to the strict minimum, to ensure that all new DTs
> > > will use proper bindings. Making the backward compatibility code
> > > self-contained helps there, and we could also print a loud warning
> > > (WARN_ON() seems appropriate) and set a date for the removal of the
> > > workaround.
>
> --
> Regards,
>
> Laurent Pinchart
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH v3 1/4] drm: bridge: dw_hdmi: Add flag to indicate output port is optional
2024-12-31 19:28 [PATCH v3 1/4] drm: bridge: dw_hdmi: Add flag to indicate output port is optional Marek Vasut
` (3 preceding siblings ...)
2024-12-31 20:31 ` [PATCH v3 1/4] drm: bridge: dw_hdmi: Add flag to indicate output port is optional Laurent Pinchart
@ 2025-01-02 4:51 ` Dmitry Baryshkov
4 siblings, 0 replies; 19+ messages in thread
From: Dmitry Baryshkov @ 2025-01-02 4:51 UTC (permalink / raw)
To: Marek Vasut
Cc: dri-devel, Andrzej Hajda, David Airlie, Fabio Estevam,
Jernej Skrabec, Jonas Karlman, Laurent Pinchart, Liu Ying,
Maarten Lankhorst, Maxime Ripard, Neil Armstrong,
Pengutronix Kernel Team, Robert Foss, Sascha Hauer, Shawn Guo,
Simona Vetter, Stefan Agner, Thomas Zimmermann, imx,
linux-arm-kernel
On Tue, Dec 31, 2024 at 08:28:48PM +0100, Marek Vasut wrote:
> Add a flag meant purely to work around broken i.MX8MP DTs which enable
> HDMI but do not contain the HDMI connector node. This flag allows such
> DTs to work by creating the connector in the HDMI bridge driver. Do not
> use this flag, do not proliferate this flag, please fix your DTs.
>
> Signed-off-by: Marek Vasut <marex@denx.de>
Please describe that it is required for backwards compatibility with the
existing DTs. I think it is a good idea unless Shawn, Sascha or Fabio
tell that we should ignore backwards compatibility.
With that in mind:
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
> Cc: Andrzej Hajda <andrzej.hajda@intel.com>
> Cc: David Airlie <airlied@gmail.com>
> Cc: Fabio Estevam <festevam@gmail.com>
> Cc: Jernej Skrabec <jernej.skrabec@gmail.com>
> Cc: Jonas Karlman <jonas@kwiboo.se>
> Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
> Cc: Liu Ying <victor.liu@nxp.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Neil Armstrong <neil.armstrong@linaro.org>
> Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
> Cc: Robert Foss <rfoss@kernel.org>
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> Cc: Shawn Guo <shawnguo@kernel.org>
> Cc: Simona Vetter <simona@ffwll.ch>
> Cc: Stefan Agner <stefan@agner.ch>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: dri-devel@lists.freedesktop.org
> Cc: imx@lists.linux.dev
> Cc: linux-arm-kernel@lists.infradead.org
> ---
> V3: New patch
> ---
> drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 12 ++++++++----
> include/drm/bridge/dw_hdmi.h | 2 ++
> 2 files changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> index 996733ed2c004..852e73c0f686f 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> @@ -2893,9 +2893,13 @@ static int dw_hdmi_bridge_attach(struct drm_bridge *bridge,
> {
> struct dw_hdmi *hdmi = bridge->driver_private;
>
> - if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)
> - return drm_bridge_attach(bridge->encoder, hdmi->next_bridge,
> - bridge, flags);
> + if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
> + if (hdmi->plat_data->output_port_optional && !hdmi->next_bridge)
> + return dw_hdmi_connector_create(hdmi);
> + else
> + return drm_bridge_attach(bridge->encoder, hdmi->next_bridge,
> + bridge, flags);
> + }
>
> return dw_hdmi_connector_create(hdmi);
> }
> @@ -3298,7 +3302,7 @@ static int dw_hdmi_parse_dt(struct dw_hdmi *hdmi)
> hdmi->plat_data->output_port,
> -1);
> if (!remote)
> - return -ENODEV;
> + return hdmi->plat_data->output_port_optional ? 0 : -ENODEV;
>
> hdmi->next_bridge = of_drm_find_bridge(remote);
> of_node_put(remote);
> diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h
> index 6a46baa0737cd..3bb6e633424a8 100644
> --- a/include/drm/bridge/dw_hdmi.h
> +++ b/include/drm/bridge/dw_hdmi.h
> @@ -127,6 +127,8 @@ struct dw_hdmi_plat_data {
> struct regmap *regm;
>
> unsigned int output_port;
> + /* Used purely by MX8MP HDMI to work around broken DTs without HDMI connector node. */
> + bool output_port_optional;
>
> unsigned long input_bus_encoding;
> bool use_drm_infoframe;
> --
> 2.45.2
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 19+ messages in thread