All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: "Pandiyan, Dhinakaran" <dhinakaran.pandiyan@intel.com>
Cc: "intel-gfx@lists.freedesktop.org" <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/i915/psr: Display WA 0884 applied broadly for more HW tracking.
Date: Mon, 12 Mar 2018 11:50:09 -0700	[thread overview]
Message-ID: <20180312185009.GQ5970@intel.com> (raw)
In-Reply-To: <1520881462.4958.31.camel@dk-H97M-D3H>

On Mon, Mar 12, 2018 at 11:40:26AM -0700, Pandiyan, Dhinakaran wrote:
> 
> 
> 
> On Mon, 2018-03-12 at 20:29 +0200, Ville Syrjälä wrote:
> > On Thu, Mar 08, 2018 at 04:52:18PM -0800, Rodrigo Vivi wrote:
> > > WA 0884:bxt:all,cnl:*:A - "When FBC is enabled with eDP PSR,
> > > the CPU host modify writes may not get updated on the Display
> > > as expected.
> > > WA: Write 0x00000000 to CUR_SURFLIVE_A with every CPU
> > > host modify write to trigger PSR exit."
> > > 
> > > We can also find on spec other cases where they describe
> > > bogus writes to cursor registers to force PSR exit with
> > > HW tracking. And it was confirmed by HW engineers that
> > > this Wa can be safely applied for any frontbuffer activity.
> > > 
> > > So let's use this more and more here instead of forcibly
> > > disable and re-enable PSR everytime that we have a simple
> > > reliable flush case.
> > > 
> > > Other commits improve the fbcon/fbdev use a lot, but this
> > > approach is the only when where we can get a fully reliable
> > > console with no slowness or missed frames and PSR still
> > > enabled and active.
> > > 
> > > v2: - Rebase on drm-tip
> > >     - (DK) Add a comment to explain that WA
> > >     tells about writing 0 to CUR_SURFLIVE_A but we write to
> > >     CUR_SURFLIVE(pipe).
> > > v3: Wa doesn't work on PSR2.
> > > 
> > > Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> > > Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/i915_reg.h  |  3 +++
> > >  drivers/gpu/drm/i915/intel_psr.c | 19 +++++++++++++++++--
> > >  2 files changed, 20 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> > > index e6a8c0ee7df1..abdc513a9edd 100644
> > > --- a/drivers/gpu/drm/i915/i915_reg.h
> > > +++ b/drivers/gpu/drm/i915/i915_reg.h
> > > @@ -6032,6 +6032,9 @@ enum {
> > >  #define IVB_CURSOR_B_OFFSET 0x71080
> > >  #define IVB_CURSOR_C_OFFSET 0x72080
> > >  
> > > +#define _CUR_SURLIVE		0x700AC
> > > +#define CUR_SURLIVE(pipe)	_CURSOR2(pipe, _CUR_SURLIVE)
> > 
> > There should be a better place for this.

Oh! sorry... my inbox refreshed after I pushed the button :(
I tried to keep near the cursor regs. Do you want me to move in a
follow-up patch? where it would be better?

> > 
> > > +
> > >  /* Display A control */
> > >  #define _DSPACNTR				0x70180
> > >  #define   DISPLAY_PLANE_ENABLE			(1<<31)
> > > diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c
> > > index 30932527e663..b0286722a72f 100644
> > > --- a/drivers/gpu/drm/i915/intel_psr.c
> > > +++ b/drivers/gpu/drm/i915/intel_psr.c
> > > @@ -1027,8 +1027,23 @@ void intel_psr_flush(struct drm_i915_private *dev_priv,
> > >  	dev_priv->psr.busy_frontbuffer_bits &= ~frontbuffer_bits;
> > >  
> > >  	/* By definition flush = invalidate + flush */
> > > -	if (frontbuffer_bits)
> > > -		intel_psr_exit(dev_priv);
> > > +	if (frontbuffer_bits) {
> > > +		if (dev_priv->psr.psr2_support ||
> > > +		    IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
> > > +			intel_psr_exit(dev_priv);
> > > +		} else {
> > > +			/*
> > > +			 * Display WA #0884: all
> > > +			 * This documented WA for bxt can be safely applied
> > > +			 * broadly so we can force HW tracking to exit PSR
> > > +			 * instead of disabling and re-enabling.
> > > +			 * Workaround tells us to write 0 to CUR_SURLIVE_A,
> > > +			 * but it makes more sense write to the current active
> > > +			 * pipe.
> > > +			 */
> > 
> > Might want to note that SURFLIVE is read only so the write should not
> > not have any other side effects, or at least I hope that is the case.
> > 
> > I don't really understand why we're doing PSR exit in the frontbuffer
> > flush though. Shouldn't we have already exited on invalidate?
> 
> fbdev code doesn't call invalidate at all and cannot call because the
> buffer modification functions are all in atomic contexts.

That was a design decision Paulo, and/or Chris, and/or Daniel made on
frontbuffer tracking engine, a while ago. By definition:
flush = invalidate + flush.
Otherwise in all fbdev code we would have to have a call together
of invalidate and flush.
We probably lack on documentation there...

> 
> 
> > 
> > > +			I915_WRITE(CUR_SURLIVE(pipe), 0);
> > > +		}
> > > +	}
> > >  
> > >  	if (!dev_priv->psr.active && !dev_priv->psr.busy_frontbuffer_bits)
> > >  		if (!work_busy(&dev_priv->psr.work.work))
> > > -- 
> > > 2.13.6
> > > 
> > > _______________________________________________
> > > Intel-gfx mailing list
> > > Intel-gfx@lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> > 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2018-03-12 18:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-09  0:52 [PATCH] drm/i915/psr: Display WA 0884 applied broadly for more HW tracking Rodrigo Vivi
2018-03-09  1:23 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-03-09  5:23 ` ✓ Fi.CI.IGT: " Patchwork
2018-03-12 18:07 ` [PATCH] " Pandiyan, Dhinakaran
2018-03-12 18:45   ` Rodrigo Vivi
2018-03-12 18:50     ` Pandiyan, Dhinakaran
2018-03-12 18:29 ` Ville Syrjälä
2018-03-12 18:40   ` Pandiyan, Dhinakaran
2018-03-12 18:49     ` Ville Syrjälä
2018-03-12 19:02       ` Pandiyan, Dhinakaran
2018-03-12 18:50     ` Rodrigo Vivi [this message]
2018-03-12 18:58       ` Ville Syrjälä

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=20180312185009.GQ5970@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=dhinakaran.pandiyan@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.