From mboxrd@z Thu Jan 1 00:00:00 1970 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 C9BB03D9048; Thu, 2 Apr 2026 09:57:23 +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=1775123847; cv=none; b=Fg4Zkuko5r6gutxVraLq0ZLaks9h4itK7nuvCsa6jKt5ATcCcu62PmffLTWn/6ZEfp5J0EDLq2dCx1TY77VGCgBQIzpIqL4DZ2R3/M/pbERlN5srVCAdE5WHKOOf04Mpp+H/+oDAlmenhiysFTfuY8jNMNa90/WZotRpSsFeoJw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775123847; c=relaxed/simple; bh=qN55qyi151Z2WjW3JkqhczNInnenaAJJPjh3YpSr1Jc=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:Cc:To:From: References:In-Reply-To; b=uBf1xZ2T/+yat+LiesUTYKBh5Pgh/+/V/BzMDJnC/eau45VOyyYQr30cKo2unKHZCAe00+reM72lk+UZvcTNaqoxhzc8m57U3ADfx/AYFlWmjD/Mlta6SDQT9Bq655/TWYxCSClBpvF3xYspCxZJleeZGb67ABPe21LViZ4nfLw= 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=yfijbib2; 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="yfijbib2" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id E3FFE4E428AF; Thu, 2 Apr 2026 09:57:21 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 9D1985FDEB; Thu, 2 Apr 2026 09:57:21 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 7C86B10451269; Thu, 2 Apr 2026 11:57:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1775123839; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=TzIlBZUzn8rERbKkbHZzxtwdaqOzw3k+NsqvcFKNCOI=; b=yfijbib28QgvpYc1jycPgfP1cf9QlbzNBZPIME3kRP5Xwzo0Fpz2NwFpnPf06+Xjf9yrXM 6uuWK4eFgEvIZhk76Xf49zo84Sdl+IF0IoEQb5+i1WM2DUb3EusPkbBHlYMeiAA4BJVNiD vt47wimSQQrjgiHUnJFI4InJ1gHobtAsHy9LoffndKHE/0YLZZZ/BJwmQYqgbbOZTNQ+vZ LURJAa5eADPjbU5jOI1nysQWc1RG3SXKJyJtoMYO9TWdAV4FeQMk9g7nn4ObSocBWzCZzI 8tJ+zX2CCZC3ytW+hDX0ggKrWl0uTImJlY2zAZfMQzcBxT68f4JFiL8TuprB9g== Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 02 Apr 2026 11:57:03 +0200 Message-Id: Subject: Re: [PATCH v2 06/10] drm/bridge: dw-hdmi: warn on unsupported attach combination Cc: "Kory Maincent (TI.com)" , =?utf-8?q?Herv=C3=A9_Codina?= , "Hui Pu" , "Ian Ray" , "Thomas Petazzoni" , , , , , , "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" To: "Damon Ding" , "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" From: "Luca Ceresoli" X-Mailer: aerc 0.20.1 References: <20260330-drm-lcdif-dbanc-v2-0-c7f2af536a24@bootlin.com> <20260330-drm-lcdif-dbanc-v2-6-c7f2af536a24@bootlin.com> In-Reply-To: X-Last-TLS-Session-Version: TLSv1.3 Hello Damon, On Thu Apr 2, 2026 at 11:14 AM CEST, Damon Ding wrote: > Hi Luca, > > On 3/31/2026 3:25 AM, Luca Ceresoli wrote: >> dw-hdmi can operate in two different modes, depending on the platform da= ta >> 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. Als= o >> return -EINVAL which would be returned by drm_bridge_attach() right afte= r >> anyway. >> >> Reviewed-by: Liu Ying >> Tested-by: Martyn Welch >> Tested-by: Alexander Stein # TQMa8MPxL= /MBa8MPxL >> 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 b= ut >> 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 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_bridg= e *bridge, >> { >> struct dw_hdmi *hdmi =3D bridge->driver_private; >> >> + /* DRM_BRIDGE_ATTACH_NO_CONNECTOR requires a remote-endpoint to the ne= xt bridge */ >> + if (WARN_ON((flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) && !hdmi->plat_da= ta->output_port)) >> + return -EINVAL; >> + >> if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) >> return drm_bridge_attach(encoder, hdmi->bridge.next_bridge, >> bridge, flags); >> > > Since many older Rockchip platforms (RK3288, RK3399, etc.) lack a > hdmi-connector node linked to the HDMI DT node, which corresponds to > case A. Could we relax this restriction and treat cases where > DRM_BRIDGE_ATTACH_NO_CONNECTOR is set but hdmi->plat_data->output_port = =3D > 0 as a new case C? > > For Rockchip platforms, the HDMI driver invokes dw_hdmi_bind() to attach > the Synopsys bridge. This sequence differs from that on the XNP > platform, but is similar to the Allwinner implementation. > > If we treat the case where DRM_BRIDGE_ATTACH_NO_CONNECTOR is set and > hdmi->plat_data->output_port =3D 0 as -EINVAL, I will have to modify the > HDMI DT configuration for all Rockchip platforms when adapting to the > bridge-connector framework. > > The patch that adapts to the bridge-connector framework and has been > verified OK on RK3399 is attached. I saw this only after sending v3. Anyway, replying now. I'm not sure I follow completely your reasoning, but one aspect is that we can (and should) convert drivers in small groups independently as I'm doing with this series for the i.MX8MP and involved drivers and you are doing for the analogix_dp in another series. Converting all (or large sets) at once would just be not doable realistically. And so I suggest you send a separate series to convert the Rockchip drivers based on dw-hdmi. Please Cc me, I'll be glad to review it. Also, it's not clear to me why we need a case C. We already have two cases (A and B, the old and new way) and we should convert to case B unless there is a strong reason. If Rockchip dts are missing a hdmi-connector node you can reuse the fixup module in patch 8. Luca -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com