[Intel-gfx] [PATCH 1/2] drm/i915: Try to allocate more memory for FBC on Ironlake or GM45

Zhenyu Wang zhenyuw at linux.intel.com
Thu Mar 25 03:12:35 CET 2010


On 2010.03.24 13:31:57 -0700, Jesse Barnes wrote:
> On Wed, 24 Mar 2010 12:57:41 -0700
> Eric Anholt <eric at anholt.net> wrote:
> 
> > On Tue, 23 Mar 2010 11:12:32 +0800, Zhenyu Wang <zhenyuw at linux.intel.com> wrote:
> > > From: Zhao Yakui <yakui.zhao at intel.com>
> > > 
> > > The framebuffer compression can support up to 2K lines and 4K pixels, which
> > > means that it can support up to 32M memory space. But now it is only limited
> > > to 8M.
> > > 
> > > Try to allocate more memory for FBC from the stolen memory on Ironlake or
> > > GM45.
> > > 
> > > Signed-off-by: Zhao Yakui <yakui.zhao at intel.com>
> > > Signed-off-by: Zhenyu Wang <zhenyuw at linux.intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/i915_dma.c      |   16 +++++++++++++---
> > >  drivers/gpu/drm/i915/intel_display.c |   10 ++++++++--
> > >  2 files changed, 21 insertions(+), 5 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> > > index 902d286..61fb967 100644
> > > --- a/drivers/gpu/drm/i915/i915_dma.c
> > > +++ b/drivers/gpu/drm/i915/i915_dma.c
> > > @@ -1451,9 +1451,19 @@ static int i915_load_modeset_init(struct drm_device *dev,
> > >  		int cfb_size;
> > >  
> > >  		/* Try to get an 8M buffer... */
> > > -		if (prealloc_size > (9*1024*1024))
> > > -			cfb_size = 8*1024*1024;
> > > -		else /* fall back to 7/8 of the stolen space */
> > > +		if (prealloc_size > (9*1024*1024)) {
> > > +			if (IS_GM45(dev) || IS_IRONLAKE_M(dev)) {
> > > +				if (prealloc_size >= (64 * 1024 * 1024))
> > > +					cfb_size = 32 * 1024 * 1024;
> > > +				else if (prealloc_size >= (32 * 1024 * 1024))
> > > +					cfb_size = 24 * 1024 * 1024;
> > > +				else if (prealloc_size >= (16 * 1024 * 1024))
> > > +					cfb_size = 12 * 1024 * 1024;
> > > +				else
> > > +					cfb_size = 8 * 1024 * 1024;
> > > +			} else
> > > +				cfb_size = 8*1024*1024;
> > > +		} else /* fall back to 7/8 of the stolen space */
> > >  			cfb_size = prealloc_size * 7 / 8;
> > >  		i915_setup_compression(dev, cfb_size);
> > 
> > The previous code was "use 7/8 of stolen space, unless we've got a ton
> > in which case limit it to 8MB."  Now your code has a ton of cases to use
> > 4/8MB increments.  Why 4/8MB increments?  From the commit message, I
> > would have expected:
> > 
> > cfb_size = prealloc_size * 7 / 8;
> > if (IS_GM45(dev) || IS_IRONLAKE_M(dev)) {
> >    if (cfb_size > (32 * 1024 * 1024))
> >       cfb_size = 32 * 1024 * 1024;
> > } else {
> >    if (cfb_size > (8 * 1024 * 1024))
> >       cfb_size = 8 * 1024 * 1024;
> > }
> 
> Yeah, that logic looks better.  We could even make it a module param to
> allow override (e.g. if a user only needed an 8M buffer and wanted to
> let the OS have the rest).
> 

yeah, this looks much better, I'll refresh the patch. Thanks.

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20100325/e4b47a9f/attachment.sig>


More information about the Intel-gfx mailing list