From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 96962CCD1A5 for ; Wed, 22 Oct 2025 01:16:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:References:Cc:To:Subject:From:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=zauBUVRHLTtxfE8FEqH72ce8GCghwo6SRo4GbUPwtY0=; b=2SavzMA7oUeiRAk4pPha4/Sfs2 0KvfXfPbTRHQyty9wZRrtJ0RvV9GDZ9MMtIJugiX29XcS/IyI/XpfLiVHW4k2q9T+pdKxSRzf3uEq RIC3Z6eNxlvLtqcn2YWKzIP9XBfQFZlHL85Rs52VKCxQb4Cs6i8tyFqHsEK1WEZXRZMYDUNpPhSBN 0BhLYPv10vUG/yjXzwO98GgvcuA+8wauDOmaGFg1q6/Z6O7oda5F9aUUp1oULH1nchxmKxk3totsE x7liVWQ0nXoLdoLelsTW6s06uneHDeBP4zlUFZqESzlvieeJESmntAflXYFAsWp6esFKrF6gPI6TT 9FzZKTpg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vBNSO-000000017sk-0Wym; Wed, 22 Oct 2025 01:16:04 +0000 Received: from mail-m49226.qiye.163.com ([45.254.49.226]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vBNSK-000000017rw-1RFu; Wed, 22 Oct 2025 01:16:02 +0000 Received: from [172.16.12.26] (unknown [58.22.7.114]) by smtp.qiye.163.com (Hmail) with ESMTP id 26b816b55; Wed, 22 Oct 2025 09:15:54 +0800 (GMT+08:00) Message-ID: Date: Wed, 22 Oct 2025 09:15:52 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Damon Ding Subject: Re: [PATCH v7 01/18] drm/display: bridge_connector: Ensure last bridge determines EDID/modes detection capabilities To: Luca Ceresoli , andrzej.hajda@intel.com, neil.armstrong@linaro.org, rfoss@kernel.org Cc: Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, inki.dae@samsung.com, sw0312.kim@samsung.com, kyungmin.park@samsung.com, krzk@kernel.org, alim.akhtar@samsung.com, jingoohan1@gmail.com, p.zabel@pengutronix.de, hjc@rock-chips.com, heiko@sntech.de, andy.yan@rock-chips.com, dmitry.baryshkov@oss.qualcomm.com, dianders@chromium.org, m.szyprowski@samsung.com, jani.nikula@intel.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-rockchip@lists.infradead.org References: <20251021023130.1523707-1-damon.ding@rock-chips.com> <20251021023130.1523707-2-damon.ding@rock-chips.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-HM-Tid: 0a9a097ca16b03a3kunm40777dd76b3afa X-HM-MType: 1 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFDSUNOT01LS0k3V1ktWUFJV1kPCRoVCBIfWUFZGU5NTVZIGRkYGB1CSENNHk5WFRQJFh oXVRMBExYaEhckFA4PWVdZGBILWUFZTkNVSUlVTFVKSk9ZV1kWGg8SFR0UWUFZT0tIVUpLSEpKQk 1VSktLVUpCWQY+ DKIM-Signature: a=rsa-sha256; b=G3IBa/UR/LuPN+iUHG5BfBsR0wakY08fMpbIcc22chg3Yl2mDJuP3hApodwjF7Dp3I5RcHlsanrTg0887GoJUZgyuAx5TMRcyEawoDSmH9l/4xI5P1euGxlyg400GezPKB85JhtiTT1ZShmJwtVe+NOdaGsfV+2hDV4p/3K+h9E=; c=relaxed/relaxed; s=default; d=rock-chips.com; v=1; bh=zauBUVRHLTtxfE8FEqH72ce8GCghwo6SRo4GbUPwtY0=; h=date:mime-version:subject:message-id:from; X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251021_181601_025984_0B65A5BB X-CRM114-Status: GOOD ( 21.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Luca, On 10/21/2025 6:31 PM, Luca Ceresoli wrote: > Hello Damon, > > On Tue Oct 21, 2025 at 4:31 AM CEST, Damon Ding wrote: >> When multiple bridges are present, EDID detection capability >> (DRM_BRIDGE_OP_EDID) takes precedence over modes detection >> (DRM_BRIDGE_OP_MODES). To ensure the above two capabilities are >> determined by the last bridge in the chain, we handle three cases: >> >> Case 1: The later bridge declares only DRM_BRIDGE_OP_MODES >> - If the previous bridge declares DRM_BRIDGE_OP_EDID, set >> &drm_bridge_connector.bridge_edid to NULL and set >> &drm_bridge_connector.bridge_modes to the later bridge. >> - Ensure modes detection capability of the later bridge will not >> be ignored. >> >> Case 2: The later bridge declares only DRM_BRIDGE_OP_EDID >> - If the previous bridge declares DRM_BRIDGE_OP_MODES, set >> &drm_bridge_connector.bridge_modes to NULL and set >> &drm_bridge_connector.bridge_edid to the later bridge. >> - Although EDID detection capability has higher priority, this >> operation is for balance and makes sense. >> >> Case 3: the later bridge declares both of them >> - Assign later bridge as &drm_bridge_connector.bridge_edid and >> and &drm_bridge_connector.bridge_modes to this bridge. >> - Just leave transfer of these two capabilities as before. >> >> Signed-off-by: Damon Ding >> Suggested-by: Dmitry Baryshkov >> Tested-by: Marek Szyprowski >> >> --- >> >> Changes in v7: >> - As Luca suggested, simplify the code and related comment. >> --- >> drivers/gpu/drm/display/drm_bridge_connector.c | 16 ++++++++++++---- >> 1 file changed, 12 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/gpu/drm/display/drm_bridge_connector.c b/drivers/gpu/drm/display/drm_bridge_connector.c >> index baacd21e7341..7c2936d59517 100644 >> --- a/drivers/gpu/drm/display/drm_bridge_connector.c >> +++ b/drivers/gpu/drm/display/drm_bridge_connector.c >> @@ -673,14 +673,22 @@ struct drm_connector *drm_bridge_connector_init(struct drm_device *drm, >> if (!bridge->ycbcr_420_allowed) >> connector->ycbcr_420_allowed = false; >> >> - if (bridge->ops & DRM_BRIDGE_OP_EDID) >> - bridge_connector->bridge_edid = bridge; >> + /* >> + * Ensure the last bridge declares OP_EDID or OP_MODES or both. >> + */ >> + if (bridge->ops & DRM_BRIDGE_OP_EDID || bridge->ops & DRM_BRIDGE_OP_MODES) { >> + bridge_connector->bridge_edid = NULL; >> + bridge_connector->bridge_modes = NULL; >> + if (bridge->ops & DRM_BRIDGE_OP_EDID) >> + bridge_connector->bridge_edid = bridge; >> + if (bridge->ops & DRM_BRIDGE_OP_MODES) >> + bridge_connector->bridge_modes = bridge; >> + } >> if (bridge->ops & DRM_BRIDGE_OP_HPD) >> bridge_connector->bridge_hpd = bridge; >> if (bridge->ops & DRM_BRIDGE_OP_DETECT) >> bridge_connector->bridge_detect = bridge; >> - if (bridge->ops & DRM_BRIDGE_OP_MODES) >> - bridge_connector->bridge_modes = bridge; >> + > > This does not apply on current drm-misc-next, due to the patch I mentioned > in a previous iteration, now applied as commit 2be300f9a0b6 ("drm/display: > bridge_connector: get/put the stored bridges"). > > However I'm sorry I have to mention that patch turned out being buggy, so > I've sent a series to apply a corrected version [0]. I suggest watching the > disucssion about the fix series, and if that gets approved rebase on top of > that and adapt your changes. > > Sorry about the mess. :( > > [0] https://lore.kernel.org/r/20251017-drm-bridge-alloc-getput-bridge-connector-fix-hdmi_cec-v2-0-667abf6d47c0@bootlin.com > > I saw your fix patches before sending this series. I think your patches will likely be merged relatively quickly, so I plan to wait until the other patches in my patch series are confirmed to be fine, then submit v8 version based on the latest bridge_connector driver. :-) Best regards, Damon