From nobody Sat Apr 4 00:07:15 2026 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF609376462 for ; Thu, 2 Apr 2026 09:28:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775122091; cv=none; b=N/IrthWLGT66puj3XwJOhVMmK9NrYsDMC/3MhTp7R2xSpQYMhhXws2aaiv3xwvBk7gU7TmaG2HWpSFPjVQXxwOWbmrcPyi2HTnf7Dx77kuYg6m7vvKGbLCDhF09wJn+zmjolIhGuKAkCQeI3rienXuQFxOIUpYLYtLtiffAgU+g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775122091; c=relaxed/simple; bh=xCyOeEb1Rt3PAU0y1z2oi9zSYVPFWqIkwkXXe5MYVu4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dtk9utjPoPnI5ui1rsHWaME9phXK+9aGYeSGA59nLy59+ifiBpn9VvPf7QJupSdelhZOW4uRIp1xDWwvhhSmD/ygwT03yFSCOB12SSwM9CGgii0e+cY9g9bLT66eTPyoC4gL/NP1GLpnch+twXpALMrWag4XDvnDnaN1ORQp+5o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=hVlz+9Zn; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="hVlz+9Zn" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id B1F19C5997C; Thu, 2 Apr 2026 09:28:32 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 4B7785FDEB; Thu, 2 Apr 2026 09:28:01 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 370731045124A; Thu, 2 Apr 2026 11:27:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1775122078; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=ivxqBE+xFSPsodl278KAuSqCfPXljKrE3bnno2mTk08=; b=hVlz+9ZnqMianxoB7Bx50+CIIjxVXe5qIbytykm44W3JHSnVewznEi+DNW9jPvFVrwi6ba YzvUKHNN77HX4FvSEtTVuCdhmhS0b+hf8dmsT8Edh7SPO1JIGN310t8/rmuVoBJWBWp7+E /KlyNk5b15uTL8u4S0qh7K8x0MZ1UW9A/0MVLHRzm+U+KzcvpeJJxvYEuKMz5KyjLXrpor j5g7TTpolsb9+mfgLgBwUHK7rysmnnTEjfYhpDIsxNpBw4BEovs9WMZqANt92VRUA8bPm1 mc3dyY809JLnSVrDqK9a4z1clJwDwXvBjRRj7YhM/r96i688PxwCRNAjgoxMpw== From: Luca Ceresoli Date: Thu, 02 Apr 2026 11:25:56 +0200 Subject: [PATCH v3 01/11] drm/mxsfb/lcdif: simplify remote pointer management using __free Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260402-drm-lcdif-dbanc-v3-1-27cd247a0847@bootlin.com> References: <20260402-drm-lcdif-dbanc-v3-0-27cd247a0847@bootlin.com> In-Reply-To: <20260402-drm-lcdif-dbanc-v3-0-27cd247a0847@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: Damon Ding , "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 , 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 , Josua Mayer , Kieran Bingham , Marco Felsch , Martyn Welch , Oleksij Rempel , Peng Fan , Richard Hu , Shengjiu Wang , Stefan Eichenberger , Vitor Soares , Luca Ceresoli X-Mailer: b4 0.15.1 X-Last-TLS-Session-Version: TLSv1.3 Putting the remote device_node reference requires a of_node_put(remote) in two places. Use a cleanup action to simplify the code. Reviewed-by: Liu Ying Tested-by: Martyn Welch Tested-by: Alexander Stein # TQMa8MPxL/MB= a8MPxL Signed-off-by: Luca Ceresoli --- Changes in v2: - Use the correct cleanup action - Fix commit message - add missing cleanup.h include --- drivers/gpu/drm/mxsfb/lcdif_drv.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdi= f_drv.c index 47da1d9336b9..7719629487da 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_drv.c +++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c @@ -5,6 +5,7 @@ * This code is based on drivers/gpu/drm/mxsfb/mxsfb* */ =20 +#include #include #include #include @@ -53,16 +54,13 @@ static int lcdif_attach_bridge(struct lcdif_drm_private= *lcdif) int ret; =20 for_each_endpoint_of_node(dev->of_node, ep) { - struct device_node *remote; + struct device_node *remote __free(device_node) =3D + of_graph_get_remote_port_parent(ep); struct of_endpoint of_ep; struct drm_encoder *encoder; =20 - remote =3D of_graph_get_remote_port_parent(ep); - if (!of_device_is_available(remote)) { - of_node_put(remote); + if (!of_device_is_available(remote)) continue; - } - of_node_put(remote); =20 ret =3D of_graph_parse_endpoint(ep, &of_ep); if (ret < 0) { --=20 2.53.0 From nobody Sat Apr 4 00:07:15 2026 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D31E390210 for ; Thu, 2 Apr 2026 09:28:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775122101; cv=none; b=dyS0wgvSRgRWqe2DYc9S8+OVx1mbgdANqRun5Wfr6RbOZ+XVZUW84SQr7NIE8eZVXIzX+aZCYVuaSxzDmkLfoyzhWxFjyLUyTjSjK3auHJ9nAAqpjLO+A+bJZGsKO6kVtLO5FqJYIQw1zlpIsWnxyajC/CpVF0OL2/nWIUFJ/S4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775122101; c=relaxed/simple; bh=DGkZabpVSfCZx4qVU8GLozjN/+Zh0JyHCyPpQLjan0k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ImsQId4MCwWCAmWamkiZYRMB2PG4NS8cxmgF6CKqdQpqK/sNkH9CoFLmuzhXGvE5gjMSXjr2HvHnw3lbFdJO+O1if++2G3/nDlthnxYYc7ZR9IPKi1NuP50TubH510C2T/x0a8KO2ogesJjsb8p8Gk0KrPhDVnZ/Z1LE6lsmZD8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=bkTvVYUR; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="bkTvVYUR" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 1CC61C5997A; Thu, 2 Apr 2026 09:28:43 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id AD22C5FDEB; Thu, 2 Apr 2026 09:28:11 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id ED5B910450A10; Thu, 2 Apr 2026 11:27:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1775122089; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=2J+9TG/VyHLnCiKQu2dJ+E2QJC0b8CpVuopBw9nld/w=; b=bkTvVYURYUu2zNWtCug8/esLmZziFcEBaT4+fvEoQ1Lf3RKJ1TlfgvYq8SNDRFkAB4xoug 8VnWf32ovVeFb8rSpT/SHhM0ZP2QIcU9a8jiswcpxMXbcKqbvmf3ZYWo9lzUkHpMN7RaC1 uDjKZNdGpTWuatFV0xEJrYONAsgtGcihxZBZRV6YpXdYVDZBkZ7wf38Gz1rWE/2k5vmIqz ljUq8dAR5zL5gzjiBpiyXpXre66fdQXeTiHxnKhLGxObcGNg4kRPYWfDJGNgSz1ZJ8tUaT BXs8nxEJkllMh53B1510PLvNM5F4t6/rw8bk/T2AFDRUESCPO3ZJAl0+6DFz4w== From: Luca Ceresoli Date: Thu, 02 Apr 2026 11:25:57 +0200 Subject: [PATCH v3 02/11] drm/mxsfb/lcdif: simplify ep pointer management using __free Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260402-drm-lcdif-dbanc-v3-2-27cd247a0847@bootlin.com> References: <20260402-drm-lcdif-dbanc-v3-0-27cd247a0847@bootlin.com> In-Reply-To: <20260402-drm-lcdif-dbanc-v3-0-27cd247a0847@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: Damon Ding , "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 , 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 , Josua Mayer , Kieran Bingham , Marco Felsch , Martyn Welch , Oleksij Rempel , Peng Fan , Richard Hu , Shengjiu Wang , Stefan Eichenberger , Vitor Soares , Luca Ceresoli X-Mailer: b4 0.15.1 X-Last-TLS-Session-Version: TLSv1.3 Putting the ep device_node reference requires a of_node_put(ep) in many return points. Use a cleanup action to simplify the code. Reviewed-by: Liu Ying Signed-off-by: Luca Ceresoli --- This patch is new in v2 --- drivers/gpu/drm/mxsfb/lcdif_drv.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdi= f_drv.c index 7719629487da..8da8a265c05c 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_drv.c +++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c @@ -49,7 +49,7 @@ static const struct drm_encoder_funcs lcdif_encoder_funcs= =3D { static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif) { struct device *dev =3D lcdif->drm->dev; - struct device_node *ep; + struct device_node *ep __free(device_node) =3D NULL; struct drm_bridge *bridge; int ret; =20 @@ -65,23 +65,19 @@ static int lcdif_attach_bridge(struct lcdif_drm_private= *lcdif) ret =3D of_graph_parse_endpoint(ep, &of_ep); if (ret < 0) { dev_err(dev, "Failed to parse endpoint %pOF\n", ep); - of_node_put(ep); return ret; } =20 bridge =3D devm_drm_of_get_bridge(dev, dev->of_node, 0, of_ep.id); - if (IS_ERR(bridge)) { - of_node_put(ep); + if (IS_ERR(bridge)) return dev_err_probe(dev, PTR_ERR(bridge), "Failed to get bridge for endpoint%u\n", of_ep.id); - } =20 encoder =3D devm_kzalloc(dev, sizeof(*encoder), GFP_KERNEL); if (!encoder) { dev_err(dev, "Failed to allocate encoder for endpoint%u\n", of_ep.id); - of_node_put(ep); return -ENOMEM; } =20 @@ -91,17 +87,14 @@ static int lcdif_attach_bridge(struct lcdif_drm_private= *lcdif) if (ret) { dev_err(dev, "Failed to initialize encoder for endpoint%u: %d\n", of_ep.id, ret); - of_node_put(ep); return ret; } =20 ret =3D drm_bridge_attach(encoder, bridge, NULL, 0); - if (ret) { - of_node_put(ep); + if (ret) return dev_err_probe(dev, ret, "Failed to attach bridge for endpoint%u\n", of_ep.id); - } } =20 return 0; --=20 2.53.0 From nobody Sat Apr 4 00:07:15 2026 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F37639B96D; Thu, 2 Apr 2026 09:28:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775122111; cv=none; b=GM+ntg5vOsmLOSrZBvFKKpgweWcHWGJQz2VXXDd/Ay8tR8z+kCuK8Z/xKEqmRM//xC7jAOLMNmlT9YPpeeRuUagaMiBHOtgnrdVYkMFMJAZ7Club/INL7NyLscf+N0POcrEbHlZ/etlw2SVWsUr1zWOfoQWr7EaHCp859l7GkE8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775122111; c=relaxed/simple; bh=Z7kb2aE54+QuKt5gSLGA3OdsRlW+0ZynW14bsb2t4H4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VXVUeDE5OOttnsCUD7a53q4+aMOYwatDFVRP3oUgLTNgQEYrrjExbOnpP1wi/whpJh25s42SMppNb5lisKi5zEq+WLHy3eYLin+HOidll7B6364sY0EpxEUdA0ytpz5wS0cKYX0UtMgJ2atMm5OFUq/mGoZOh4JUru/cCG6iJuw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=ybESKDBF; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="ybESKDBF" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 8F625C5997C; Thu, 2 Apr 2026 09:28:52 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 2B5795FDEB; Thu, 2 Apr 2026 09:28:21 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id BFCE91045124B; Thu, 2 Apr 2026 11:28:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1775122098; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=tOjdeuEJSWPxj3Fs9X+nTEnL9KUNbNsb5gEjP8lRQd4=; b=ybESKDBFka9/Qsny5X1t28Lfl4WST2SPefv5383qr6vzDmDDd3dcOUUb5sgKbZnoAy39Qh 9BHkHHOiM5Tr7pDFWrF5YjmAw2ekft+WeR29rwxMwtFnntq4FjgfwXaRGhmZSm9dPCzaNR Gt2vbXCurP4heshfbWhIA8h4k4iZbnnlWso8pZM5v/wff6IB1HXLb/Bmsuo384Z4FOglGn k0Emj7dPOAp8dmMM3tHEF90LCa70gnGu94KvWES26kfwhunV3S1i2DohgFETPA0Ire4XR8 hhoyw2ppddALO8aHCsVMVALU7Jyxe9LsoL968zSBcqu6p37NieU4OZfCGUHhQg== From: Luca Ceresoli Date: Thu, 02 Apr 2026 11:25:58 +0200 Subject: [PATCH v3 03/11] drm/mxsfb/lcdif: use dev_err_probe() consistently in lcdif_attach_bridge Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260402-drm-lcdif-dbanc-v3-3-27cd247a0847@bootlin.com> References: <20260402-drm-lcdif-dbanc-v3-0-27cd247a0847@bootlin.com> In-Reply-To: <20260402-drm-lcdif-dbanc-v3-0-27cd247a0847@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: Damon Ding , "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 , 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 , Josua Mayer , Kieran Bingham , Marco Felsch , Martyn Welch , Oleksij Rempel , Peng Fan , Richard Hu , Shengjiu Wang , Stefan Eichenberger , Vitor Soares , Luca Ceresoli X-Mailer: b4 0.15.1 X-Last-TLS-Session-Version: TLSv1.3 lcdif_attach_bridge() uses dev_err_probe() in some error paths, dev_err() + return in others. Use dev_err_probe() for all of them to make code consistent, simpler and with better error reporting. Reviewed-by: Liu Ying Signed-off-by: Luca Ceresoli --- Changes in v2: - rewrote after removal of previous patch removing loop - not added review/test trailers as the code is a bit different --- drivers/gpu/drm/mxsfb/lcdif_drv.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdi= f_drv.c index 8da8a265c05c..1c76709c4d94 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_drv.c +++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c @@ -63,10 +63,8 @@ static int lcdif_attach_bridge(struct lcdif_drm_private = *lcdif) continue; =20 ret =3D of_graph_parse_endpoint(ep, &of_ep); - if (ret < 0) { - dev_err(dev, "Failed to parse endpoint %pOF\n", ep); - return ret; - } + if (ret < 0) + return dev_err_probe(dev, ret, "Failed to parse endpoint %pOF\n", ep); =20 bridge =3D devm_drm_of_get_bridge(dev, dev->of_node, 0, of_ep.id); if (IS_ERR(bridge)) @@ -75,20 +73,18 @@ static int lcdif_attach_bridge(struct lcdif_drm_private= *lcdif) of_ep.id); =20 encoder =3D devm_kzalloc(dev, sizeof(*encoder), GFP_KERNEL); - if (!encoder) { - dev_err(dev, "Failed to allocate encoder for endpoint%u\n", - of_ep.id); - return -ENOMEM; - } + if (!encoder) + return dev_err_probe(dev, -ENOMEM, + "Failed to allocate encoder for endpoint%u\n", + of_ep.id); =20 encoder->possible_crtcs =3D drm_crtc_mask(&lcdif->crtc); ret =3D drm_encoder_init(lcdif->drm, encoder, &lcdif_encoder_funcs, DRM_MODE_ENCODER_NONE, NULL); - if (ret) { - dev_err(dev, "Failed to initialize encoder for endpoint%u: %d\n", - of_ep.id, ret); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, + "Failed to initialize encoder for endpoint%u\n", + of_ep.id); =20 ret =3D drm_bridge_attach(encoder, bridge, NULL, 0); if (ret) --=20 2.53.0 From nobody Sat Apr 4 00:07:15 2026 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B3E213A641D for ; Thu, 2 Apr 2026 09:28:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775122120; cv=none; b=AUEVIRMbhY3hyDQBMpTcsUaj/ckkcwFnCdeF/003CeTWDx73RfqZpoM54g0XTnjOYs05JKvi8tGGEBzAqpGYuf38sKZiKmF2wYoGy2n+Hsxx0mbXZLQ7GcIebaRvsDeU1EGtI0mYu/Ygu6MBJE9Fv3OE4tcTiE6UvfUYVMI8d1A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775122120; c=relaxed/simple; bh=UJYUBA6ET+yM37aBgW281u33EpVs8seVEJrplzB74GI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pNWyXs8/qh8jqfVD0hgz1Ejkf0qdUAvt9jQNqZiScbxOq0EDnKvnZUPpkjDdrTITreyb3kSTsLc9VLzZ1B4zq3TalRYsx92iE8VpoduB+0shsdGjkUFjZdfFvoYoAX+xQbk0C5fd4qzsaTAqJucTpy03da8xTl73HM457TZREQY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=zzi2g1uS; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="zzi2g1uS" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id AD4164E428AF; Thu, 2 Apr 2026 09:28:30 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 8036D5FDEB; Thu, 2 Apr 2026 09:28:30 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id EFFDD10450A10; Thu, 2 Apr 2026 11:28:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1775122108; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=oXPHqei+U7ksW/Xw4NWOUrsKnnTyyMwWEG+TcIgOTII=; b=zzi2g1uSnI45czqCylTxib+o2mbRy+v8D8cyGtklGrM4d72mxCrcRTxZCIwhneYOZEaWDw z6r+JMrO77WSoo697t8Yu2JLyBzl2RauHfMYOePvpWv/3YQtxT6Hz2gEWyvjYbknJOAkbj WtV0umn22Q9nsOuMUvsSV3x7dIUhw5UH5IKaDfpLujzhxuVdQgsQl/ErePsokovuWSxhf4 H6lwGwa7jLAlcuG3xk6SfFq8GqGJM4ysg7Jk+6dxhiat11xCQ29te9nQf9QmyVQH5kx688 DAd2vqogMlmIXzSHEBuL4pBbUcL45ESzMIzb0zMz1HG02UHfbrR1himnB/F3CQ== From: Luca Ceresoli Date: Thu, 02 Apr 2026 11:25:59 +0200 Subject: [PATCH v3 04/11] drm/mxsfb/lcdif: move iteration-specific variables declaration inside loop in lcdif_attach_bridge Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260402-drm-lcdif-dbanc-v3-4-27cd247a0847@bootlin.com> References: <20260402-drm-lcdif-dbanc-v3-0-27cd247a0847@bootlin.com> In-Reply-To: <20260402-drm-lcdif-dbanc-v3-0-27cd247a0847@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: Damon Ding , "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 , 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 , Josua Mayer , Kieran Bingham , Marco Felsch , Martyn Welch , Oleksij Rempel , Peng Fan , Richard Hu , Shengjiu Wang , Stefan Eichenberger , Vitor Soares , Luca Ceresoli X-Mailer: b4 0.15.1 X-Last-TLS-Session-Version: TLSv1.3 The bridge and ret variables are per-iteration variables, whose values don't have to be carried to the next iteration or be used after the loop end. Move their declaration inside the loop scope as a cleanup and to make code clearer. Reviewed-by: Liu Ying Signed-off-by: Luca Ceresoli --- This patch is new in v2 --- drivers/gpu/drm/mxsfb/lcdif_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdi= f_drv.c index 1c76709c4d94..c8ba8f9b1da8 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_drv.c +++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c @@ -50,14 +50,14 @@ static int lcdif_attach_bridge(struct lcdif_drm_private= *lcdif) { struct device *dev =3D lcdif->drm->dev; struct device_node *ep __free(device_node) =3D NULL; - struct drm_bridge *bridge; - int ret; =20 for_each_endpoint_of_node(dev->of_node, ep) { struct device_node *remote __free(device_node) =3D of_graph_get_remote_port_parent(ep); struct of_endpoint of_ep; + struct drm_bridge *bridge; struct drm_encoder *encoder; + int ret; =20 if (!of_device_is_available(remote)) continue; --=20 2.53.0 From nobody Sat Apr 4 00:07:15 2026 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7056639B962; Thu, 2 Apr 2026 09:28:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775122129; cv=none; b=Vi5XBEhq0jsiYsj6EzDTkSGtKvTDziaupN/XeLmQRdD9/bSlSdvN1RoJb6zMm9Wh9OCIvxtV4oUgEtxmE0Byi4PBD6vjxauRrYfS1vnpCBtrt+ze+ZUQcpKlbKs0sHq7M9ySLGj98gY1kSGvj9pbjg8Yhgzn5YDAvAL/EKGMN4w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775122129; c=relaxed/simple; bh=24WG6yBEbIglRrt99esTFTvgIKmJl6XmDTipG9SiJhc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=uq+ZGObcNdhdhz+uX6sFTHSgrlcuUmi+78ziTWgpPcMlkH4CyFGSN7jCmzSn+X7r/ZC2C3xhYIAARFVS2yjIpvw5+JAsdewyblvLXBLxX8Bo4surSgyjhF4Nh8A4DHymux/1OZ7kX/I4e6XS/yY/V14vlffoRIDfLrsAiFYnbxk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=EG8hT0dQ; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="EG8hT0dQ" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id A72B2C5997B; Thu, 2 Apr 2026 09:29:10 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 457995FDEB; Thu, 2 Apr 2026 09:28:39 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 8E5731045124A; Thu, 2 Apr 2026 11:28:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1775122117; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=nES+87hWbwT2iR0Vz2APs/uraUQVlRUrsIwGeaZMI34=; b=EG8hT0dQCdewbxgn5ygCU1y2WgOivKTrg4Kt4LfshtrYAXJsCzTIiNeXB5JNhYUvv854mM zOzE6Vh4pjmcFNi87LaeFdvBlxwdPu+7mJ+uCoEcCYoeyQ8YQYGvilBrwy3vtiGUM6p33y HGF05p2kZPNatl0CRTNWhxyzF41qmDboUxDidCrCKxLC/+gVrccuBF/ij9lUrCehBLb/2V 0cH0RUWiuKyEOUUp8RpQn+Whc0D9jgdVppSD0uKmlRasROBHjwq0YY6Ul5BF2MAWCPZ4Jo gaYq1KZExEzoCtJdg3atUj6x1wMeZ+O4Ii1MI+KOAKkpzitiBrPj4V8JtgjAdA== From: Luca Ceresoli Date: Thu, 02 Apr 2026 11:26:00 +0200 Subject: [PATCH v3 05/11] drm/bridge: dw-hdmi: document the output_port field Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260402-drm-lcdif-dbanc-v3-5-27cd247a0847@bootlin.com> References: <20260402-drm-lcdif-dbanc-v3-0-27cd247a0847@bootlin.com> In-Reply-To: <20260402-drm-lcdif-dbanc-v3-0-27cd247a0847@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: Damon Ding , "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 , 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 , Josua Mayer , Kieran Bingham , Marco Felsch , Martyn Welch , Oleksij Rempel , Peng Fan , Richard Hu , Shengjiu Wang , Stefan Eichenberger , Vitor Soares , Luca Ceresoli X-Mailer: b4 0.15.1 X-Last-TLS-Session-Version: TLSv1.3 The meaning of this flag may not be obvious at first sight. Reviewed-by: Liu Ying Tested-by: Martyn Welch Tested-by: Alexander Stein # TQMa8MPxL/MB= a8MPxL Tested-by: Damon Ding # rk3399 Signed-off-by: Luca Ceresoli --- Changes in v2: - improved comment as suggested by Liu --- include/drm/bridge/dw_hdmi.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h index 336f062e1f9d..8500dd4f99d8 100644 --- a/include/drm/bridge/dw_hdmi.h +++ b/include/drm/bridge/dw_hdmi.h @@ -126,6 +126,12 @@ struct dw_hdmi_phy_ops { struct dw_hdmi_plat_data { struct regmap *regm; =20 + /* + * The HDMI output port number must be 1 if the port is described + * in the device tree. 0 if the device tree does not describe the + * next component (legacy mode, i.e. without + * DRM_BRIDGE_ATTACH_NO_CONNECTOR flag when attaching bridge). + */ unsigned int output_port; =20 unsigned long input_bus_encoding; --=20 2.53.0 From nobody Sat Apr 4 00:07:15 2026 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EA04D39C010 for ; Thu, 2 Apr 2026 09:28:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775122140; cv=none; b=GqWMawJGMYUH6lse0fE3q8rKFQYgFWB3jCUsuI/rFQrvLe1xDYfM2R6QcrcvfGbrSYy1Ri1KzrykdkEdQ7LjJ0oMkX+emwfGwWMbGXXR67kOaBwSgHJHCbnbACDLdfEiixmYFVwwvmkPxMcHStxGzTdCWbBIaL1NJhypWdgVBLU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775122140; c=relaxed/simple; bh=05H3Pzy/5L+Nd1htD9Y4GQp3HbECILuMzhfqpDhwccU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=g1hUikm8eWpbi0/yfa0CYQ0GW9Jkr7Pq4jQDbD8EAFw2eyIr/0DufESGEFHF0ol58F1IIymPX2VWbFN1uIrLYBrXxoIkDuUkepvL+a+v9mhq3LuR86989us0HcE0UMx9e+vRIwS0MOb9rUbS2IwFhwlBWQ1w00rPy5nLtyWvj2k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=gfh4Rf9k; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="gfh4Rf9k" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 18084C5997A; Thu, 2 Apr 2026 09:29:20 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id A94E65FDEB; Thu, 2 Apr 2026 09:28:48 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 69D6810451269; Thu, 2 Apr 2026 11:28:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1775122126; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=+OKVbnh4D/eet/8za6HYYuOE7r3CKZI7MjkoaZhFD+M=; b=gfh4Rf9kOlkm0cnjFhVPxI4iXOBekB0zFv6omI9j0x9T4DOq3T9Qg76VTTRSW20XmfFKZZ kZbmLA18mQMo1DQeZl+Q2hroRsDCGD2PjtuWLBuBrtR7Vc3aibiNNNlFNuh5cEHldL2rJ3 NRmemYC6aP3p6e7yLz79V0Buhpb9O2SDlj8FWioT273yi65yo4/Y2Ttd2GnFEXpqxiPmQ4 GBALxjJnsLFQKspLnjKd+TrIkr6dn/7pC7yZpn0wtgHwEB1ZnhtNihWLFSmII+piEsnkNX FF0B1Sqt9npi9tnryVgugD/exHMgjFEF6JrQCjTiAv7c5UrMK99HJHxwnNFbnw== From: Luca Ceresoli Date: Thu, 02 Apr 2026 11:26:01 +0200 Subject: [PATCH v3 06/11] drm/bridge: dw-hdmi: warn on unsupported attach combination Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260402-drm-lcdif-dbanc-v3-6-27cd247a0847@bootlin.com> References: <20260402-drm-lcdif-dbanc-v3-0-27cd247a0847@bootlin.com> In-Reply-To: <20260402-drm-lcdif-dbanc-v3-0-27cd247a0847@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: Damon Ding , "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 , 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 , Josua Mayer , Kieran Bingham , Marco Felsch , Martyn Welch , Oleksij Rempel , Peng Fan , Richard Hu , Shengjiu Wang , Stefan Eichenberger , Vitor Soares , Luca Ceresoli X-Mailer: b4 0.15.1 X-Last-TLS-Session-Version: TLSv1.3 dw-hdmi can operate in two different modes, depending on the platform data as set by the driver: A. hdmi->plat_data->output_port =3D 0: the HDMI output (port@1) in device tree is not used B. hdmi->plat_data->output_port =3D 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. Reviewed-by: Liu Ying Tested-by: Martyn Welch Tested-by: Alexander Stein # TQMa8MPxL/MB= a8MPxL Tested-by: Damon Ding # rk3399 Signed-off-by: Luca Ceresoli --- Note: Returning when the 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/br= idge/synopsys/dw-hdmi.c index 0296e110ce65..ab1a6a8783cd 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 =3D bridge->driver_private; =20 + /* 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); --=20 2.53.0 From nobody Sat Apr 4 00:07:15 2026 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5FB24396D2A; Thu, 2 Apr 2026 09:29:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775122155; cv=none; b=dlbfQPS7clldnVrhERTDUiMfbqsEkgrrCU5Z6FuBcFcQ6ECynMe7vspMYcBr07hwWC5GUTIiLCmNAkXXS2PUaBK6rPqozeRZsch/jeLFloW4qQk4T1ksRmOtwosWUZ/ixe77i8Vhs8nHq/JAi0ca5+JyV2/wwgpR1lsO4l/ebH8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775122155; c=relaxed/simple; bh=kzRJ0oJa/Zcsh1hbeO9DstRQpwVqFH/JmMMnA1SD13o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FK3k5RqGfdTAeqLdATznQj1KeUbLJEvVs04/vtJNhcWQPLSiOgkf0VOygEtFfKVBvQoQLkqhXaF26ns2iI4FyyB4cvWKOp4N/PtYBE6q+VMx4qrxy5RPzMS87t7qY3TqbbgV/HEJv6lq75D5PAXc4mnMqVD5TovqgY6vdScU6jA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=bpVyTLM/; arc=none smtp.client-ip=185.246.84.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="bpVyTLM/" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id B196E1A30F1; Thu, 2 Apr 2026 09:28:59 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 814D25FDEB; Thu, 2 Apr 2026 09:28:59 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id EA28410450A10; Thu, 2 Apr 2026 11:28:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1775122136; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=pzQa4LFTxQ05HmhgeiPTDH3E+TPAwdvNa3fkB5+WstU=; b=bpVyTLM/HvorqoMr7X5qp8JVDT4ql864Pt6NUE/XMakMFkybxl7001h+pLgJx5hZRbaPP7 I3tdH3KU3f8CVg4PINMIcvV+KEcYCjih8Jp/+CAumYOC29b7uQ83qkp3srhkyHY1jLctbv ozVjj7WEwk+wH4pQN5i/YQx3dSl9eoVtMGj30lUgtiWyMiMG0/8VPptOxwc61RV6AELufM 9kSS4IrEE5i75008f9f1Zj1G/NPBniOcCOL0d49MmlJupJWqr/bnnH3AXkGJzaCJofMiAh TDCK4e/qN5UjcB16PAttrVUzhpUAmV1pF/KRLqmGq+yC0DwkOBn2h3N+3x77OQ== From: Luca Ceresoli Date: Thu, 02 Apr 2026 11:26:02 +0200 Subject: [PATCH v3 07/11] drm/bridge: dw-hdmi: move next_bridge lookup to attach time Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260402-drm-lcdif-dbanc-v3-7-27cd247a0847@bootlin.com> References: <20260402-drm-lcdif-dbanc-v3-0-27cd247a0847@bootlin.com> In-Reply-To: <20260402-drm-lcdif-dbanc-v3-0-27cd247a0847@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: Damon Ding , "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 , 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 , Josua Mayer , Kieran Bingham , Marco Felsch , Martyn Welch , Oleksij Rempel , Peng Fan , Richard Hu , Shengjiu Wang , Stefan Eichenberger , Vitor Soares , Luca Ceresoli X-Mailer: b4 0.15.1 X-Last-TLS-Session-Version: TLSv1.3 This driver looks up the next_bridge at probe time and stores it in hdmi->bridge.next_bridge, but only uses the stored value when attaching, and only in the DRM_BRIDGE_ATTACH_NO_CONNECTOR case. This will be problematic with an upcoming change, adding an hdmi-connector using a device tree overlay when not present. That change is in turn necessary to migrate the i.MX LCDIF driver to the bridge-connector. The problem is that, adding the hdmi-connector via an overlay, devlink considers hdmi-connector a consumer of the dw-hdmi device, generating a chicken-egg problem: * hdmi-connector probe won't be tried until dw-hdmi is probed (devlink) * dw-hdmi probe will defer until it finds the next_bridge (the hdmi-connector wrapper bridge) In preparation for those changes, move the next_bridge lookup from probe to attach, when it is actually used. This allows dw-hdmi to probe, so that the hdmi-connector can probe as well. Also avoid storing the pointer in hdmi->bridge.next_bridge: the value is computed when needed, thus a local variable is enough. Finally, this also allows to slightly improve the code by not doing any DT lookup in the !DRM_BRIDGE_ATTACH_NO_CONNECTOR case. Tested-by: Martyn Welch Tested-by: Alexander Stein # TQMa8MPxL/MB= a8MPxL Acked-by: Liu Ying Tested-by: Damon Ding # rk3399 Signed-off-by: Luca Ceresoli --- Changes in v2: - Fix returned error codes - Added missing cleanup.h include --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 45 +++++++++++----------------= ---- 1 file changed, 16 insertions(+), 29 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/br= idge/synopsys/dw-hdmi.c index ab1a6a8783cd..f4a1ebb79716 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -6,6 +6,8 @@ * Copyright (C) 2011-2013 Freescale Semiconductor, Inc. * Copyright (C) 2010, Guennadi Liakhovetski */ + +#include #include #include #include @@ -2914,9 +2916,20 @@ static int dw_hdmi_bridge_attach(struct drm_bridge *= bridge, if (WARN_ON((flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) && !hdmi->plat_data-= >output_port)) return -EINVAL; =20 - if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) - return drm_bridge_attach(encoder, hdmi->bridge.next_bridge, - bridge, flags); + if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) { + struct device_node *remote __free(device_node) =3D + of_graph_get_remote_node(hdmi->dev->of_node, + hdmi->plat_data->output_port, -1); + if (!remote) + return -ENODEV; + + struct drm_bridge *next_bridge __free(drm_bridge_put) =3D + of_drm_find_and_get_bridge(remote); + if (!next_bridge) + return -EPROBE_DEFER; + + return drm_bridge_attach(encoder, next_bridge, bridge, flags); + } =20 return dw_hdmi_connector_create(hdmi); } @@ -3307,28 +3320,6 @@ static void dw_hdmi_init_hw(struct dw_hdmi *hdmi) * Probe/remove API, used from platforms based on the DRM bridge API. */ =20 -static int dw_hdmi_parse_dt(struct dw_hdmi *hdmi) -{ - struct device_node *remote; - - if (!hdmi->plat_data->output_port) - return 0; - - - remote =3D of_graph_get_remote_node(hdmi->dev->of_node, - hdmi->plat_data->output_port, - -1); - if (!remote) - return -ENODEV; - - hdmi->bridge.next_bridge =3D of_drm_find_and_get_bridge(remote); - of_node_put(remote); - if (!hdmi->bridge.next_bridge) - return -EPROBE_DEFER; - - return 0; -} - bool dw_hdmi_bus_fmt_is_420(struct dw_hdmi *hdmi) { return hdmi_bus_fmt_is_yuv420(hdmi->hdmi_data.enc_out_bus_format); @@ -3373,10 +3364,6 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device= *pdev, mutex_init(&hdmi->cec_notifier_mutex); spin_lock_init(&hdmi->audio_lock); =20 - ret =3D dw_hdmi_parse_dt(hdmi); - if (ret < 0) - return ERR_PTR(ret); - ddc_node =3D of_parse_phandle(np, "ddc-i2c-bus", 0); if (ddc_node) { hdmi->ddc =3D of_get_i2c_adapter_by_node(ddc_node); --=20 2.53.0 From nobody Sat Apr 4 00:07:15 2026 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C5EB53B0ACD; Thu, 2 Apr 2026 09:29:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775122166; cv=none; b=VA/s9UOOoQ5mK2xAzDlPUfCWaPMTAZ7nBaPQhx8zF+BrZhzSVhOLeNuokV2Pt9OHcUOflMMdtAstrGJN4KUuTdwm7DqhTu0U96IKUkM3FfnO/gbbhzdtBkZzaoUMKNjHjE07hSlQztBZy0krxRcOOoNiXrpQICVN+/0Pd0ywW6U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775122166; c=relaxed/simple; bh=5EqUqdVvOTrQiTrvaxRenZOjBON0b0iJFugMnigCrxA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ungFBJ1dSuOHUoBKexnOJycMrDAnAshfgGYyADOw7ZbVait6ACBXt3pmV7+uTBvP/EvsY8NkkaADYiNu4xxHShtA0X14HbwD61rZocB/FKAAM3zhaXAgMMiBZ21zENkiSBSXzR6PsuePpYS6IIlZiUsql1KuFawG3KnXRTQD/hQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=qqiBvKaB; arc=none smtp.client-ip=185.246.84.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="qqiBvKaB" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id 6D5061A30EE; Thu, 2 Apr 2026 09:29:09 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 3FB0C5FDEB; Thu, 2 Apr 2026 09:29:09 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 4188F104511F1; Thu, 2 Apr 2026 11:28:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1775122146; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=ycylMJ2phWw42VkFbtVY/+vSn6tlIsCDBpwLlA9ymTY=; b=qqiBvKaB3Yld1X7FX7HeBsnDsLwVpMLhKqCZDDoeG2EePpQuqDPupAa0Rjf5CoDAkXBmX0 AVdWJaiyNbcCwqabavaPOP7/aPrasKHRh2YjoXDFI9ff3g59KnkXGJS+azHeeDICoH5HDS GO3cpjsJgMSUxF6ew+dhMhF/XqHDbJimDFuw4CiNrFLxdwD2dQ1bA4B03HVvLQpzdkTMgQ C39woo712BHVzcxr6DVhPfv7oqEb2920JKK/xCLV7FbIO04Elru71xsBIhhFA6zs2884y6 257j9RxMm6xSf4hASUF/k9619VbbVG9cFMKYBuh1BejVKlRvFhQRgY5RxAvVrw== From: Luca Ceresoli Date: Thu, 02 Apr 2026 11:26:03 +0200 Subject: [PATCH v3 08/11] drm/bridge: imx8mp-hdmi-tx-connector-fixup: add an hdmi-connector when missing using a DT overlay at boot time Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260402-drm-lcdif-dbanc-v3-8-27cd247a0847@bootlin.com> References: <20260402-drm-lcdif-dbanc-v3-0-27cd247a0847@bootlin.com> In-Reply-To: <20260402-drm-lcdif-dbanc-v3-0-27cd247a0847@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: Damon Ding , "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 , 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 , Josua Mayer , Kieran Bingham , Marco Felsch , Martyn Welch , Oleksij Rempel , Peng Fan , Richard Hu , Shengjiu Wang , Stefan Eichenberger , Vitor Soares , Luca Ceresoli X-Mailer: b4 0.15.1 X-Last-TLS-Session-Version: TLSv1.3 The imx8mp-hdmi-tx is one of many drivers based on dw-hdmi. dw-hdmi in turn can operate in two different modes, depending on the platform data as set by the driver: A. hdmi->plat_data->output_port =3D 0: the HDMI output (port@1) in device tree is not used [0] B. hdmi->plat_data->output_port =3D 1: the HDMI output (port@1) is parsed to find the next bridge The imx8mp-hdmi-tx driver falls in case A. This implies next_bridge will always be NULL, and so dw_hdmi_bridge_attach() [1] will always fail if called with the DRM_BRIDGE_ATTACH_NO_CONNECTOR flag. In fact case A assumes that DRM_BRIDGE_ATTACH_NO_CONNECTOR is not set and in that case it adds an HDMI Type A connector programmatically at bridge attach time. Support for DRM_BRIDGE_ATTACH_NO_CONNECTOR is implemented by dw-hdmi.c in case B. However switching to base B requires that port@1 is connected to a "next bridge" DT node, typically the HDMI connector, because dw-hdmi won't add the connector when using DRM_BRIDGE_ATTACH_NO_CONNECTOR. Many dts files for imx8mp-based boards in the kernel have such a connector described and linked to port@1, so the pipeline will be fully attached up to a display-connector and a drm_connector added by the bridge-connector. Sadly some of those dts files don't have the connector described. Adding it would solve the problem easily, but this would break existing devices which do not update the dtb when upgrading to a newer kernel. In preparation for switching to case B while preserving backward compatibility for such devices, introduce a module adding the hdmi-connector node to the live device tree at init time. This will allow the dw-hdmi code to find the next bridge (the one wrapping the hdmi-connector) and let the pipeline work as before. The module is inserted only if there is no endpoint in port@1. So boards whose device tree describe the connector will not have the device tre modified, and will start isntantiating the correct HDMI connector type as described in the device tree. For boards lacking a connector description in DT the overlay will be added, abd the HDMI connector will be Type A, which is a reasonable fallback and is what the driver is currently doing. [0] https://elixir.bootlin.com/linux/v7.0-rc1/source/drivers/gpu/drm/bridge= /synopsys/dw-hdmi.c#L3310 [1] https://elixir.bootlin.com/linux/v7.0-rc1/source/drivers/gpu/drm/bridge= /synopsys/dw-hdmi.c#L2907 Signed-off-by: Luca Ceresoli --- Changes in v3: - removed unused variable - simplified overlay using full path to port@1 - handle of_overlay_fdt_apply() errors - use of_graph_get_endpoint_by_regs() for more robust endpoint lookup - improve subject line Changes in v2: - don't apply the overlay if the SoC is not i.MX8MP - build unconditionally, but depend on DRM_IMX_LCDIF - remove useless error check - add missing cleanup.h and init.h includes, remove unneeded includes - avoid dtc warnings on overlay - fix typo in Kconfig help text - not added the Tested-bys because the code has changed - split the 'plat_data->output_port =3D 1' line to a separate patch - improve commit message This patch is inspired by commit 0ff223d99147 ("drm/tilcdc: Convert legacy panel binding via DT overlay at boot time") --- drivers/gpu/drm/bridge/imx/Kconfig | 18 +++++++ drivers/gpu/drm/bridge/imx/Makefile | 2 + .../bridge/imx/imx8mp-hdmi-tx-connector-fixup.c | 58 ++++++++++++++++++= ++++ .../bridge/imx/imx8mp-hdmi-tx-connector-fixup.dtso | 33 ++++++++++++ 4 files changed, 111 insertions(+) diff --git a/drivers/gpu/drm/bridge/imx/Kconfig b/drivers/gpu/drm/bridge/im= x/Kconfig index b9028a5e5a06..49f074559b00 100644 --- a/drivers/gpu/drm/bridge/imx/Kconfig +++ b/drivers/gpu/drm/bridge/imx/Kconfig @@ -18,6 +18,8 @@ config DRM_IMX8MP_DW_HDMI_BRIDGE depends on OF depends on COMMON_CLK select DRM_DW_HDMI + select OF_OVERLAY + select DRM_DISPLAY_CONNECTOR imply DRM_IMX8MP_HDMI_PAI imply DRM_IMX8MP_HDMI_PVI imply PHY_FSL_SAMSUNG_HDMI_PHY @@ -25,6 +27,22 @@ config DRM_IMX8MP_DW_HDMI_BRIDGE Choose this to enable support for the internal HDMI encoder found on the i.MX8MP SoC. =20 +config DRM_IMX8MP_DW_HDMI_BRIDGE_CONNECTOR_FIXUP + bool + default y + depends on DRM_IMX_LCDIF + depends on DRM_IMX8MP_DW_HDMI_BRIDGE + depends on OF + help + Modifies at early boot the live device tree of boards using the + i.MX8MP fsl,imx8mp-hdmi-tx adding a hdmi-connector node linked to + the hdmi-tx. This is needed to support bridge-connector usage in + the i.MX8MP LCDIF driver. + + You need this if you use the i.MX8MP HDMI output and your board + device tree file does not have an hdmi-connector node connected + to it. + config DRM_IMX8MP_HDMI_PAI tristate "Freescale i.MX8MP HDMI PAI bridge support" depends on OF diff --git a/drivers/gpu/drm/bridge/imx/Makefile b/drivers/gpu/drm/bridge/i= mx/Makefile index 8d01fda25451..84499fe2e444 100644 --- a/drivers/gpu/drm/bridge/imx/Makefile +++ b/drivers/gpu/drm/bridge/imx/Makefile @@ -1,6 +1,8 @@ obj-$(CONFIG_DRM_IMX_LDB_HELPER) +=3D imx-ldb-helper.o obj-$(CONFIG_DRM_IMX_LEGACY_BRIDGE) +=3D imx-legacy-bridge.o obj-$(CONFIG_DRM_IMX8MP_DW_HDMI_BRIDGE) +=3D imx8mp-hdmi-tx.o +obj-$(CONFIG_DRM_IMX8MP_DW_HDMI_BRIDGE_CONNECTOR_FIXUP) +=3D imx8mp-hdmi-t= x-connector-fixup.o \ + imx8mp-hdmi-tx-connector-fixup.dtbo.o obj-$(CONFIG_DRM_IMX8MP_HDMI_PAI) +=3D imx8mp-hdmi-pai.o obj-$(CONFIG_DRM_IMX8MP_HDMI_PVI) +=3D imx8mp-hdmi-pvi.o obj-$(CONFIG_DRM_IMX8QM_LDB) +=3D imx8qm-ldb.o diff --git a/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx-connector-fixup.c b/= drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx-connector-fixup.c new file mode 100644 index 000000000000..dc1736bfc3ac --- /dev/null +++ b/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx-connector-fixup.c @@ -0,0 +1,58 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Add an hdmi-connector node to boards using the imx8mp hdmi_tx which + * don't have one. This is needed for the i.MX LCDIF to work with + * DRM_BRIDGE_ATTACH_NO_CONNECTOR. + * + * Copyright (C) 2026 GE HealthCare + * Author: Luca Ceresoli + */ + +#include +#include +#include +#include + +/* Embedded dtbo symbols created by cmd_wrap_S_dtb in scripts/Makefile.dtb= s */ +extern char __dtbo_imx8mp_hdmi_tx_connector_fixup_begin[]; +extern char __dtbo_imx8mp_hdmi_tx_connector_fixup_end[]; + +static int __init imx8mp_hdmi_tx_connector_fixup_init(void) +{ + struct device_node *soc __free(device_node) =3D NULL; + struct device_node *hdmi_tx __free(device_node) =3D NULL; + struct device_node *endpoint __free(device_node) =3D NULL; + void *dtbo_start; + u32 dtbo_size; + int ovcs_id; + int err; + + soc =3D of_find_node_by_path("/soc@0"); + if (!soc) + return 0; + + /* This applies to i.MX8MP only, do nothing on other systems */ + if (!of_device_is_compatible(soc, "fsl,imx8mp-soc")) + return 0; + + hdmi_tx =3D of_find_node_by_path("/soc@0/bus@32c00000/hdmi@32fd8000"); + if (!of_device_is_available(hdmi_tx)) + return 0; + + /* If endpoint exists, assume an hdmi-connector exists already */ + endpoint =3D of_graph_get_endpoint_by_regs(hdmi_tx, 1, -1); + if (endpoint) + return 0; + + dtbo_start =3D __dtbo_imx8mp_hdmi_tx_connector_fixup_begin; + dtbo_size =3D __dtbo_imx8mp_hdmi_tx_connector_fixup_end - + __dtbo_imx8mp_hdmi_tx_connector_fixup_begin; + + err =3D of_overlay_fdt_apply(dtbo_start, dtbo_size, &ovcs_id, NULL); + if (err) + err =3D of_overlay_remove(&ovcs_id); + + return err; +} + +subsys_initcall(imx8mp_hdmi_tx_connector_fixup_init); diff --git a/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx-connector-fixup.dtso= b/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx-connector-fixup.dtso new file mode 100644 index 000000000000..070be24fed3e --- /dev/null +++ b/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx-connector-fixup.dtso @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * DTS overlay adding an hdmi-connector node to boards using the imx8mp hd= mi_tx + * + * Copyright (C) 2026 GE HealthCare + * Author: Luca Ceresoli + */ + +/dts-v1/; +/plugin/; + +&{/} { + #address-cells =3D <2>; + #size-cells =3D <2>; + + fixup-hdmi-connector { + compatible =3D "hdmi-connector"; + label =3D "HDMI"; + type =3D "a"; + + port { + fixup_hdmi_connector_in: endpoint { + remote-endpoint =3D <&hdmi_tx_out>; + }; + }; + }; +}; + +&{/soc@0/bus@32c00000/hdmi@32fd8000/ports/port@1} { + hdmi_tx_out: endpoint { + remote-endpoint =3D <&fixup_hdmi_connector_in>; + }; +}; --=20 2.53.0 From nobody Sat Apr 4 00:07:15 2026 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D9A023A9017 for ; Thu, 2 Apr 2026 09:29:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775122175; cv=none; b=XIYrgazsbwVUgYZdD0xqiQc/P3Aev8o0M1NRUS6P4MA4FD0iZJBbrm8WYBlq6T+bKkSj9zyGaRJT/bwuQCX0o640fkMuA2zhqx2dVaOkB57iGN26sAM+vz9CUId8man3JIFtHtN9jEiYREag494LxSGICbOdi6NUjmd2ifnfS0Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775122175; c=relaxed/simple; bh=GIdP0F+pae3NRyR+49u9Bf5LZaZ6S/KLZ2oy+LDaiF4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TAJ9DtiMY2QD7/UKlYGdoWGtwgYmiWAdC+UhPdQQtv2wAhEx02chfAqSgZUbooCSIBVYw3TAGnk/kEOX7SDiTaUSlBXc4d0PtDuCfW8M4vB0p0VhAF8aKnGjX2Rb1O2blVpv0KJkIq9RCyeBFWf6PdKeyGRXnuxjZblH38KkiOg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=Wguvos85; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="Wguvos85" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id ECE5D4E428B0; Thu, 2 Apr 2026 09:29:18 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id BDC045FDEB; Thu, 2 Apr 2026 09:29:18 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 5FEF410450A10; Thu, 2 Apr 2026 11:29:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1775122155; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=X+H+4X9YO3ipcewDk33OUw1syajC8W/mpHu58zrzCFo=; b=Wguvos85FtP7hFlO1w79zsU2QzeInIa49kEb9DKt3uykgHq+0Lbq4Ab2fEzROzjsDVmwwY jdIT/tSPgkvwZ20u5bRSe/XbdMCPxGacdcE5nWJD9WCG4D5E0b9gtmaqwl7uKcH/6JysZ3 CvFEpU/zQVYz2unYTGxEBq8iNL7XHvHVGp5f5O38NItiGSp4gMqbmmJi9Rl+denoyyLoJz ftvbPVEhEHM6twxCctx0OeOQvIIvCLjbiZfQzwnyEro4HoNMgazRNTVHnSAtuerafFSEYo ynRy2jkLpRtaqRJOpkmZ3dlM0sEd7f/H4ICTaCU7dpoC1mBf/Upy+XUBZMLl2Q== From: Luca Ceresoli Date: Thu, 02 Apr 2026 11:26:04 +0200 Subject: [PATCH v3 09/11] drm/bridge: imx8mp-hdmi-tx-connector-fixup: show a warning when adding the overlay Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260402-drm-lcdif-dbanc-v3-9-27cd247a0847@bootlin.com> References: <20260402-drm-lcdif-dbanc-v3-0-27cd247a0847@bootlin.com> In-Reply-To: <20260402-drm-lcdif-dbanc-v3-0-27cd247a0847@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: Damon Ding , "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 , 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 , Josua Mayer , Kieran Bingham , Marco Felsch , Martyn Welch , Oleksij Rempel , Peng Fan , Richard Hu , Shengjiu Wang , Stefan Eichenberger , Vitor Soares , Luca Ceresoli X-Mailer: b4 0.15.1 X-Last-TLS-Session-Version: TLSv1.3 Describing the HDMI connector in device tree is recommended. While the overlay insertion is a workaround to avoid breaking existing devices, every dts should be improved by adding a connector description. Add a warning to make users aware as far as possible. As a warning line cannot hold all the relevant info, add a detailed comment in the code so it easy to find when the warning is seen. Signed-off-by: Luca Ceresoli Reviewed-by: Liu Ying --- Patch added in v3. Kept as a separate comment w.r.t. the patch adding the overlay to let it be added in a later moment in case we want to convert existing dts files before adding the warning. --- .../gpu/drm/bridge/imx/imx8mp-hdmi-tx-connector-fixup.c | 17 +++++++++++++= ++++ 1 file changed, 17 insertions(+) diff --git a/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx-connector-fixup.c b/= drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx-connector-fixup.c index dc1736bfc3ac..f6190d86abd0 100644 --- a/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx-connector-fixup.c +++ b/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx-connector-fixup.c @@ -44,6 +44,23 @@ static int __init imx8mp_hdmi_tx_connector_fixup_init(vo= id) if (endpoint) return 0; =20 + /* + * Boards with an HDMI connector should describe it in a device + * tree node with compatible =3D "hdmi-connector". + * + * If you see this warning, it means such a node was not found and + * a fallback one is added using a device tree overlay. Please add + * one in your device tree, also describing the exact connector + * type (the added overlay assumes Type A as a fallback, but it + * might be wrong). + * + * This node is necessary for modern DRM, where bridge drivers do + * not create a connector (see the DRM_BRIDGE_ATTACH_NO_CONNECTOR + * flag). See https://docs.kernel.org/gpu/drm-kms-helpers.html for + * more info. + */ + pr_warn("Please add a hdmi-connector DT node for imx8mp-hdmi-tx."); + dtbo_start =3D __dtbo_imx8mp_hdmi_tx_connector_fixup_begin; dtbo_size =3D __dtbo_imx8mp_hdmi_tx_connector_fixup_end - __dtbo_imx8mp_hdmi_tx_connector_fixup_begin; --=20 2.53.0 From nobody Sat Apr 4 00:07:15 2026 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 760803B27FF for ; Thu, 2 Apr 2026 09:29:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775122179; cv=none; b=MvPSP2AW1RDzUqwouUJFoQkYc1lM8akrYTrax63Q1EBV7xC/vPo2IcTI+P4bwEO5Yi+8VtIeu7tZZhrcoU5yJQYgEX2G1vXqbuFodWfgWhoWZCGkorfTM83EtH3940v11Mue/z2uWiU/HCQJd+1FW3rqsv3DWzWDs0vRDKcTXvE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775122179; c=relaxed/simple; bh=75fj+vjOxkYtrB2K8PiOd7i903F+53GTZy3tKP6cfFI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QVpUpEh372i3sA8Gi0jnrd2L0uWfPnx/FC3AVpqYT401fKPNuIbXNqeyZtos3JAU383f0zeZUIr42cBIqTwuMyaYF1V+wuOrfh4ibf1+t3fa4Xm3is2Tj+p4l4OIOP27OJtB5lLHPv1d6ZuNuVU985Us3ffiYIv/1EGfu3px+g8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=yNVZ6Lr4; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="yNVZ6Lr4" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 0E9D5C5997B; Thu, 2 Apr 2026 09:30:00 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 9E8E65FDEB; Thu, 2 Apr 2026 09:29:28 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 82D0E1045124A; Thu, 2 Apr 2026 11:29:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1775122166; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=CkJQw+DInHJHvCmitjPQ0JO4rV0l1+Ax32sk2lseoyY=; b=yNVZ6Lr4yIN1BZ2u++B16FXlCT6U5XJZIQlKNz5m2DIlM+as2pFs9ROcs3a3Gf4S9Ncnb5 mnCYnb51Lr6XtQHNDc/AvfHkU768M2OZwA7Ms7QZG2mra/ZtPE7RlZL9qKxfrfz6AnUO2B 0844ZChU3qGr9/MXAMI7+HUevM96PhOlBduew8HKv7L7XP6N+oM5ySMOpCfrV3X7q8AmCM mWJDcSBpPdvXer/RDkye4p6YL4DQtMgbv09eF8flexq37cam/fP10pqD3b3dWeVcgeg1r0 3ZAVUZTmW1qM48kZZy4ZFfh1s24JfK3Lf0rXAzhTwHVbHXTqYsVPZ97J0rtEMg== From: Luca Ceresoli Date: Thu, 02 Apr 2026 11:26:05 +0200 Subject: [PATCH v3 10/11] drm/bridge: imx8mp-hdmi-tx: switch to DRM_BRIDGE_ATTACH_NO_CONNECTOR Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260402-drm-lcdif-dbanc-v3-10-27cd247a0847@bootlin.com> References: <20260402-drm-lcdif-dbanc-v3-0-27cd247a0847@bootlin.com> In-Reply-To: <20260402-drm-lcdif-dbanc-v3-0-27cd247a0847@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: Damon Ding , "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 , 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 , Josua Mayer , Kieran Bingham , Marco Felsch , Martyn Welch , Oleksij Rempel , Peng Fan , Richard Hu , Shengjiu Wang , Stefan Eichenberger , Vitor Soares , Luca Ceresoli X-Mailer: b4 0.15.1 X-Last-TLS-Session-Version: TLSv1.3 The imx8mp-hdmi-tx one of many drivers based on dw-hdmi. dw-hdmi in turn can operate in two different modes, depending on the platform data as set by the driver: A. hdmi->plat_data->output_port =3D 0: the HDMI output (port@1) in device tree is not used [0] B. hdmi->plat_data->output_port =3D 1: the HDMI output (port@1) is parsed to find the next bridge The imx8mp-hdmi-tx driver falls in case A. Switching to case B, which is the current best practice, requires that the HDMI connector is always described in the live device tree, and a previous commit ensured this is always the case by adding an overlay in case the device tree does not comply. So now we can simply switch to the new mode and support DRM_BRIDGE_ATTACH_NO_CONNECTOR. Reviewed-by: Liu Ying Signed-off-by: Luca Ceresoli --- Changes in v2: - new patch, split out of the previous patch --- drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c b/drivers/gpu/drm/= bridge/imx/imx8mp-hdmi-tx.c index 32fd3554e267..8e8cfd66f23b 100644 --- a/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c +++ b/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c @@ -138,6 +138,7 @@ static int imx8mp_dw_hdmi_probe(struct platform_device = *pdev) plat_data->phy_name =3D "SAMSUNG HDMI TX PHY"; plat_data->priv_data =3D hdmi; plat_data->phy_force_vendor =3D true; + plat_data->output_port =3D 1; =20 platform_set_drvdata(pdev, hdmi); =20 --=20 2.53.0 From nobody Sat Apr 4 00:07:15 2026 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F0DE93CF687 for ; Thu, 2 Apr 2026 09:29:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775122191; cv=none; b=iAem5ICNeIOx37eaDufw1fGCLf4kWYI7KidlLAGnsuytb3bGWGS6BOTak1DqpgwItH5RQ4PMrVK/wlKX8QmO+N20l8merkyIb1c/j0xYM1D1HSoaa0xp4WdzAnx0/az1Q/s6WEHAn8ard1/DxYiHM/LPd1Pc7I6MWNxB/JT7zBg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775122191; c=relaxed/simple; bh=k4oECNgcgBffSrqVG/1BTCiLFKfxRRx2KgQM/Onrk2c=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UI6I6E6wZTUw0x3jxDj06Ip50HjyN0lRNIWO5gGP9R8ANv99oEYPb/Hjw/DEvr+WeZwyLgREGcx28hp8rxutJ+VIqHgvemOxN7ldawt3A6+j/cPjwNfwD3D8ANbde2IuBAm/ML4UhVvHFyFXzMwIG4RG+lu6FLU5vqsR9vajg1E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=OZGQ6oD6; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="OZGQ6oD6" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id ED89CC5997A; Thu, 2 Apr 2026 09:30:10 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 8A1B05FDEB; Thu, 2 Apr 2026 09:29:39 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id B197A104511F1; Thu, 2 Apr 2026 11:29:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1775122176; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=RWUsNAX4qkcAdj0Wcj9Oo2se6gzwrm1zu3SjMpebEPg=; b=OZGQ6oD6EU8Zs5LJVlj3e/KmgME6+PZOYfQXqFJHgC7xxHJIQkrL85tWduXD2/1tYPVsnE zJcse1//4PtucQREZIF9n0GfidQU0ZTFvGISKF5BuYN7iVjTpXvUtFOrGSXprEhDqdjdEC WNHfqas7dZiOQWfAVwKe33lvJeGx/4b4Msz0SgtOdwAeCb5BqXPGy8zlpVovW3onAjtrnC hsOr9Y0nMUS+a73uZfaW8pARKlgBDJT1+KyD3dfGwcJJmjejH0/cG0/JU/aunkeEAM6t02 KQ/dhAgY484m42SlGauX1/cYxWtz3q3SeoQY7bVBflLXBAn0k9h/8TV0ralnJg== From: Luca Ceresoli Date: Thu, 02 Apr 2026 11:26:06 +0200 Subject: [PATCH v3 11/11] drm/mxsfb/lcdif: use DRM_BRIDGE_ATTACH_NO_CONNECTOR and the bridge-connector Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260402-drm-lcdif-dbanc-v3-11-27cd247a0847@bootlin.com> References: <20260402-drm-lcdif-dbanc-v3-0-27cd247a0847@bootlin.com> In-Reply-To: <20260402-drm-lcdif-dbanc-v3-0-27cd247a0847@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: Damon Ding , "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 , 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 , Josua Mayer , Kieran Bingham , Marco Felsch , Martyn Welch , Oleksij Rempel , Peng Fan , Richard Hu , Shengjiu Wang , Stefan Eichenberger , Vitor Soares , Luca Ceresoli X-Mailer: b4 0.15.1 X-Last-TLS-Session-Version: TLSv1.3 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 Tested-by: Alexander Stein # TQMa8MPxL/MB= a8MPxL Signed-off-by: Luca Ceresoli --- Changes in v2: - Added missing select DRM_DISPLAY_HELPER in Kconfig - Rebased on previous patch changes --- drivers/gpu/drm/mxsfb/Kconfig | 2 ++ drivers/gpu/drm/mxsfb/lcdif_drv.c | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mxsfb/Kconfig b/drivers/gpu/drm/mxsfb/Kconfig index 264e74f45554..31db7a824a93 100644 --- a/drivers/gpu/drm/mxsfb/Kconfig +++ b/drivers/gpu/drm/mxsfb/Kconfig @@ -33,6 +33,8 @@ config DRM_IMX_LCDIF select DRM_GEM_DMA_HELPER select DRM_PANEL select DRM_PANEL_BRIDGE + select DRM_DISPLAY_HELPER + select DRM_BRIDGE_CONNECTOR help Choose this option if you have an LCDIFv3 LCD controller. Those devices are found in various i.MX SoC (i.MX8MP, diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdi= f_drv.c index c8ba8f9b1da8..7f07ae24e0dc 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_drv.c +++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -57,6 +58,7 @@ static int lcdif_attach_bridge(struct lcdif_drm_private *= lcdif) struct of_endpoint of_ep; struct drm_bridge *bridge; struct drm_encoder *encoder; + struct drm_connector *connector; int ret; =20 if (!of_device_is_available(remote)) @@ -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); =20 - ret =3D drm_bridge_attach(encoder, bridge, NULL, 0); + ret =3D drm_bridge_attach(encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CO= NNECTOR); if (ret) return dev_err_probe(dev, ret, "Failed to attach bridge for endpoint%u\n", of_ep.id); + + connector =3D drm_bridge_connector_init(lcdif->drm, encoder); + if (IS_ERR(connector)) + return dev_err_probe(dev, PTR_ERR(connector), + "Failed to init bridge_connector for endpoint%u\n", + of_ep.id); + + ret =3D drm_connector_attach_encoder(connector, encoder); + if (ret) + return dev_err_probe(dev, ret, + "Failed to attach connector for endpoint%u\n", + of_ep.id); } =20 return 0; --=20 2.53.0