From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Marek Vasut <marex@denx.de>
Cc: dri-devel@lists.freedesktop.org,
Andrzej Hajda <andrzej.hajda@intel.com>,
David Airlie <airlied@gmail.com>,
Fabio Estevam <festevam@gmail.com>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Jonas Karlman <jonas@kwiboo.se>, Liu Ying <victor.liu@nxp.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Robert Foss <rfoss@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Shawn Guo <shawnguo@kernel.org>, Simona Vetter <simona@ffwll.ch>,
Stefan Agner <stefan@agner.ch>,
Thomas Zimmermann <tzimmermann@suse.de>,
imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v3 1/4] drm: bridge: dw_hdmi: Add flag to indicate output port is optional
Date: Tue, 31 Dec 2024 22:31:36 +0200 [thread overview]
Message-ID: <20241231203136.GD31768@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20241231192925.97614-1-marex@denx.de>
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
next prev parent reply other threads:[~2024-12-31 20:31 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
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
2025-01-02 4:55 ` Dmitry Baryshkov
2025-01-02 23:22 ` Marek Vasut
2025-01-03 5:37 ` 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
2025-01-02 17:58 ` Dmitry Baryshkov
2025-01-02 23:20 ` Marek Vasut
2025-01-03 5:36 ` Dmitry Baryshkov
2024-12-31 19:28 ` [PATCH v3 4/4] drm/mxsfb: " Marek Vasut
2024-12-31 20:31 ` Laurent Pinchart [this message]
2024-12-31 21:10 ` [PATCH v3 1/4] drm: bridge: dw_hdmi: Add flag to indicate output port is optional Marek Vasut
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
2025-01-03 5:33 ` Dmitry Baryshkov
2025-01-02 4:51 ` Dmitry Baryshkov
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=20241231203136.GD31768@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=airlied@gmail.com \
--cc=andrzej.hajda@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=marex@denx.de \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=rfoss@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=simona@ffwll.ch \
--cc=stefan@agner.ch \
--cc=tzimmermann@suse.de \
--cc=victor.liu@nxp.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 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.