[Intel-gfx] [PATCH] Align tiled pixmap height so we don't address beyond the end of our buffers.

Eric Anholt eric at anholt.net
Thu Aug 13 04:01:16 CEST 2009


On Wed, 2009-08-12 at 23:13 +0100, Chris Wilson wrote:
> On Wed, 2009-08-12 at 14:55 -0700, Ian Romanick wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> > 
> > Eric Anholt wrote:
> > 
> > > diff --git a/src/i830_uxa.c b/src/i830_uxa.c
> > > index 3a476a7..1087128 100644
> > > --- a/src/i830_uxa.c
> > > +++ b/src/i830_uxa.c
> > > @@ -615,6 +615,13 @@ i830_uxa_create_pixmap (ScreenPtr screen, int w, int h, int depth, unsigned usag
> > >  	if (tiling == I915_TILING_NONE) {
> > >  	    size = stride * h;
> > >  	} else {
> > > +	    int aligned_h = h;
> > > +	    if (tiling == I915_TILING_X)
> > > +		aligned_h = ALIGN(h, 8);
> > > +	    else
> > > +		aligned_h = ALIGN(h, 16);
> > > +	    assert(aligned_h >= h);
> > > +
> > 
> > Looking at the other patch, should the else case be 'else if (tiling ==
> > I915_TILING_Y)'?
> 
> Depends. Is there a secret undocumented tiling mode? ;-)
> 
> In seriousness though, according to the documentation [Vol 1a, p135]
> even the NONE case should be ALIGN(h, 2).

Good point.  That's actually the part of the docs I was looking at that
sparked me thinking to produce that bugfix!

-- 
Eric Anholt
eric at anholt.net                         eric.anholt at intel.com


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20090812/0c6a951b/attachment.pgp>


More information about the Intel-gfx mailing list