On Wed, 2009-07-08 at 18:27 +0200, Michel Dänzer wrote:
> On Wed, 2009-07-08 at 09:18 -0700, Eric Anholt wrote:
> > 
> > New commits:
> > commit 40e7c9505265823786cf730214db84812a5e494e
> > Author: Eric Anholt <[email protected]>
> > Date:   Mon Jul 6 11:54:50 2009 -0700
> > 
> >     Refuse to allocate giant BOs on 32-bit systems.
> >     
> >     The overcommit of address space combined with these buffers hitting SW
> >     fallbacks all the time means that we're probably better off telling the
> >     application "no" instead of likely silently failing later.
> >     
> >     Bug #22601.
> > 
> > diff --git a/src/i830_uxa.c b/src/i830_uxa.c
> > index eb35014..ef7ac84 100644
> > --- a/src/i830_uxa.c
> > +++ b/src/i830_uxa.c
> > @@ -627,6 +627,22 @@ i830_uxa_create_pixmap (ScreenPtr screen, int w, int 
> > h, int depth, unsigned usag
> >          * with drm_intel_bufmgr_check_aperture().
> >          */
> >         size = i830_get_fence_size(i830, stride * h);
> > +       assert(size >= stride * h);
> > +   }
> > +
> > +   /* Fail very large allocations on 32-bit systems.  Large BOs will
> > +    * tend to hit SW fallbacks frequently, and also will tend to fail
> > +    * to successfully map when doing SW fallbacks because we overcommit
> > +    * address space for BO access.
> > +    *
> > +    * Note that size should fit in 32 bits.  We throw out >32767x32767x4,
> > +    * and pitch alignment could get us up to 32768x32767x4.
> > +    */
> > +   if (sizeof(unsigned int) == 4 &&
> > [...]
> 
> FWIW, this test is true on 64-bit systems as well.

Hah, wrote the wrong code for what I was thinking.  Thanks.

-- 
Eric Anholt
[email protected]                         [email protected]


Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
xorg-devel mailing list
[email protected]
http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to