[Mesa-dev] [PATCH 2/3] intel: Fix pitch handling for linear blits.

Chad Versace chad.versace at linux.intel.com
Thu Dec 29 12:01:27 PST 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12/28/2011 11:14 AM, Eric Anholt wrote:
> The new assert in intelEmitCopyBlit() gets angry if we don't align to
> dwords.  Rather than make the assert have a special case for height ==
> 1 on the assumption that the hardware doesn't use it in that case,
> just supply a correct pitch.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43214
> ---
>  src/mesa/drivers/dri/intel/intel_blit.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c
> index b1a839a..1369e63 100644
> --- a/src/mesa/drivers/dri/intel/intel_blit.c
> +++ b/src/mesa/drivers/dri/intel/intel_blit.c
> @@ -491,7 +491,7 @@ intel_emit_linear_blit(struct intel_context *intel,
>      * we want width to match pitch. Max width is (1 << 15 - 1),
>      * rounding that down to the nearest DWORD is 1 << 15 - 4
>      */
> -   pitch = MIN2(size, (1 << 15) - 4);
> +   pitch = ROUND_DOWN_TO(MIN2(size, (1 << 15) - 1), 4);
>     height = size / pitch;
>     ok = intelEmitCopyBlit(intel, 1,
>  			  pitch, src_bo, src_offset, I915_TILING_NONE,
> @@ -506,11 +506,11 @@ intel_emit_linear_blit(struct intel_context *intel,
>     dst_offset += pitch * height;
>     size -= pitch * height;
>     assert (size < (1 << 15));
> -   assert ((size & 3) == 0); /* Pitch must be DWORD aligned */
> +   pitch = ALIGN(size, 4);
>     if (size != 0) {
>        ok = intelEmitCopyBlit(intel, 1,
> -			     size, src_bo, src_offset, I915_TILING_NONE,
> -			     size, dst_bo, dst_offset, I915_TILING_NONE,
> +			     pitch, src_bo, src_offset, I915_TILING_NONE,
> +			     pitch, dst_bo, dst_offset, I915_TILING_NONE,
>  			     0, 0, /* src x/y */
>  			     0, 0, /* dst x/y */
>  			     size, 1, /* w, h */

Reviewed-by: Chad Versace <chad.versace at linux.intel.com>

- ----
Chad Versace
chad.versace at linux.intel.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJO/McVAAoJEAIvNt057x8iwIQP/3r0Zm/XfuMeHYPTOWBEhtLM
y1om2mMVk8z8gVtUKk5H0/ikW9UhQJ/7gmVj2pITXmajxZZ+QdsXWklmvFWbeFPM
TDl/Z8VWeTNav4FBjWhRFvLLjKNQIJ2X1LeG1R592KmLTSiV24Tdcvf0mD3kJziA
XF1kWKGd+6tslzQqFejOvHlB4PACC9nN00UN0I3yONSL4Ud54kBhrHFctONrJhxH
1DFLOaauFQyFueXCpK+UmZStULxFbmshBnSsVKzgxVW4qGsieoUqSfXpUymtb0kH
gIrCBBbitwm1JiFaDXoF8a9CuyjWhm8IFadMJRs01Q+0YbNp1IW0yC1gJNSAVBnp
B63cFZdOZzobXRioT+4HCZ5bfHboRlkxQnS/GV7IdsLNaA9EJi9HRa7DceBZI8Lr
2KkNZrPBcMHR51T9cq6l/PpxrxYv7CrnYBa9RdA0fJzXqV4DVZnzSa2xenJMv6vu
ZL8I2IJyUaNVXXPC94lUyUOEDsBrawMriwXbRkJ27sKew5buesA5d7jDNMFPhCME
bBH42qaqXhlGsw9Gwi+4ADDDOxRcmWRJwEoFEDULD1zgybmEAKStEnvAkETO9mSz
oHhNGAveNgL8YADzTqT6YNC39rfgrWPo1vP0cX/KyzGkqLhk6WlCsLodgC5tO6G1
vN3OjxrfJ02Fs85+/5SU
=r7/C
-----END PGP SIGNATURE-----


More information about the mesa-dev mailing list