All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Cc: intel-gfx <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/i915: Update PSR on resume.
Date: Tue, 10 Jun 2014 17:24:57 +0200	[thread overview]
Message-ID: <20140610152457.GY5821@phenom.ffwll.local> (raw)
In-Reply-To: <CABVU7+s47LQztd0bwU=wQen-OhLzf-e5g=CUVrruKqSkj5rX2w@mail.gmail.com>

On Tue, Jun 10, 2014 at 08:11:41AM -0700, Rodrigo Vivi wrote:
> would you be ok by a patch that doesn't trigger the psr_update but just set
> psr.setup_done = false on resume?
> 
> I don't want to do more setup than really needed.
> 
> Or you mean move even psr.setup_done to crtc_enable?

Yeah, if there's some setup we need to do (e.g. figure out whether we can
do psr or set up the hw) we should do it in crtc_enable.

That's the only common function for modeset stuff shared between system
resume and runtime resume, and we'll loose register values in both cases.
-Daniel

> 
> 
> On Thu, Jun 5, 2014 at 2:15 AM, Daniel Vetter <daniel@ffwll.ch> wrote:
> 
> > On Wed, Jun 04, 2014 at 12:17:14PM -0700, Rodrigo Vivi wrote:
> > > On Wed, May 28, 2014 at 5:57 AM, Daniel Vetter <daniel@ffwll.ch> wrote:
> > >
> > > > On Tue, May 27, 2014 at 04:50:14PM -0700, Rodrigo Vivi wrote:
> > > > > Some registers set during setup might not be persistent after
> > > > suspend/resume.
> > > > > This was causing bugs for some people that was unable to get PSR
> > entry
> > > > state
> > > > > after resume cycle.
> > > > >
> > > > > v2: Adding some comments and better commit message explaining why
> > this
> > > > is needed.
> > > > >
> > > > > Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
> > > > > ---
> > > > >  drivers/gpu/drm/i915/i915_suspend.c | 6 ++++++
> > > > >  1 file changed, 6 insertions(+)
> > > > >
> > > > > diff --git a/drivers/gpu/drm/i915/i915_suspend.c
> > > > b/drivers/gpu/drm/i915/i915_suspend.c
> > > > > index 56785e8..1923708 100644
> > > > > --- a/drivers/gpu/drm/i915/i915_suspend.c
> > > > > +++ b/drivers/gpu/drm/i915/i915_suspend.c
> > > > > @@ -288,6 +288,12 @@ static void i915_restore_display(struct
> > drm_device
> > > > *dev)
> > > > >               I915_WRITE(PP_CONTROL,
> > dev_priv->regfile.savePP_CONTROL);
> > > > >       }
> > > > >
> > > > > +     /* Forcing a full init sequence after resume to make sure all
> > > > > +     * registers are properly set. Some might not be persistent
> > after
> > > > > +     * suspend/resume cycle. */
> > > > > +     dev_priv->psr.setup_done = false;
> > > > > +     intel_edp_psr_update(dev);
> > > >
> > > > No, crtc_enable should take care of this. There's more places (like
> > after
> > > > runtime pm) where the hw has potentially lost all register contents, so
> > > > crtc_enabl is the right place for this.
> > > > -Daniel
> > > >
> > >
> > > crtc_enable takes care of the update, but not the setup part that is done
> > > only once...
> > > I do believe that only the setup_done = false is really needed here, but
> > > doesn't heart to trigger the update right here
> > > and fixes the bug...
> >
> > restore_display hurts. If there's some setup we need to do, we _really_
> > need to do it in crtc_enable. Splattering setup code all over the code is
> > one of the prime sources of bugs we have wrt rpm, s/r and driver load.
> > -Daniel
> > --
> > Daniel Vetter
> > Software Engineer, Intel Corporation
> > +41 (0) 79 365 57 48 - http://blog.ffwll.ch
> >
> 
> 
> 
> -- 
> Rodrigo Vivi
> Blog: http://blog.vivi.eng.br

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2014-06-10 15:25 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-16  0:12 [PATCH 00/11] HSW/BDW PSR Rodrigo Vivi
2014-05-16  0:13 ` [PATCH 01/11] drm/i915: move psr_setup_done to psr struct Rodrigo Vivi
2014-05-22 17:50   ` Paulo Zanoni
2014-05-23 20:45     ` [PATCH] " Rodrigo Vivi
2014-05-26  7:44       ` Daniel Vetter
2014-05-16  0:13 ` [PATCH 02/11] drm/i915: Update PSR on resume Rodrigo Vivi
2014-05-23 20:51   ` Paulo Zanoni
2014-05-27 23:50     ` [PATCH] " Rodrigo Vivi
2014-05-28 12:57       ` Daniel Vetter
2014-06-04 19:17         ` Rodrigo Vivi
2014-06-05  9:15           ` Daniel Vetter
2014-06-10 15:11             ` Rodrigo Vivi
2014-06-10 15:24               ` Daniel Vetter [this message]
2014-06-10 10:49                 ` [PATCH] drm/i915: Force full PSR setup during crtc enable Rodrigo Vivi
2014-06-11  9:42                   ` Daniel Vetter
2014-08-08 17:19                 ` [PATCH] drm/i915: Update PSR on resume Rodrigo Vivi
2014-08-09  7:40                   ` Daniel Vetter
2014-08-11 16:57                     ` Rodrigo Vivi
2014-08-11 17:31                       ` Daniel Vetter
2014-05-16  0:13 ` [PATCH 03/11] drm/i915: Use HAS_PSR to avoid unecessary interactions Rodrigo Vivi
2014-06-03  9:26   ` Vijay Purushothaman
2014-05-16  0:13 ` [PATCH 04/11] drm/i915: Don't let update_psr function actually enable PSR Rodrigo Vivi
2014-06-03 11:04   ` Vijay Purushothaman
2014-05-16  0:13 ` [PATCH 05/11] drm/i915: Do not try to enable PSR when Panel doesn't suport it Rodrigo Vivi
2014-05-16 10:21   ` Chris Wilson
2014-05-16 16:39     ` Rodrigo Vivi
2014-05-16  0:13 ` [PATCH 06/11] drm/i915: Force PSR exit by inactivating it Rodrigo Vivi
2014-05-16 10:23   ` Chris Wilson
2014-05-16 16:42     ` Rodrigo Vivi
2014-06-03 11:10       ` Vijay Purushothaman
2014-05-16 10:25   ` Chris Wilson
2014-05-16  0:13 ` [PATCH 07/11] drm/i915: BDW PSR: Add single frame update support Rodrigo Vivi
2014-05-16  0:13 ` [PATCH 08/11] drm/i915: BDW PSR: Remove limitations that aren't valid for BDW Rodrigo Vivi
2014-06-03 11:20   ` Vijay Purushothaman
2014-05-16  0:13 ` [PATCH 09/11] drm/i915: BDW PSR: Remove DDIA limitation for Broadwell Rodrigo Vivi
2014-05-16  0:13 ` [PATCH 10/11] drm/i915: Improve PSR debugfs status Rodrigo Vivi
2014-06-02 18:24   ` Vijay Purushothaman
2014-06-03  7:40     ` Daniel Vetter
2014-06-03 11:22       ` Vijay Purushothaman
2014-05-16  0:13 ` [PATCH 11/11] drm/i915: PSR HSW: update after enabling sprite Rodrigo Vivi
2014-06-03 11:25   ` Vijay Purushothaman
2014-06-12 10:12 ` [PATCH 00/11] HSW/BDW PSR Vijay Purushothaman

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=20140610152457.GY5821@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=rodrigo.vivi@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.