<div dir="ltr">Yeah, you're right.  I was being lazy.  How's this:<br><br>   /* According to the Ivy Bridge PRM, Vol1 Part4, section 1.2.1.2 (Graphics<br>    * Data Size Limitations):<br>    *<br>    *    The BLT engine is capable of transferring very large quantities of<br>
    *    graphics data. Any graphics data read from and written to the<br>    *    destination is permitted to represent a number of pixels that<br>    *    occupies up to 65,536 scan lines and up to 32,768 bytes per scan line<br>
    *    at the destination. The maximum number of pixels that may be<br>    *    represented per scan line’s worth of graphics data depends on the<br>    *    color depth.<br>    *<br>    * Furthermore, intelEmitCopyBlit (which is called by<br>
    * intel_miptree_map_blit) uses a signed 16-bit integer to represent buffer<br>    * pitch, so it can only handle buffer pitches < 32k.<br>    *<br>    * As a result of these two limitations, we can only use<br>    * intel_miptree_map_blit() when the region's pitsh is less than 32k.<br>
    */<br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 24 January 2013 11:22, Alex Deucher <span dir="ltr"><<a href="mailto:alexdeucher@gmail.com" target="_blank">alexdeucher@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Thu, Jan 24, 2013 at 2:10 PM, Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>> wrote:<br>

> When possible, glReadPixels calls are performed using the hardware<br>
> blitter.  However, according to the Ivy Bridge PRM, Vol1 Part4,<br>
> section 1.2.1.2 (Graphics Data Size Limitations):<br>
><br>
>     The BLT engine is capable of transferring very large quantities of<br>
>     graphics data. Any graphics data read from and written to the<br>
>     destination is permitted to represent a number of pixels that<br>
>     occupies up to 65,536 scan lines and up to 32,768 bytes per scan<br>
>     line at the destination. The maximum number of pixels that may be<br>
>     represented per scan line’s worth of graphics data depends on the<br>
>     color depth.<br>
><br>
> With an RGBA32F color buffer (which has 16 bytes per pixel) this<br>
> imposes a maximum width of 2048 pixels.<br>
><br>
> To make matters worse, if the pitch of the buffer is 32k or greater,<br>
> intel_miptree_map_blit's call to intelEmitCopyBlit will overflow<br>
> intelEmitCopyBlit's src_pitch and dst_pitch parameters (which are<br>
> 16-bit signed integers).<br>
><br>
> We can conveniently avoid both problems by avoiding the readpixels<br>
> blit path when the miptree's pitch is >= 32k.<br>
><br>
> Fixes gles3conform "half_float" tests when the buffer width is greater<br>
> than 2048.<br>
> ---<br>
>  src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 3 ++-<br>
>  1 file changed, 2 insertions(+), 1 deletion(-)<br>
><br>
> diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c<br>
> index ce03afa..f2571bd 100644<br>
> --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c<br>
> +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c<br>
> @@ -1568,7 +1568,8 @@ intel_miptree_map_singlesample(struct intel_context *intel,<br>
>     } else if (intel->has_llc &&<br>
>               !(mode & GL_MAP_WRITE_BIT) &&<br>
>               !mt->compressed &&<br>
> -             mt->region->tiling == I915_TILING_X) {<br>
> +             mt->region->tiling == I915_TILING_X &&<br>
> +              mt->region->pitch < 32768) {<br>
<br>
</div></div>You may want to put a comment here about why you have this pitch check.<br>
<br>
Alex<br>
<div class="im"><br>
>        intel_miptree_map_blit(intel, mt, map, level, slice);<br>
>     } else {<br>
>        intel_miptree_map_gtt(intel, mt, map, level, slice);<br>
> --<br>
> 1.8.1.1<br>
><br>
</div>> _______________________________________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div><br></div>