Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5272286rdb; Wed, 13 Dec 2023 04:18:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IFxHK9YDnJjTp/edSCZheMuCepd/o8HDAPOqpJq7bcMf8IsAMP1TR4Qvh9C7gtKkExQbdTM X-Received: by 2002:a05:6359:7414:b0:170:6c3d:34f5 with SMTP id va20-20020a056359741400b001706c3d34f5mr7399808rwb.20.1702469892118; Wed, 13 Dec 2023 04:18:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702469892; cv=none; d=google.com; s=arc-20160816; b=edaF8xPGR3sG8YW53da6SUFnwdrqVetBKhnTBllHy9rqCkz3hQj47A5yRgyLwGcaiK Lan/PMA++Ptlh2nSF2JUb6sXt+jmAecnD1VnHKf3y2l08gmL+/ZC9j9rg+Ppf3yoeB1D 6CcpoDbe8632fXsw5QfCUh0bZZ6Bl2PBlTcHqfj8Ko9pNJoURW1Vv+F5gCT6RnLTpzep narPRviFuyFvNFxlxkX0hf5TPf4N9vtQkTSOIHqOrOno3LRyrj4TI7Krd4rTxLVuT/oQ 1DOzdLGmt7xmXnIwJFCNCCwb/HfW4eMGmfL63V0iPdn1TzZKC4iddNZA/dQZHpO3ZwZz Mwng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=iwv6QjlzhU/3lqKybKin6YBmQgef/lB3nAcvuDWpn2g=; fh=XAx0tBJSeQv1elqRievZTu+SgUhiLsae2RtCvmwi0ew=; b=DFlZxcSU1K0B1sxuTqPavsxOOeOneeT+Xg4sQbk2KoMEtnIRFVsiAmPrhc8/IKSqBU Ds40svsZ4Na1b0OtKAxOYoJiXKIPLsV3hWJ5vxxC++80QnxO6nBthQ3ltTyqz89Hqrmt GOn9JMgPVSNDTkiDmyAaP+N+ovhlRz//qp+wb6kYS//Bhx7WGKzCGvvtVhAv8HbK3tSN Y6QXFwIfkW/tmYAlXQKe0KRZPBGCGDZH3bKS4K4XDU3/hpGTxKauk4PplXD+NT2Xv8mV GJat3dsHkXho6Yx1jUHO/qynAAb/hFQfcSuvnMHtpcABB30fQDFnHSauEezmGM4cVTCm 7xiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ctonY1pD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id ck17-20020a056a02091100b005c6a04dfc07si9715381pgb.519.2023.12.13.04.18.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 04:18:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ctonY1pD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id D7CC78023744; Wed, 13 Dec 2023 04:18:08 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233390AbjLMMRx (ORCPT + 99 others); Wed, 13 Dec 2023 07:17:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233316AbjLMMRv (ORCPT ); Wed, 13 Dec 2023 07:17:51 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 295B6D5 for ; Wed, 13 Dec 2023 04:17:58 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45F0BC433C8; Wed, 13 Dec 2023 12:17:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702469877; bh=iwv6QjlzhU/3lqKybKin6YBmQgef/lB3nAcvuDWpn2g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ctonY1pD3cVqUnD3wCzZr2rWQ6aR3CISED2vL7hpLsSaR5RCWaijqq45PfJy0lpZn GxeHxtDm3D6FPNvjsLDaCJeTqxuQJVBVjszBs663aieCxmLUNF9Ar1ScENexe41rOL /QTTx4y+ySrpwVhldfwnk/Xj6ub/N3qAI/HdFOybU0obhe04DICyQgRsNt3iX1mEaG PrN6xab2DiQbpGNSQN3xAS/KnOyJAqrPqgPyzzxnSPSGDI1AGT8aq1foHtyls41nm8 92C0vFGrOHcUYsriJyPztZCtJIXliOtp29B/iUNG4IIqtYRk8cbd1oGaRRSeHtgeUr bbCJZvMTWV3og== Date: Wed, 13 Dec 2023 13:17:54 +0100 From: Maxime Ripard To: Dario Binacchi Cc: Jagan Teki , Dave Stevenson , Michael Nazzareno Trimarchi , linux-kernel@vger.kernel.org, Amarula patchwork , Andrzej Hajda , Daniel Vetter , David Airlie , Frieder Schrempf , Jernej Skrabec , Jonas Karlman , Laurent Pinchart , Maarten Lankhorst , Neil Armstrong , Robert Foss , Thomas Zimmermann , dri-devel@lists.freedesktop.org Subject: Re: [PATCH v4 02/10] drm/bridge: Fix a use case in the bridge disable logic Message-ID: References: <20231205105341.4100896-1-dario.binacchi@amarulasolutions.com> <20231205105341.4100896-3-dario.binacchi@amarulasolutions.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="5iaexn55qchqkucz" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 13 Dec 2023 04:18:09 -0800 (PST) --5iaexn55qchqkucz Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 13, 2023 at 12:59:05PM +0100, Dario Binacchi wrote: > Hi Jagan and Dave, >=20 > On Wed, Dec 6, 2023 at 2:57=E2=80=AFPM Michael Nazzareno Trimarchi > wrote: > > > > Hi Jagan > > > > On Wed, Dec 6, 2023 at 2:31=E2=80=AFPM Jagan Teki wrote: > > > > > > Hi Dario, > > > > > > On Wed, Dec 6, 2023 at 6:57=E2=80=AFPM Dario Binacchi > > > wrote: > > > > > > > > Hi Dave and Jagan, > > > > > > > > On Tue, Dec 5, 2023 at 4:39=E2=80=AFPM Dave Stevenson > > > > wrote: > > > > > > > > > > Hi Dario > > > > > > > > > > On Tue, 5 Dec 2023 at 10:54, Dario Binacchi > > > > > wrote: > > > > > > > > > > > > The patch fixes the code for finding the next bridge with the > > > > > > "pre_enable_prev_first" flag set to false. In case this conditi= on is > > > > > > not verified, i. e. there is no subsequent bridge with the flag= set to > > > > > > false, the whole bridge list is traversed, invalidating the "ne= xt" > > > > > > variable. > > > > > > > > > > > > The use of a new iteration variable (i. e. "iter") ensures that= the value > > > > > > of the "next" variable is not invalidated. > > > > > > > > > > We already have https://patchwork.freedesktop.org/patch/529288/ t= hat > > > > > has been reviewed (but not applied) to resolve this. What does th= is > > > > > version do differently and why? > > > > > > > > My patches only affect drm_atomic_bridge_chain_post_disable(), wher= eas > > > > Jagan's patch affects both > > > > drm_atomic_bridge_chain_post_disable() and drm_atomic_bridge_chain_= pre_enable(). > > > > I tested Jagan's patch on my system with success and I reviewed with > > > > Michael Trimarchi the > > > > drm_atomic_bridge_chain_pre_enable() fixing and we think it's okay. > > > > We also believe that our changes to post_disable() are better, as we > > > > set the 'next' variable only when required, > > > > and the code is more optimized since the list_is_last() is not call= ed > > > > within the loop. > > > > Would it be possible to use Jagan's patch for fixing > > > > drm_atomic_bridge_chain_pre_enable() and mine for > > > > fixing drm_atomic_bridge_chain_post_disable()? > > > > > > > > > > Can you please share the post-disabled bridge chain list with the > > > below example before and after your change? > > > > We have already git commit the description in how the patch affects > > the post_disable. As Dario > > reported your patch is ok even in our use case. We don't have a real > > use case as the one you describe. > > > > Can we know how you test it in this use case here? Can you test our > > patches of post_disable? > > > > Thanks > > Michael > > > > > > > > Example: > > > - Panel > > > - Bridge 1 > > > - Bridge 2 pre_enable_prev_first > > > - Bridge 3 > > > - Bridge 4 pre_enable_prev_first > > > - Bridge 5 pre_enable_prev_first > > > - Bridge 6 > > > - Encoder > > > > > > Thanks, > > > Jagan. >=20 > Starting from my use case: >=20 > # cat /sys/kernel/debug/dri/32e00000.lcdif/bridge_chains > encoder[36] > bridge[0] type: 16, ops: 0x0, OF: > /soc@0/bus@32c00000/dsi@32e10000:fsl,imx8mn-mipi-dsim > bridge[1] type: 16, ops: 0x8, OF: > /soc@0/bus@32c00000/dsi@32e10000/panel@0:sharp,ls068b3sx0 >=20 > I developed a pass through MIPI-DSI bridge driver to try to test your cas= e: > # cat /sys/kernel/debug/dri/32e00000.lcdif/bridge_chains > encoder[36] > bridge[0] type: 16, ops: 0x0, OF: > /soc@0/bus@32c00000/dsi@32e10000:fsl,imx8mn-mipi-dsim > bridge[1] type: 16, ops: 0x0, OF: /pt_mipi_dsi1:amarula,pt-mipi-dsi > bridge[2] type: 16, ops: 0x0, OF: /pt_mipi_dsi2:amarula,pt-mipi-dsi > bridge[3] type: 16, ops: 0x0, OF: /pt_mipi_dsi3:amarula,pt-mipi-dsi > bridge[4] type: 16, ops: 0x0, OF: /pt_mipi_dsi4:amarula,pt-mipi-dsi > bridge[5] type: 16, ops: 0x0, OF: /pt_mipi_dsi5:amarula,pt-mipi-dsi > bridge[6] type: 16, ops: 0x8, OF: /pt_mipi_dsi5/panel@0:sharp,ls068b3sx02 >=20 > The pre_enable_prev_first flag is set through the > "amarula,pre_enable_prev_first" dts property I put > in my dts. > Your and my patches give the same results (result: OK) in both your > use case and mine. > But If I test my new "enlarged" use case: >=20 > - Encoder > - bridge[0] (samsung-dsim) > - bridge[1] pre_enable_prev_first > - bridge[2] pre_enable_prev_first > - bridge[3] pre_enable_prev_first > - bridge[4] pre_enable_prev_first > - bridge[5] pre_enable_prev_first > - bridge[6] pre_enable_prev_first (Panel) >=20 > the result is: > my patches: KO > your patch: OK >=20 > So, I will remove my patches from the series. >=20 > Can the driver I implemented to test the use cases (pass through > MIPI-DSI) be considered useful for testing these > bridge pipelines? > Does it make sense to send its patch? As it is, not really, but kunit tests would be very welcome Maxime --5iaexn55qchqkucz Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCZXmg8gAKCRDj7w1vZxhR xYE2AP9DlpeRBMf5MCKhgytRMJVkb5u7GKYMYVH7gCg/rEd2nAD8DFqluSPThfWf bNOau9D9SzHLHPj3BnTraUtdMZoiYAY= =k9+E -----END PGP SIGNATURE----- --5iaexn55qchqkucz--