From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 78DA1E77188 for ; Tue, 31 Dec 2024 20:33:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=6LWfTYzJ/t5AB7f3aqmqWFbGbNadEkvhejTss4AE2pY=; b=W1xnwPpixC1WmsPvTdsu/Kxc9p dg5l3JwLZXpAZTlwrkUY89J+eZEXp/Bp8vj6bvp6DjMof6IRyFRmUqcj3dp/eo05UfpC8zUlQNEag MGm1DJmHSyBjVo1rGntJ3x3B+5iySr67NtEIC2lahW3OsvfZU1XGJD5IfDCke4wNXV5jIfuPbwUSi OLQ7j8vf3sHURXKL7snmV+pemh7wrSEmaqPxEANAA2uGyIu3plMWo8s7Der67/R6eVOl9eA+IBvem 2PiS1Q3xfTogNHtSz9rmP3tgJgC0nwUVZQ40xGaLXcQh9TBs9j251moH9deY2Ag4iv8bhiTLRW9mZ DmZFGkfQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tSivA-00000007idc-3kcR; Tue, 31 Dec 2024 20:32:56 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tSitz-00000007iaL-0hBp for linux-arm-kernel@lists.infradead.org; Tue, 31 Dec 2024 20:31:44 +0000 Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 42A5A1E6; Tue, 31 Dec 2024 21:30:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1735677050; bh=kG+D/lnDclS7q11yLFrQ3G5z3SUsllmGGc3CrYLCNI0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=I+QQXNixBkbtrHbpWlJmbDiCWN8gRN4e9e+EKWvPe+cAW2/Y6RPCWzCHrXT7Re4II ou6MGteZhP8EJfuaKN3cypfznt2DJ6pM+wFJrm9ZOCIzvXItmtxro36aS5P4BFszc9 NAsEIJPtmawdQj2k40RjuRUHSMZvaRGLjuLzXABI= Date: Tue, 31 Dec 2024 22:31:36 +0200 From: Laurent Pinchart To: Marek Vasut Cc: dri-devel@lists.freedesktop.org, 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@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 Message-ID: <20241231203136.GD31768@pendragon.ideasonboard.com> References: <20241231192925.97614-1-marex@denx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20241231192925.97614-1-marex@denx.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241231_123143_366556_43FB70B8 X-CRM114-Status: GOOD ( 23.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 > --- > Cc: Andrzej Hajda > Cc: David Airlie > Cc: Fabio Estevam > Cc: Jernej Skrabec > Cc: Jonas Karlman > Cc: Laurent Pinchart > Cc: Liu Ying > Cc: Maarten Lankhorst > Cc: Maxime Ripard > Cc: Neil Armstrong > Cc: Pengutronix Kernel Team > Cc: Robert Foss > Cc: Sascha Hauer > Cc: Shawn Guo > Cc: Simona Vetter > Cc: Stefan Agner > Cc: Thomas Zimmermann > 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