public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Cc: Maxime Ripard <maxime@cerno.tech>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Jagan Teki <jagan@amarulasolutions.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	Thierry Reding <thierry.reding@gmail.com>,
	Rob Clark <robdclark@gmail.com>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	Linus Walleij <linus.walleij@linaro.org>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robert Foss <robert.foss@linaro.org>
Subject: Re: [PATCH 2/2] Revert "drm: of: Lookup if child node has panel or bridge"
Date: Tue, 26 Apr 2022 14:10:08 -0700	[thread overview]
Message-ID: <YmhfsGAJjSmSPs/l@ripper> (raw)
In-Reply-To: <Ymf4nmQAkEciwyt/@aptenodytes>

On Tue 26 Apr 06:50 PDT 2022, Paul Kocialkowski wrote:

> On Tue 26 Apr 22, 15:19, Maxime Ripard wrote:
> > On Tue, Apr 26, 2022 at 03:04:17PM +0200, Paul Kocialkowski wrote:
> > > On Tue 26 Apr 22, 14:55, Maxime Ripard wrote:
> > > > On Tue, Apr 26, 2022 at 02:54:01PM +0200, Maxime Ripard wrote:
> > > > > 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
> > > > > > > > > > > 
> > > > > > > > > > > On Thu, Apr 21, 2022 at 4:40 AM Bjorn Andersson wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > Commit '80253168dbfd ("drm: of: Lookup if child node has panel or
> > > > > > > > > > > > bridge")' attempted to simplify the case of expressing a simple 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 might not be a
> > > > > > > > > > > > panel or bridge.  Examples of this can be a aux-bus in the case of
> > > > > > > > > > > > DisplayPort, or an opp-table represented before the panel node.
> > > > > > > > > > > >
> > > > > > > > > > > > In these cases the reverted commit prevents the caller from ever 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 reference to the
> > > > > > > > > > > > panel in the trivial case as well.
> > > > > > > > > > > 
> > > > > > > > > > > This eventually breaks many child-based devm_drm_of_get_bridge
> > > > > > > > > > > switched drivers.  Do you have any suggestions on how to proceed to
> > > > > > > > > > > succeed in those use cases as well?
> > > > > > > > > > 
> > > > > > > > > > I guess we could create a new helper for those, like
> > > > > > > > > > devm_drm_of_get_bridge_with_panel, or something.
> > > > > > > > > 
> > > > > > > > > Oh wow I feel stupid for not thinking about that.
> > > > > > > > > 
> > > > > > > > > Yeah I agree that it seems like the best option.
> > > > > > > > 
> > > > > > > > Should I prepare a patch with such a new helper?
> > > > > > > > 
> > > > > > > > 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.
> > > > > > > > 
> > > > > > > > I really don't have a clear idea of which driver would need to be switched
> > > > > > > > over though. Could someone (Jagan?) let me know where it would be needed?
> > > > > > > > 
> > > > > > > > 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?)
> > > > > > > 
> > > > > > > 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.
> > > > > > 
> > > > > > 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 that
> > > > > > stands, with the fix that allows returning -ENODEV when possible.
> > > > > > 
> > > > > > 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.
> > > > > > 
> > > > > > So with that in mind it feels like the child node approach can be viable
> > > > > > (and integrated in the same helper).
> > > > > > 
> > > > > > 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 graph
> > > > > > approach.
> > > > > > 
> > > > > > 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.
> > > > 
> > > > Also, we're already in a bit of a mess right now. I don't think rushing
> > > > that kind of patches in a (late) rc is making much sense, but as I said,
> > > > if you want to start working on this, then I'll take a revert for the
> > > > next rc, and then we can work calmly on this.
> > > 
> > > As I understand it we either have some broken stuff because of the revert of:
> > > - drm: of: Lookup if child node has panel or bridge
> > > - drm: of: Properly try all possible cases for bridge/panel detection
> > > 
> > > because the child node is already used in places, or we can have broken stuff
> > > because with the patches because with these two patches -ENODEV is no longer
> > > returned.
> > > 
> > > Now with the extra patch that I sent:
> > > - drm: of: Improve error handling in bridge/panel detection
> > > 
> > > we get -ENODEV back, except for the connector case but this one should be
> > > handled in drivers directly and drm_of_find_panel_or_bridge should not be
> > > called in that situation.
> > > 
> > > So all in all it seems that all the pieces are there, unless I'm missing
> > > something.
> > > 
> > > What do you think?
> > 
> > If Bjorn and Thierry can confirm that it indeeds work in their case,
> > I'll be happy to apply those patches as well.
> 
> I still think we'd need a fix for Bjorn's connector case though.
> Not sure I would be confident providing that one without the hardware
> to test with.
> 
> Bjorn, what do you think?
> 

I'm okay with the idea that it's up the driver to check that the output
port references an usb-c-connector - either before the call or upon
drm_of_find_panel_or_bridge() returning an error.

Regards,
Bjorn

  reply	other threads:[~2022-04-26 21:08 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-20 23:12 [PATCH 1/2] Revert "drm: of: Properly try all possible cases for bridge/panel detection" Bjorn Andersson
2022-04-20 23:12 ` [PATCH 2/2] Revert "drm: of: Lookup if child node has panel or bridge" Bjorn Andersson
2022-04-21  7:20   ` (subset) " Maxime Ripard
2022-04-21  7:45   ` Jagan Teki
2022-04-21  8:23     ` Maxime Ripard
2022-04-21  8:59       ` Paul Kocialkowski
2022-04-26  7:54         ` Paul Kocialkowski
2022-04-26  8:10           ` Jagan Teki
2022-04-27 14:34             ` Maxime Ripard
2022-04-28  6:17               ` Marek Szyprowski
2022-04-28  8:25                 ` Jagan Teki
2022-04-28  8:39               ` Jagan Teki
2022-04-28 22:17                 ` Laurent Pinchart
2022-04-29  8:24                   ` Jagan Teki
2022-04-29 15:46                   ` Maxime Ripard
2022-04-29 16:05                     ` Laurent Pinchart
2022-05-04 15:08                       ` Maxime Ripard
2022-04-26 11:33           ` Laurent Pinchart
2022-04-26 12:41             ` Paul Kocialkowski
2022-04-26 12:54               ` Maxime Ripard
2022-04-26 12:55                 ` Maxime Ripard
2022-04-26 13:04                   ` Paul Kocialkowski
2022-04-26 13:19                     ` Maxime Ripard
2022-04-26 13:50                       ` Paul Kocialkowski
2022-04-26 21:10                         ` Bjorn Andersson [this message]
2022-04-27  7:34                           ` Paul Kocialkowski
2022-05-03  0:03                             ` Bjorn Andersson
2022-04-26 12:58                 ` Paul Kocialkowski
2022-04-27 13:10                 ` Laurent Pinchart
2022-04-26 12:51           ` Maxime Ripard
2022-04-27  6:59       ` Jagan Teki
2022-04-27 11:52         ` Jagan Teki
2022-04-27 12:19           ` Paul Kocialkowski
2022-04-27 12:59             ` Jagan Teki
2022-04-27 13:10           ` Laurent Pinchart
2022-04-20 23:19 ` [PATCH 1/2] Revert "drm: of: Properly try all possible cases for bridge/panel detection" Bjorn Andersson
2022-04-21  7:13   ` Paul Kocialkowski
2022-04-21  7:26     ` Maxime Ripard
2022-04-22  7:58     ` Raphael Gallais-Pou
2022-04-21  7:11 ` Paul Kocialkowski
2022-04-21  7:20 ` (subset) " Maxime Ripard

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=YmhfsGAJjSmSPs/l@ripper \
    --to=bjorn.andersson@linaro.org \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jagan@amarulasolutions.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=maxime@cerno.tech \
    --cc=paul.kocialkowski@bootlin.com \
    --cc=robdclark@gmail.com \
    --cc=robert.foss@linaro.org \
    --cc=thierry.reding@gmail.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