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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0F2BC433EF for ; Fri, 18 Mar 2022 16:22:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238895AbiCRQXm (ORCPT ); Fri, 18 Mar 2022 12:23:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235610AbiCRQXR (ORCPT ); Fri, 18 Mar 2022 12:23:17 -0400 Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 488C95838B for ; Fri, 18 Mar 2022 09:19:36 -0700 (PDT) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 2C2463201E3E; Fri, 18 Mar 2022 12:18:50 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Fri, 18 Mar 2022 12:18:51 -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; bh=W0RtaiVVoWuDJFHs12YiGTwXGd5lX99ofXkpvP buN/M=; b=ZGHO3Vd7IFoj1GyK1l6273ryTg0I/eVkqSUzVtrCkje71GM+kcqIkd G8YfOBYH2poC/2y8VKHPqdbw6OWYqgVXR+pZ7/OcKnUsGFnYfqpz9n+NSpLzcxg3 Bbt7TDEoHMRwZkk5utXbvLcmGHJyYU1Sir+TiWwrBqcLtQBLdx6oKMqullp42bq3 kLlbttwB+yVtSwe8j6goGK8bhp2qir4iTqlMMOmuJPcLL4JjcYMuILxWFsGgAOzz d53KQHekoMPR0NJdMDFObhPnrju0a7CCPWvyU8T4x/H2ObVUZCkkdcxQyjmOlUS9 uRuelEAHaD1qZrt2s/g4fl5eija+yf8A== 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=fm3; bh=W0RtaiVVoWuDJFHs1 2YiGTwXGd5lX99ofXkpvPbuN/M=; b=Sg1aNxuhbeKW3dADtgBAJKe9zO6uT+Lhm 2QLxdFnWCmakrgRE8iDlBRd50QTnawTBL+FTxsmjRb/xGI3ojjHeq/bMIm5bBpRi wO70npk24n5P/aVhscq4AmbkqS7UrMPgKBhP+R5BjWviAe0rETmF7+NBTXxrrOxz hSHliveO/GXyb9pyMFGOvrkUsBNEap7qwv63p+xEO810lMhx51b7vB6l/hXSyEdj LF3jWZ6Q/4Knhd9ENv3n1SsNL9tthJjuMynrpuR06DDfaDM57plwPKPW2cirEBBG tCQaQuRLev2IBjokWNCKAjE82mbaWo8gpex01FbpaKAgcWdIOcfyQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudefiedgkeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucdnkfhovfculdeitddmnecujfgurhepfffhvffukf hfgggtuggjsehgtderredttddvnecuhfhrohhmpeforgigihhmvgcutfhiphgrrhguuceo mhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrthhtvghrnhepleekgeehhf dutdeljefgleejffehfffgieejhffgueefhfdtveetgeehieehgedunecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnh hordhtvggthh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 18 Mar 2022 12:18:48 -0400 (EDT) Date: Fri, 18 Mar 2022 17:18:47 +0100 From: Maxime Ripard To: Paul Kocialkowski Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Linus Walleij , Jagan Teki , Thomas Petazzoni Subject: Re: [PATCH v2] drm: of: Properly try all possible cases for bridge/panel detection Message-ID: <20220318161847.ezi6yat4on7rvfdf@houat> References: <20220318160249.126431-1-paul.kocialkowski@bootlin.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="z4cu6dac2674z2wt" Content-Disposition: inline In-Reply-To: <20220318160249.126431-1-paul.kocialkowski@bootlin.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --z4cu6dac2674z2wt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 18, 2022 at 05:02:49PM +0100, Paul Kocialkowski wrote: > While bridge/panel detection was initially relying on the usual > port/ports-based of graph detection, it was recently changed to > perform the lookup on any child node that is not port/ports > instead when such a node is available, with no fallback on the > usual way. >=20 > This results in breaking detection when a child node is present > but does not contain any panel or bridge node, even when the > usual port/ports-based of graph is there. >=20 > In order to support both situations properly, this commit reworks > the logic to try both options and not just one of the two: it will > only return -EPROBE_DEFER when both have failed. >=20 > Signed-off-by: Paul Kocialkowski > Fixes: 80253168dbfd ("drm: of: Lookup if child node has panel or bridge") > --- >=20 > Changes since v1: > - Renamed remote to node; > - Renamed helper to find_panel_or_bridge; > - Cleared bridge pointer early; > - Returned early to make the code more concise; >=20 > --- > drivers/gpu/drm/drm_of.c | 98 ++++++++++++++++++++-------------------- > 1 file changed, 49 insertions(+), 49 deletions(-) >=20 > diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c > index 9d90cd75c457..63137c833b7a 100644 > --- a/drivers/gpu/drm/drm_of.c > +++ b/drivers/gpu/drm/drm_of.c > @@ -219,6 +219,28 @@ int drm_of_encoder_active_endpoint(struct device_nod= e *node, > } > EXPORT_SYMBOL_GPL(drm_of_encoder_active_endpoint); > =20 > +static int find_panel_or_bridge(struct device_node *node, > + struct drm_panel **panel, > + struct drm_bridge **bridge) > +{ > + if (panel) { > + *panel =3D of_drm_find_panel(node); > + if (!IS_ERR(*panel)) > + return 0; > + else > + *panel =3D NULL; You don't need the else branch here, we already cleared panel in drm_of_find_panel_or_bridge Looks good otherwise, thanks! Maxime --z4cu6dac2674z2wt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYjSw5gAKCRDj7w1vZxhR xWMYAP9UxgWQ44wOKvarITHty4nCGtH+DXxERccY8JZh+3tr0wD/eIa4rSSsOg12 DUrsZb8HDRBGNTMwSgMSFnfdBo2+2Qo= =mFT4 -----END PGP SIGNATURE----- --z4cu6dac2674z2wt--