All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Matt Roper <matthew.d.roper@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 04/12] drm/i915/fbc: Fix nuke for pre-snb platforms
Date: Mon, 4 May 2020 18:02:23 +0300	[thread overview]
Message-ID: <20200504150223.GC6112@intel.com> (raw)
In-Reply-To: <20200502011818.GM188376@mdroper-desk1.amr.corp.intel.com>

On Fri, May 01, 2020 at 06:18:18PM -0700, Matt Roper wrote:
> On Wed, Apr 29, 2020 at 01:10:26PM +0300, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > The MSG_FBC_REND_STATE register only exists on snb+. For older
> 
> I only find this register in the bspec for HSW+.  Is the spec incomplete
> or am I looking in the wrong place?

The docs are a bit of a mess around this area. IIRC this rcs nuke
workaround was documented for ivb+ (presumably due to ppgtt).
I thinka the bltter counterpart (part of the BCS_ECOSKPD dance)
was documented for SNB as well which implies the register is there
and working. Also the fact that the code works does confirm that.

We're not really following much of the documented stuff for 
FBC since we basically don't use the hardware tracking all.
So the value of the docs is mostly in finding the right bits
to cause nukes and turn off hw tracking as much as possible.

> 
> It's a bit hard to review these changes for older platforms since there
> doesn't really seem to be much FBC/DPFC documentation at all in the
> bspec until we get to BDW and beyond.  The only explicit mention I can
> find of nuke-on-flip for older platforms is a SNB-specific bit in
> FBC_CTL that disables that behavior.  Do you have other documents that
> clarify that this will indeed work farther back?

gen2-gen4 bspec has slightly better docs on FBC compared to more recent
platforms. Sadly I've never been able to find a way to trigger a nuke
explicitly, hence we resort to (ab)using a flip nuke.

> 
> 
> Matt
> 
> > platforms (would also work for snb+) we can simply rewite DSPSURF
> > to trigger a flip nuke.
> > 
> > While generally RMW is considered harmful we'll use it here for
> > simplicity. And since FBC doesn't exist in i830 we don't have to
> > worry about the DSPSURF double buffering hardware fails present
> > on that platform.
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_fbc.c | 34 +++++++++++++++++++++++-
> >  1 file changed, 33 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
> > index 613ab499d42e..983224e07eaf 100644
> > --- a/drivers/gpu/drm/i915/display/intel_fbc.c
> > +++ b/drivers/gpu/drm/i915/display/intel_fbc.c
> > @@ -188,8 +188,30 @@ static bool g4x_fbc_is_active(struct drm_i915_private *dev_priv)
> >  	return intel_de_read(dev_priv, DPFC_CONTROL) & DPFC_CTL_EN;
> >  }
> >  
> > +static void i8xx_fbc_recompress(struct drm_i915_private *dev_priv)
> > +{
> > +	struct intel_fbc_reg_params *params = &dev_priv->fbc.params;
> > +	enum i9xx_plane_id i9xx_plane = params->crtc.i9xx_plane;
> > +
> > +	spin_lock_irq(&dev_priv->uncore.lock);
> > +	intel_de_write_fw(dev_priv, DSPADDR(i9xx_plane),
> > +			  intel_de_read_fw(dev_priv, DSPADDR(i9xx_plane)));
> > +	spin_unlock_irq(&dev_priv->uncore.lock);
> > +}
> > +
> > +static void i965_fbc_recompress(struct drm_i915_private *dev_priv)
> > +{
> > +	struct intel_fbc_reg_params *params = &dev_priv->fbc.params;
> > +	enum i9xx_plane_id i9xx_plane = params->crtc.i9xx_plane;
> > +
> > +	spin_lock_irq(&dev_priv->uncore.lock);
> > +	intel_de_write_fw(dev_priv, DSPSURF(i9xx_plane),
> > +			  intel_de_read_fw(dev_priv, DSPSURF(i9xx_plane)));
> > +	spin_unlock_irq(&dev_priv->uncore.lock);
> > +}
> > +
> >  /* This function forces a CFB recompression through the nuke operation. */
> > -static void intel_fbc_recompress(struct drm_i915_private *dev_priv)
> > +static void snb_fbc_recompress(struct drm_i915_private *dev_priv)
> >  {
> >  	struct intel_fbc *fbc = &dev_priv->fbc;
> >  
> > @@ -199,6 +221,16 @@ static void intel_fbc_recompress(struct drm_i915_private *dev_priv)
> >  	intel_de_posting_read(dev_priv, MSG_FBC_REND_STATE);
> >  }
> >  
> > +static void intel_fbc_recompress(struct drm_i915_private *dev_priv)
> > +{
> > +	if (INTEL_GEN(dev_priv) >= 6)
> > +		snb_fbc_recompress(dev_priv);
> > +	else if (INTEL_GEN(dev_priv) >= 4)
> > +		i965_fbc_recompress(dev_priv);
> > +	else
> > +		i8xx_fbc_recompress(dev_priv);
> > +}
> > +
> >  static void ilk_fbc_activate(struct drm_i915_private *dev_priv)
> >  {
> >  	struct intel_fbc_reg_params *params = &dev_priv->fbc.params;
> > -- 
> > 2.24.1
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> -- 
> Matt Roper
> Graphics Software Engineer
> VTT-OSGC Platform Enablement
> Intel Corporation
> (916) 356-2795

-- 
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-05-04 15:03 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-29 10:10 [Intel-gfx] [PATCH 00/12] drm/i915: FBC fixes Ville Syrjala
2020-04-29 10:10 ` [Intel-gfx] [PATCH 01/12] drm/i915/fbc: Require linear fb stride to be multiple of 512 bytes on gen9/glk Ville Syrjala
2020-05-01  1:03   ` Matt Roper
2020-04-29 10:10 ` [Intel-gfx] [PATCH 02/12] drm/i915/fbc: Use the correct plane stride Ville Syrjala
2020-04-29 15:29   ` [Intel-gfx] [PATCH v2 " Ville Syrjala
2020-05-02  0:16     ` Matt Roper
2020-05-04 14:33       ` Ville Syrjälä
2020-04-29 10:10 ` [Intel-gfx] [PATCH 03/12] drm/i915/fbc: Fix fence_y_offset handling Ville Syrjala
2020-05-02  0:33   ` Matt Roper
2020-04-29 10:10 ` [Intel-gfx] [PATCH 04/12] drm/i915/fbc: Fix nuke for pre-snb platforms Ville Syrjala
2020-05-02  1:18   ` Matt Roper
2020-05-04 15:02     ` Ville Syrjälä [this message]
2020-04-29 10:10 ` [Intel-gfx] [PATCH 05/12] drm/i915/fbc: Enable fbc on i865 Ville Syrjala
2020-04-29 10:10 ` [Intel-gfx] [PATCH 06/12] drm/i915/fbc: Don't clear busy_bits for origin==GTT Ville Syrjala
2020-06-25  1:04   ` Souza, Jose
2020-04-29 10:10 ` [Intel-gfx] [PATCH 07/12] drm/i915/fbc: Allow FBC to recompress after a 3D workload on i85x/i865 Ville Syrjala
2020-04-29 10:10 ` [Intel-gfx] [PATCH 08/12] drm/i915/fbc: Parametrize FBC_CONTROL Ville Syrjala
2020-06-25  0:41   ` Souza, Jose
2020-04-29 10:10 ` [Intel-gfx] [PATCH 09/12] drm/i915/fbc: Store the fbc1 compression interval in the params Ville Syrjala
2020-06-25  0:47   ` Souza, Jose
2020-04-29 10:10 ` [Intel-gfx] [PATCH 10/12] drm/i915/fbc: Reduce fbc1 compression interval to 1 second Ville Syrjala
2020-06-25  0:49   ` Souza, Jose
2020-04-29 10:10 ` [Intel-gfx] [PATCH 11/12] drm/i915: Fix g4x fbc watermark enable Ville Syrjala
2020-06-25  1:04   ` Souza, Jose
2020-04-29 10:10 ` [Intel-gfx] [PATCH 12/12] drm/i915: Suppress spurious underruns on gen2 Ville Syrjala
2020-06-25  0:59   ` Souza, Jose
2020-04-29 11:04 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: FBC fixes Patchwork
2020-04-29 13:44 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2020-04-29 17:27 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: FBC fixes (rev2) Patchwork
2020-04-29 23:22 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

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=20200504150223.GC6112@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=matthew.d.roper@intel.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.