Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3892316ioa; Tue, 26 Apr 2022 11:48:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwqfDn91dO1EOCft21m0EFyea5BTGApv7sBmVfWGsuR3P9bo6wDmLOyMa829GFHYrrXdv8 X-Received: by 2002:a17:902:bd93:b0:158:fef8:b4fc with SMTP id q19-20020a170902bd9300b00158fef8b4fcmr25010430pls.48.1650998901085; Tue, 26 Apr 2022 11:48:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650998901; cv=none; d=google.com; s=arc-20160816; b=asNPeIjAjj8owb+7ggjOjaCIVEnlhjSjnNd3rV5jUD5IngfcfMogd7lIrBMzJb3hh1 0QcG4R4M4l2vp3CJmQYNQ0SPYu6uMWHOZEEqwM7f/N8LuKUvSb/9lAlO5sekG2lWKLxk 2LjcCCtOfcIny0w9qn/g1O+cmtRS1Olw2Gj1LLX8OJGdCD7sjgebffE71IOgFB5lbMpS JwRFEcTx2VhwOE0LfNASrpg4vOaUVgDxWqWjvBsMXcrpFjBAfCI9XhWKlzb4T1lVqi4K VpwOs5n9mxtjvbSPo6DCLqPpqdBD/xiDusF7GcQAYLyeq7bbalDd5EQ8iiSbcoxAoDvm JFzw== 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 :dkim-signature; bh=KqyOC63okTCBiZ8lJYPrKN9nzXKeDkTwLdtSOukq/2E=; b=pMIrrvJaNsY8JFCDrerXJPbDWFw7x8WtXYVMExMVtYBC2R6DPN522hQ5pWghw4Bf1E EhvdjIBwKgFfhLDKjNLelj8uoPfT0AB9E8FjI64v8jWXSPZ/Git0bYAOY+v8aDcygpr6 eL7Tt70mEYlPlBQJSkjlvJt/C1sGNPNLZrH1Cqvqh93AzcdZF/uH71t0ei3HU0WNadqX laMwa0D2fKqx92a6cKUln2yk0Uj87OT3idT2lrPStQqvzF5scOUXbKxXRYFoQE3cIcPI gIfA997IE5NmKfjoT5qQivO4ZoAwKSHTYhdcE3L1QBMHPSBEvNtc9TSMm3qxzLdOroGE nFPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b="cj3X/K83"; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=VHP4ImsG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k25-20020a635a59000000b003aa339f83b7si20425471pgm.310.2022.04.26.11.48.05; Tue, 26 Apr 2022 11:48:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b="cj3X/K83"; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=VHP4ImsG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347277AbiDZM5O (ORCPT + 99 others); Tue, 26 Apr 2022 08:57:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350041AbiDZM5M (ORCPT ); Tue, 26 Apr 2022 08:57:12 -0400 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CDDA17DA13 for ; Tue, 26 Apr 2022 05:54:04 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id C9C7C5C01AB; Tue, 26 Apr 2022 08:54:03 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 26 Apr 2022 08:54:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm3; t=1650977643; x=1651064043; bh=KqyOC63okT CBiZ8lJYPrKN9nzXKeDkTwLdtSOukq/2E=; b=cj3X/K838OBL/WFeHgbEJXzedj 13tSVv8zQe0VlGl9J60aelN/dBdUNf3rokUv6/sX5NxTEwQ+8J/ElQqTrqxTSzq1 6dVl/PBu6W+iKvdGpcuYBb8duWaaxgRdDtUwRtx+5ueeahia53pk0Ry2KLWfPyy9 lU5JlrhrXqIIXhJxDZXterHrQzmhi5B97K0cF1LiJtigdlCtIeslvojtp3ufMsRy 28ZCn5uXH6HtmOxxYv59AaxDo9uaP7kRXax2c5mcG6jPm2PHbWMrxYA/D+NoPQT7 Va/iuEgBRYDQemTz9iSZq/EBIWCCTZh7aIOT6RytwTCmLuEdYZjFxsx6zhmg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1650977643; x= 1651064043; bh=KqyOC63okTCBiZ8lJYPrKN9nzXKeDkTwLdtSOukq/2E=; b=V HP4ImsGg2NK1FxzrLMDBrSdd/YbtNX7CciCgJr0nkR6ynG4YEa0siMwH7TSjLc7V tnT6t4UUOn2xHQ1B3H515clGBR/iL6WUpBrB1NMZXlBmCkUTT0PR0TLdbhPzbuFE xo+3NV9vQc+p0gM/e0K9zat8/5kB3lFmiFhjxX/U2oGz1f/gvCPmt5uRoZygI4mK YZwG57aNlhLDB1anaCNx82mXkDaNNW3mfXyOZxUrmC9CkGpEY2gN7cHzOHjq1+2t hwS159Jw7/AIJIBDhmuwworreEMvx/bMxQh4/LqCJM415m242Ak45Joe7Jvd4+Lg RhLMLGG7rlwIS/QPeL4Xg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudefgdehgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepteefffefgfektdefgfeludfgtdejfeejvddttdekteeiffejvdfgheehfffh vedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmh grgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 26 Apr 2022 08:54:03 -0400 (EDT) Date: Tue, 26 Apr 2022 14:54:01 +0200 From: Maxime Ripard To: Paul Kocialkowski Cc: Laurent Pinchart , Jagan Teki , Bjorn Andersson , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Thierry Reding , Rob Clark , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Linus Walleij , Marek Szyprowski , Robert Foss Subject: Re: [PATCH 2/2] Revert "drm: of: Lookup if child node has panel or bridge" Message-ID: <20220426125401.yyrhg6aeafdjw4ad@houat> References: <20220420231230.58499-1-bjorn.andersson@linaro.org> <20220420231230.58499-2-bjorn.andersson@linaro.org> <20220421082358.ivpmtak3ednvddrc@houat> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="y6e5ldbnofa2rtha" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --y6e5ldbnofa2rtha Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 26, 2022 at 02:41:44PM +0200, Paul Kocialkowski wrote: > On Tue 26 Apr 22, 14:33, Laurent Pinchart wrote: > > On Tue, Apr 26, 2022 at 09:54:36AM +0200, Paul Kocialkowski wrote: > > > On Thu 21 Apr 22, 10:59, Paul Kocialkowski wrote: > > > > On Thu 21 Apr 22, 10:23, Maxime Ripard wrote: > > > > > On Thu, Apr 21, 2022 at 01:15:54PM +0530, Jagan Teki wrote: > > > > > > + Linus > > > > > > + Marek > > > > > > + Laurent > > > > > > + Robert > > > > > >=20 > > > > > > On Thu, Apr 21, 2022 at 4:40 AM Bjorn Andersson wrote: > > > > > > > > > > > > > > Commit '80253168dbfd ("drm: of: Lookup if child node has pane= l or > > > > > > > bridge")' attempted to simplify the case of expressing a simp= le panel > > > > > > > under a DSI controller, by assuming that the first non-graph = child node > > > > > > > was a panel or bridge. > > > > > > > > > > > > > > Unfortunately for non-trivial cases the first child node migh= t not be a > > > > > > > panel or bridge. Examples of this can be a aux-bus in the ca= se of > > > > > > > DisplayPort, or an opp-table represented before the panel nod= e. > > > > > > > > > > > > > > In these cases the reverted commit prevents the caller from e= ver finding > > > > > > > a reference to the panel. > > > > > > > > > > > > > > This reverts commit '80253168dbfd ("drm: of: Lookup if child = node has > > > > > > > panel or bridge")', in favor of using an explicit graph refer= ence to the > > > > > > > panel in the trivial case as well. > > > > > >=20 > > > > > > This eventually breaks many child-based devm_drm_of_get_bridge > > > > > > switched drivers. Do you have any suggestions on how to procee= d to > > > > > > succeed in those use cases as well? > > > > >=20 > > > > > I guess we could create a new helper for those, like > > > > > devm_drm_of_get_bridge_with_panel, or something. > > > >=20 > > > > Oh wow I feel stupid for not thinking about that. > > > >=20 > > > > Yeah I agree that it seems like the best option. > > >=20 > > > Should I prepare a patch with such a new helper? > > >=20 > > > The idea would be to keep drm_of_find_panel_or_bridge only for the of= graph > > > case and add one for the child node case, maybe: > > > drm_of_find_child_panel_or_bridge. > > >=20 > > > I really don't have a clear idea of which driver would need to be swi= tched > > > over though. Could someone (Jagan?) let me know where it would be nee= ded? > > >=20 > > > Are there cases where we could both expect of graph and child node? > > > (i.e. does the new helper also need to try via of graph?) > >=20 > > I still think we should use OF graph uncondtionally, even in the DSI > > case. We need to ensure backward-compatibility, but I'd like new > > bindings (and thus new drivers) to always use OF graph. >=20 > I just went over the thread on "drm: of: Improve error handling in bridge= /panel > detection" again and I'm no longer sure there's actually still an issue t= hat > stands, with the fix that allows returning -ENODEV when possible. >=20 > The remaining issue that was brought up was with a connector node, but it= should > be up to the driver to detect that and avoid calling drm_of_find_panel_or= _bridge > in such situations. >=20 > So with that in mind it feels like the child node approach can be viable > (and integrated in the same helper). >=20 > We might still want to favor an explicit OF graph approach, but note that > dsi-controller.yaml also specifies extra properties that are specific to > MIPI DSI and I'm not sure there are equivalent definitions for the OF gra= ph > approach. >=20 > What do you think? I don't think Laurent's point was to move the child node away from its DSI controller, that part doesn't make much sense. The panel or bridge is still accessed through the DSI bus, so it very much belongs there. What he meant I think was that we mandate the OF graph for all panels, so for panels/bridges controlled through DCS, you would still list the output through the graph. Maxime --y6e5ldbnofa2rtha Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYmfraQAKCRDj7w1vZxhR xTLvAPwNTRGGtvE//BlyATQ4o/WTVAfO/eP5PRbMPa1jRUc95AD/a/wgPoeGE+ap VSrVt3Fc47ZURZmI1uOBRoIGcl1Kfgc= =4Mvq -----END PGP SIGNATURE----- --y6e5ldbnofa2rtha--