From: Maxime Ripard <maxime@cerno.tech>
To: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
Linus Walleij <linus.walleij@linaro.org>,
Jagan Teki <jagan@amarulasolutions.com>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH v2] drm: of: Properly try all possible cases for bridge/panel detection
Date: Mon, 21 Mar 2022 10:12:36 +0100 [thread overview]
Message-ID: <20220321091236.5rcottkhtztvijpl@houat> (raw)
In-Reply-To: <YjSx1rNLTh/L3MQQ@aptenodytes>
[-- Attachment #1: Type: text/plain, Size: 2482 bytes --]
On Fri, Mar 18, 2022 at 05:22:46PM +0100, Paul Kocialkowski wrote:
> On Fri 18 Mar 22, 17:18, Maxime Ripard wrote:
> > 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.
> > >
> > > 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.
> > >
> > > 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.
> > >
> > > Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
> > > Fixes: 80253168dbfd ("drm: of: Lookup if child node has panel or bridge")
> > > ---
> > >
> > > 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;
> > >
> > > ---
> > > drivers/gpu/drm/drm_of.c | 98 ++++++++++++++++++++--------------------
> > > 1 file changed, 49 insertions(+), 49 deletions(-)
> > >
> > > 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_node *node,
> > > }
> > > EXPORT_SYMBOL_GPL(drm_of_encoder_active_endpoint);
> > >
> > > +static int find_panel_or_bridge(struct device_node *node,
> > > + struct drm_panel **panel,
> > > + struct drm_bridge **bridge)
> > > +{
> > > + if (panel) {
> > > + *panel = of_drm_find_panel(node);
> > > + if (!IS_ERR(*panel))
> > > + return 0;
> > > + else
> > > + *panel = NULL;
> >
> > You don't need the else branch here, we already cleared panel in
> > drm_of_find_panel_or_bridge
>
> I think we do, because of_drm_find_panel doesn't return NULL when an error
> happens but PTR_ERR(), so we need to clear it to keep up with previous
> expectations.
Ah, right. We should remove the else then, checkpatch complains about it.
Maxime
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
prev parent reply other threads:[~2022-03-21 9:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-18 16:02 Paul Kocialkowski
2022-03-18 16:18 ` Maxime Ripard
2022-03-18 16:22 ` Paul Kocialkowski
2022-03-21 9:12 ` Maxime Ripard [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220321091236.5rcottkhtztvijpl@houat \
--to=maxime@cerno.tech \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=jagan@amarulasolutions.com \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=paul.kocialkowski@bootlin.com \
--cc=thomas.petazzoni@bootlin.com \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®