[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CA+ASDXOFcmLO_UBfzZ37NmQ3i3n_=5XPcHa_7=OLFvg6xg=YHg@mail.gmail.com>
Date: Mon, 28 Feb 2022 11:59:51 -0800
From: Brian Norris <briannorris@...omium.org>
To: Liu Ying <victor.liu@....nxp.com>
Cc: Andrzej Hajda <andrzej.hajda@...el.com>,
Neil Armstrong <narmstrong@...libre.com>,
Robert Foss <robert.foss@...aro.org>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
Jonas Karlman <jonas@...boo.se>,
Linux Kernel <linux-kernel@...r.kernel.org>,
dri-devel <dri-devel@...ts.freedesktop.org>,
Sean Paul <seanpaul@...omium.org>,
Jernej Skrabec <jernej.skrabec@...il.com>,
stable <stable@...r.kernel.org>, Sean Paul <sean@...rly.run>,
Laurent Pinchart <Laurent.pinchart@...asonboard.com>
Subject: Re: [PATCH 2/2] drm/atomic: Force bridge self-refresh-exit on CRTC switch
Hi Liu,
On Mon, Feb 28, 2022 at 1:02 AM Liu Ying <victor.liu@....nxp.com> wrote:
> On Tue, 2022-02-15 at 15:54 -0800, Brian Norris wrote:
> > --- a/drivers/gpu/drm/drm_atomic_helper.c
> > +++ b/drivers/gpu/drm/drm_atomic_helper.c
> > @@ -1011,9 +1011,19 @@ crtc_needs_disable(struct drm_crtc_state *old_state,
> > return drm_atomic_crtc_effectively_active(old_state);
> >
> > /*
> > - * We need to run through the crtc_funcs->disable() function if the CRTC
> > - * is currently on, if it's transitioning to self refresh mode, or if
> > - * it's in self refresh mode and needs to be fully disabled.
> > + * We need to disable bridge(s) and CRTC if we're transitioning out of
> > + * self-refresh and changing CRTCs at the same time, because the
> > + * bridge tracks self-refresh status via CRTC state.
> > + */
> > + if (old_state->self_refresh_active && new_state->enable &&
> > + old_state->crtc != new_state->crtc)
> > + return true;
>
> I think 'new_state->enable' should be changed to 'new_state->active',
> because 'active' is the one to enable/disable the CRTC while 'enable'
> reflects whether a mode blob is set to CRTC state. The overall logic
> added above is ok to me. Let's see if others have any comments.
Thanks for the review, and good catch. This actually shows that most
of my development was before commit 69e630016ef4 ("drm/atomic: Check
new_crtc_state->active to determine if CRTC needs disable in self
refresh mode"). In fact, the "state->enable" condition was included
here mostly as a complement to the "!state->enable" condition that was
present previously, and I didn't adapt it properly upon rebase.
In practice, this portion of the condition is not needed at all; we
really want to exit PSR on CRTC-switch regardless of the new-CRTC
state. So rather than change "enable" to "active", I plan to remove it
entirely.
I'll give it some local tests and send v2 eventually.
Thanks,
Brian
Powered by blists - more mailing lists