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

Ian Romanick idr at freedesktop.org
Wed Aug 12 23:55:39 CEST 2009


-----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)'?

>  	    stride = i830_get_fence_pitch(i830, stride, tiling);
>  	    /* Round the object up to the size of the fence it will live in
>  	     * if necessary.  We could potentially make the kernel allocate
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkqDOloACgkQX1gOwKyEAw8T7wCeLC4PkjNrqTjGX8kK9E16oria
sGIAn0C8lm9B6Zjo9LMjmGY8oQ7GkJSF
=Qa2G
-----END PGP SIGNATURE-----



More information about the Intel-gfx mailing list