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

Chris Wilson chris at chris-wilson.co.uk
Thu Aug 13 00:13:16 CEST 2009


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).
-ickle





More information about the Intel-gfx mailing list