drm/i915: Disable FBC if BIOS reserved memory (stolen) is unavailable

Submitted by Chris Wilson on Sept. 11, 2019, 5:59 p.m.

Details

Message ID 20190911175926.31365-1-chris@chris-wilson.co.uk
State Accepted
Commit e3cb653d5cc42c2073ad174ae1130dc9e39266e9
Headers show
Series "drm/i915: Disable FBC if BIOS reserved memory (stolen) is unavailable" ( rev: 1 ) in Intel GFX

Not browsing as part of any series.

Commit Message

Chris Wilson Sept. 11, 2019, 5:59 p.m.
The FBC requires a couple of contiguous buffers, which we allocate from
stolen memory. If stolen memory is unavailable, we cannot allocate those
buffers and so cannot support FBC. Mark it so.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/display/intel_fbc.c | 3 +++
 1 file changed, 3 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
index dc34b23e2320..3111ecaeabd0 100644
--- a/drivers/gpu/drm/i915/display/intel_fbc.c
+++ b/drivers/gpu/drm/i915/display/intel_fbc.c
@@ -1320,6 +1320,9 @@  void intel_fbc_init(struct drm_i915_private *dev_priv)
 	fbc->enabled = false;
 	fbc->active = false;
 
+	if (!drm_mm_initialized(&dev_priv->mm.stolen))
+		mkwrite_device_info(dev_priv)->display.has_fbc = false;
+
 	if (need_fbc_vtd_wa(dev_priv))
 		mkwrite_device_info(dev_priv)->display.has_fbc = false;
 

Comments

On Wed, Sep 11, 2019 at 06:59:26PM +0100, Chris Wilson wrote:
> The FBC requires a couple of contiguous buffers, which we allocate from
> stolen memory. If stolen memory is unavailable, we cannot allocate those
> buffers and so cannot support FBC. Mark it so.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/display/intel_fbc.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
> index dc34b23e2320..3111ecaeabd0 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbc.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbc.c
> @@ -1320,6 +1320,9 @@ void intel_fbc_init(struct drm_i915_private *dev_priv)
>  	fbc->enabled = false;
>  	fbc->active = false;
>  
> +	if (!drm_mm_initialized(&dev_priv->mm.stolen))
> +		mkwrite_device_info(dev_priv)->display.has_fbc = false;
> +

Not a huge fan of this approach since it means we won't even make sure
FBC is truly disabled. But we already do this for other reasons so I
guess it's fine.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

>  	if (need_fbc_vtd_wa(dev_priv))
>  		mkwrite_device_info(dev_priv)->display.has_fbc = false;
>  
> -- 
> 2.23.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoting Ville Syrjälä (2019-09-12 11:30:14)
> On Wed, Sep 11, 2019 at 06:59:26PM +0100, Chris Wilson wrote:
> > The FBC requires a couple of contiguous buffers, which we allocate from
> > stolen memory. If stolen memory is unavailable, we cannot allocate those
> > buffers and so cannot support FBC. Mark it so.
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > ---
> >  drivers/gpu/drm/i915/display/intel_fbc.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
> > index dc34b23e2320..3111ecaeabd0 100644
> > --- a/drivers/gpu/drm/i915/display/intel_fbc.c
> > +++ b/drivers/gpu/drm/i915/display/intel_fbc.c
> > @@ -1320,6 +1320,9 @@ void intel_fbc_init(struct drm_i915_private *dev_priv)
> >       fbc->enabled = false;
> >       fbc->active = false;
> >  
> > +     if (!drm_mm_initialized(&dev_priv->mm.stolen))
> > +             mkwrite_device_info(dev_priv)->display.has_fbc = false;
> > +
> 
> Not a huge fan of this approach since it means we won't even make sure
> FBC is truly disabled. But we already do this for other reasons so I
> guess it's fine.

Fwiw, I'm experimenting with enabling stolen + iommu and so far it
hasn't died. So hopefully, this is just a temporary means to silence the
huge block of red in CI.
-Chris