[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20241105-juicy-cooperative-squid-76deee@houat>
Date: Tue, 5 Nov 2024 10:58:02 +0100
From: Maxime Ripard <mripard@...nel.org>
To: Herve Codina <herve.codina@...tlin.com>
Cc: Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Andrzej Hajda <andrzej.hajda@...el.com>, Neil Armstrong <neil.armstrong@...aro.org>,
Robert Foss <rfoss@...nel.org>, Jonas Karlman <jonas@...boo.se>,
Jernej Skrabec <jernej.skrabec@...il.com>, David Airlie <airlied@...il.com>,
Simona Vetter <simona@...ll.ch>, Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Thomas Zimmermann <tzimmermann@...e.de>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>, Marek Vasut <marex@...x.de>,
dri-devel@...ts.freedesktop.org, devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
Luca Ceresoli <luca.ceresoli@...tlin.com>, Thomas Petazzoni <thomas.petazzoni@...tlin.com>
Subject: Re: [PATCH 2/2] drm: bridge: ti-sn65dsi83: Add error recovery
mechanism
On Tue, Nov 05, 2024 at 09:15:03AM +0100, Herve Codina wrote:
> Hi Maxime, Laurent,
>
> On Mon, 28 Oct 2024 16:09:13 +0200
> Laurent Pinchart <laurent.pinchart@...asonboard.com> wrote:
>
> > On Mon, Oct 28, 2024 at 02:55:47PM +0100, Maxime Ripard wrote:
> > > On Mon, Oct 28, 2024 at 03:28:58PM +0200, Laurent Pinchart wrote:
> > > > On Mon, Oct 28, 2024 at 01:21:45PM +0100, Maxime Ripard wrote:
> > > > > On Mon, Oct 28, 2024 at 01:28:57PM +0200, Laurent Pinchart wrote:
> > > > > > On Mon, Oct 28, 2024 at 09:13:31AM +0100, Herve Codina wrote:
> > > > > > > On Sun, 27 Oct 2024 18:23:50 +0200 Laurent Pinchart wrote:
> > > > > > >
> > > > > > > [...]
> > > > > > > > > +static int sn65dsi83_reset_pipeline(struct sn65dsi83 *sn65dsi83)
> > > > > > > > > +{
> > > > > > > > > + struct drm_device *dev = sn65dsi83->bridge.dev;
> > > > > > > > > + struct drm_modeset_acquire_ctx ctx;
> > > > > > > > > + struct drm_atomic_state *state;
> > > > > > > > > + int err;
> > > > > > > > > +
> > > > > > > > > + /* Use operation done in drm_atomic_helper_suspend() followed by
> > > > > > > > > + * operation done in drm_atomic_helper_resume() but without releasing
> > > > > > > > > + * the lock between suspend()/resume()
> > > > > > > > > + */
> > > > > > > > > +
> > > > > > > > > + DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, err);
> > > > > > > > > +
> > > > > > > > > + state = drm_atomic_helper_duplicate_state(dev, &ctx);
> > > > > > > > > + if (IS_ERR(state)) {
> > > > > > > > > + err = PTR_ERR(state);
> > > > > > > > > + goto unlock;
> > > > > > > > > + }
> > > > > > > > > +
> > > > > > > > > + err = drm_atomic_helper_disable_all(dev, &ctx);
> > > > > > > > > + if (err < 0)
> > > > > > > > > + goto unlock;
> > > > > > > > > +
> > > > > > > > > + drm_mode_config_reset(dev);
> > > > > > > > > +
> > > > > > > > > + err = drm_atomic_helper_commit_duplicated_state(state, &ctx);
> > > > > > > >
> > > > > > > > Committing a full atomic state from a bridge driver in an asynchronous
> > > > > > > > way seems quite uncharted territory, and it worries me. It's also a very
> > > > > > > > heavyweight, you disable all outputs here, instead of focussing on the
> > > > > > > > output connected to the bridge. Can you either implement something more
> > > > > > > > local, resetting the bridge only, or create a core helper to handle this
> > > > > > > > kind of situation, on a per-output basis ?
> > > > > > >
> > > > > > > A full restart of the bridge (power off/on) is needed and so we need to
> > > > > > > redo the initialization sequence. This initialization sequence has to be
> > > > > > > done with the DSI data lanes (bridge inputs) driven in LP11 state and so
> > > > > > > without any video stream. Only focussing on bridge outputs will not be
> > > > > > > sufficient. That's why I brought the pipeline down and restarted it.
> > > > > >
> > > > > > Fair point.
> > > > > >
> > > > > > > Of course, I can copy/paste sn65dsi83_reset_pipeline() to a core helper
> > > > > > > function. Is drm_atomic_helper_reset_all() could be a good candidate?
> > > > > >
> > > > > > The helper should operate on a single output, unrelated outputs should
> > > > > > not be affected.
> > > > >
> > > > > Also, you don't want to reset anything, you just want the last commit to
> > > > > be replayed.
> > > >
> > > > I'm not sure about that. If the last commit is just a page flip, that
> > > > won't help, will it ?
> > >
> > > The alternative would be that you start anew with a blank state, which
> > > effectively drops every configuration that has been done by userspace.
> > > This is terrible.
> > >
> > > And a page flip wouldn't have affected the connector and
> > > connector->state would still be to the last state that affected it, so
> > > it would work.
> >
> > Ah right, you didn't mean replaying the last commit then, but first
> > disabling the output and then restoring the current state ? That should
> > work.
> >
>
> Thanks for the feedback.
>
> If I understand correctly, I should try to disable the output.
> What is the 'output' exactly, the connector?
At the very least, the encoder, connector and everything in between. And
maybe the CRTC.
> How can I disable it? Can you give me some pointers?
See my mail here:
https://lore.kernel.org/all/20241028-thankful-boar-of-camouflage-3de96c@houat/
> Further more, is disabling the "output" disable the whole path where the
> bridge is located?
Not the whole path, but most of it, yeah.
> I mean, I need to power off/on the bridge and re-init it with its input DSI
> lines in LP11.
Right, and that might work with that bridge in particular, but it's
definitely not generic.
Maxime
Download attachment "signature.asc" of type "application/pgp-signature" (274 bytes)
Powered by blists - more mailing lists