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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 AFC67108B8F3 for ; Fri, 20 Mar 2026 10:47:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EC25110EA79; Fri, 20 Mar 2026 10:47:29 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=bootlin.com header.i=@bootlin.com header.b="QFcWkJ82"; dkim-atps=neutral Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6D14010EA79 for ; Fri, 20 Mar 2026 10:47:29 +0000 (UTC) Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 284AF4E4273F; Fri, 20 Mar 2026 10:47:28 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id E3BC3600E0; Fri, 20 Mar 2026 10:47:27 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id CD09B10450B8F; Fri, 20 Mar 2026 11:47:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1774003645; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=epcCiuzdQ1u6Epk9LtsHc2oPHZxzaiyD1zsIWDZOAME=; b=QFcWkJ82ylexSInmRDANxSHTwK9A3hbd2iBAlyZTtBzfzAVgv+6As+Ei0+Wta0tVjL7Ssx SPWbAZ0u+l/hMNJTKx9n3x8MrOPvXLipwrF81cdfYzOsavnoCiPRKtFSo0LHi5nDPIe0V1 o0TYKsw3af8yoeUp8EfMqeVsi48IAE1dl5zsMAoV/ozrOYbRTQptooqq2KXIHLF1vOiuT5 podhqzqMnp+IyZhdUOWauEpLjRYJH86d6kQX5n/BfQNQhEzK6YFTxQqBEguZ4IhG/winEv 8fS+1HybWGBqBpniQ8l5tNxoVC7H5uuhYbZP9DhqxwMgryivMYGSC+b2qs2h6Q== From: Luca Ceresoli Date: Fri, 20 Mar 2026 11:46:16 +0100 Subject: [PATCH 5/8] drm/bridge: dw-hdmi: warn on unsupported attach combination MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260320-drm-lcdif-dbanc-v1-5-479a04133e70@bootlin.com> References: <20260320-drm-lcdif-dbanc-v1-0-479a04133e70@bootlin.com> In-Reply-To: <20260320-drm-lcdif-dbanc-v1-0-479a04133e70@bootlin.com> To: Marek Vasut , Stefan Agner , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Frank Li , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Liu Ying , Rob Herring , Saravana Kannan Cc: "Kory Maincent (TI.com)" , =?utf-8?q?Herv=C3=A9_Codina?= , Hui Pu , Ian Ray , Thomas Petazzoni , 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 , Alexander Stein , Anson Huang , Christopher Obbard , Daniel Scally , Emanuele Ghidoli , Fabio Estevam , Francesco Dolcini , Frieder Schrempf , Gilles Talis , =?utf-8?q?Goran_Ra=C4=91enovi=C4=87?= , Heiko Schocher , Joao Paulo Goncalves , Josua Mayer , =?utf-8?q?Jo=C3=A3o_Paulo_Gon=C3=A7alves?= , Kieran Bingham , Marco Felsch , Martyn Welch , Oleksij Rempel , Peng Fan , Philippe Schenker , Richard Hu , Shengjiu Wang , Stefan Eichenberger , Vitor Soares , Luca Ceresoli X-Mailer: b4 0.14.3 X-Last-TLS-Session-Version: TLSv1.3 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" dw-hdmi can operate in two different modes, depending on the platform data as set by the driver: A. hdmi->plat_data->output_port = 0: the HDMI output (port@1) in device tree is not used B. hdmi->plat_data->output_port = 1: the HDMI output (port@1) is parsed to find the next bridge Only case B is supported when the DRM_BRIDGE_ATTACH_NO_CONNECTOR flag is passed to the attach callback. Emit a warning when this is violated. Also return -EINVAL which would be returned by drm_bridge_attach() right after anyway. Signed-off-by: Luca Ceresoli --- Note: Returning when teh warning triggers does not change the functional behaviour of this function. It is not strictly necessary in this patch but it will have to be done anyway in the following patch. --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index ee88c0e793b0..a668d66aeece 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -2910,6 +2910,10 @@ static int dw_hdmi_bridge_attach(struct drm_bridge *bridge, { struct dw_hdmi *hdmi = bridge->driver_private; + /* DRM_BRIDGE_ATTACH_NO_CONNECTOR requires a remote-endpoint to the next bridge */ + if (WARN_ON((flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) && !hdmi->plat_data->output_port)) + return -EINVAL; + if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) return drm_bridge_attach(encoder, hdmi->bridge.next_bridge, bridge, flags); -- 2.53.0