[Intel-gfx] [PATCH] drm/i915/fbc: Limit cfb to the first 256MiB of stolen on g4x+

Ville Syrjälä ville.syrjala at linux.intel.com
Tue Jul 14 19:50:21 UTC 2020


On Tue, Jul 14, 2020 at 08:13:03PM +0100, Chris Wilson wrote:
> Quoting Ville Syrjala (2020-07-14 19:51:28)
> > From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > 
> > Since g4x the CFB base only takes a 28bit offset into stolen.
> > Not sure if the CFB is allowed to start below that limit but
> > then extend beyond it. Let's assume not and just restrict the
> > allocation to the first 256MiB (in the unlikely case
> > we have more stolen than that).
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_fbc.c | 10 ++++++++++
> >  1 file changed, 10 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
> > index 85723fba6002..448e966bad11 100644
> > --- a/drivers/gpu/drm/i915/display/intel_fbc.c
> > +++ b/drivers/gpu/drm/i915/display/intel_fbc.c
> > @@ -424,6 +424,14 @@ static void intel_fbc_deactivate(struct drm_i915_private *dev_priv,
> >         fbc->no_fbc_reason = reason;
> >  }
> >  
> > +static u64 intel_fbc_cfb_base_max(struct drm_i915_private *i915)
> > +{
> > +       if (INTEL_GEN(i915) >= 5 || IS_G4X(i915))
> > +               return BIT(28);
> > +       else
> > +               return BIT(32);
> 
> BIT_ULL(32)

Argh. I should stop being lazy and always test build 32bit
locally. Also, 'long' really is the most annoying type ever.

-- 
Ville Syrjälä
Intel


More information about the Intel-gfx mailing list