<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Aug 8, 2014 at 4:05 AM, Neil Roberts <span dir="ltr"><<a href="mailto:neil@linux.intel.com" target="_blank">neil@linux.intel.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="">Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> writes:<br>
<br>
> +   if (src_mt == dst_mt && src_level == dst_level && src_z == dst_z) {<br>
> +      /* If we are on the same miptree, same level, and same slice, then<br>
> +       * intel_miptree_map won't let us map it twice.  We have to do a<br>
> +       * single map in read-write mode.<br>
> +       */<br>
> +<br>
> +      map_x1 = MIN2(src_x, dst_x);<br>
> +      map_y1 = MIN2(src_y, dst_y);<br>
> +      map_x2 = MAX2(src_x, dst_x) + src_width;<br>
> +      map_y2 = MAX2(src_y, dst_y) + src_height;<br>
> +<br>
> +      intel_miptree_map(brw, src_mt, src_level, src_z,<br>
> +                        map_x1, map_y1, map_x2 - map_x1, map_y2 - map_y1,<br>
> +                        GL_MAP_READ_BIT | GL_MAP_WRITE_BIT,<br>
> +                        (void **)&mapped, &src_stride);<br>
> +<br>
> +      dst_stride = src_stride;<br>
> +<br>
> +      /* Set the offsets here so we don't have to think about it later */<br>
> +      src_mapped = mapped + (src_y - map_y1) * src_stride +<br>
> +                            (src_x - map_x1) * cpp;<br>
> +      dst_mapped = mapped + (dst_y - map_y1) * dst_stride +<br>
> +                            (dst_x - map_x1) * cpp;<br>
<br>
</div>This needs to take into account the block size of the format or it will<br>
offset to the wrong position. I guess that is quite important as this<br>
code path will only be used for compressed formats.<br></blockquote><div><br></div><div>Yeah, you're right.  I'll get that patched up and update the tests to exercise it.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
The commit message still mentions the maximum stride which is no longer<br>
valid.<br>
<br>
Regards,<br>
- Neil<br>
</blockquote></div><br></div></div>