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 B38F5E9904A for ; Fri, 10 Apr 2026 07:42:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 08EAF10E8C7; Fri, 10 Apr 2026 07:42:17 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=bootlin.com header.i=@bootlin.com header.b="fb6SynIs"; 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 B280910E8C7 for ; Fri, 10 Apr 2026 07:42:15 +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 5605E4E4296A; Fri, 10 Apr 2026 07:42:14 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 165CE603F0; Fri, 10 Apr 2026 07:42:14 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id D03FF1045001D; Fri, 10 Apr 2026 09:41:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1775806932; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=MHNH9UXB0cyYa0OWDg7so8oezJOoutLQTfep4KfFZOA=; b=fb6SynIsvC1cwH9UKMqmu4ZqdazkS5hj4bRDu9pSaGAYro1/prY1xJlayMW0oVjkSSaa8u X2jxQ54EkZg+y6nChj6kz3mRVp7dNOtBI28A4cBrBEtqEN66r3BmY9QrxKOkp0HxY4tu2C uwVKIKo6SUQzn0KW5PgsgF6hoSux+egTxZbMMxHUHhai10afej68DxjClWB2HDRxFaz3yJ WlpUgceB2XIpYBiD3OIddnvBOoBsQJ7GRfS2x0EE84QrzerRTDZJwP+0vyblHujmoMcsKt 8LphUmAUnRscmt/LZ4XLaCBeKy45DwJF+Zm9WA3ObZBdXzaPWXpynlPIi53/wg== Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 10 Apr 2026 09:41:58 +0200 Message-Id: To: "Damon Ding" , , , , , , , , , , , , , , , , , , , , , From: "Luca Ceresoli" Subject: Re: [PATCH v13 11/17] drm/bridge: analogix_dp: Apply drm_bridge_connector helper Cc: , , , , , , , , , , , , , , , X-Mailer: aerc 0.20.1 References: <20260409065301.446670-1-damon.ding@rock-chips.com> <20260409065301.446670-12-damon.ding@rock-chips.com> In-Reply-To: <20260409065301.446670-12-damon.ding@rock-chips.com> 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" Hello Damon, On Thu Apr 9, 2026 at 8:52 AM CEST, Damon Ding wrote: > Initialize bridge_connector for both Rockchip and Exynos encoder sides. > Then, make DRM_BRIDGE_ATTACH_NO_CONNECTOR mandatory for Analogix bridge > side, as the private &drm_connector is no longer created. > > The previous &drm_connector_funcs and &drm_connector_helper_funcs APIs > are replaced by the corresponding &drm_bridge_funcs APIs: > > analogix_dp_atomic_check() -> analogix_dp_bridge_atomic_check() > analogix_dp_detect() -> analogix_dp_bridge_detect() > analogix_dp_get_modes() -> analogix_dp_bridge_get_modes() > analogix_dp_bridge_edid_read() > > Additionally, the compatibilities of Analogix DP bridge based on whether > the next bridge is a 'panel'. If it is, OP_MODES and OP_DETECT are > supported; If not (the next bridge is a 'monitor' or a bridge chip), > OP_EDID and OP_DETECT are supported. > > The devm_drm_bridge_add() is placed in analogix_dp_bind() instead of > analogix_dp_probe(), because the type of next bridge (the panel, monitor > or bridge chip) can only be determined after the probe process has fully > completed. > > Signed-off-by: Damon Ding > Tested-by: Marek Szyprowski > Tested-by: Heiko Stuebner # rk3588 I noticed two issues, sorry I haven't catched them before... > @@ -1580,7 +1533,8 @@ EXPORT_SYMBOL_GPL(analogix_dp_unbind); > > int analogix_dp_start_crc(struct drm_connector *connector) > { > - struct analogix_dp_device *dp =3D to_dp(connector); > + struct analogix_dp_device *dp; > + struct drm_bridge *bridge; > > if (!connector->state->crtc) { > DRM_ERROR("Connector %s doesn't currently have a CRTC.\n", > @@ -1588,13 +1542,26 @@ int analogix_dp_start_crc(struct drm_connector *c= onnector) > return -EINVAL; > } > > + bridge =3D drm_bridge_chain_get_first_bridge(connector->encoder); > + if (bridge->type !=3D DRM_MODE_CONNECTOR_eDP) > + return -EINVAL; > + > + dp =3D to_dp(bridge); > + > return drm_dp_start_crc(&dp->aux, connector->state->crtc); > } drm_bridge_chain_get_first_bridge() takes a reference, you must call drm_bridge_put(bridge) before returning. Given there are two return paths I suggest: - struct drm_bridge *bridge; - bridge =3D drm_bridge_chain_get_first_bridge(connector->encoder); + struct drm_bridge *bridge __free(drm_bridge_put) =3D + drm_bridge_chain_get_first_bridge(connector->encoder); > EXPORT_SYMBOL_GPL(analogix_dp_start_crc); > > int analogix_dp_stop_crc(struct drm_connector *connector) > { > - struct analogix_dp_device *dp =3D to_dp(connector); > + struct analogix_dp_device *dp; > + struct drm_bridge *bridge; > + > + bridge =3D drm_bridge_chain_get_first_bridge(connector->encoder); > + if (bridge->type !=3D DRM_MODE_CONNECTOR_eDP) > + return -EINVAL; > + > + dp =3D to_dp(bridge); > > return drm_dp_stop_crc(&dp->aux); > } Same here: - struct drm_bridge *bridge; - bridge =3D drm_bridge_chain_get_first_bridge(connector->encoder); + struct drm_bridge *bridge __free(drm-bridge_put) =3D + drm_bridge_chain_get_first_bridge(connector->encoder); With the above two changes you can add to v14: +Reviewed-by: Luca Ceresoli Luca -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com