<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Jan 22, 2017 at 1:50 AM, Kenneth Graunke <span dir="ltr"><<a href="mailto:kenneth@whitecape.org" target="_blank">kenneth@whitecape.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">When trying to blit larger tiled surfaces, the pitch can be larger than<br>
32768 bytes, which means it won't fit in a GLshort.  Passing it in will<br>
truncate the stride to 0, which has...surprising results.<br>
<br>
For Y-tiled surfaces, pitches can be up to 128KB, as we divide by 4 and<br>
program the pitch as a number of tiles.</blockquote><div><br></div><div>I thought it was dwords, not tiles?<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">  So, this is actually legal and<br>
works out if we don't botch things here.<br>
<br>
Fixes GL45-CTS.gtf30.GL3Tests.depth_<wbr>texture.depth_texture_<wbr>copyteximage<br>
at widths greater than 8192.<br>
<br>
Signed-off-by: Kenneth Graunke <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>><br>
---<br>
 src/mesa/drivers/dri/i965/<wbr>intel_blit.c | 4 ++--<br>
 src/mesa/drivers/dri/i965/<wbr>intel_blit.h | 4 ++--<br>
 2 files changed, 4 insertions(+), 4 deletions(-)<br>
<br>
XXX: This patch needs proper testing.  The test lab is having issues<br>
     this weekend, so I'll plan to test it more thoroughly on Monday.<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_blit.c b/src/mesa/drivers/dri/i965/<wbr>intel_blit.c<br>
index 21a16e18c38..6ab06b10fd9 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>intel_blit.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>intel_blit.c<br>
@@ -577,12 +577,12 @@ xy_blit_cmd(uint32_t src_tiling, uint32_t src_tr_mode,<br>
 bool<br>
 intelEmitCopyBlit(struct brw_context *brw,<br>
                  GLuint cpp,<br>
-                 GLshort src_pitch,<br>
+                 uint32_t src_pitch,<br></blockquote><div> </div><div>These should be int32_t because the pitch can be negative.  We should also update the comment at the top of intel_miptree_blit to be more correct.<br></div><div><br></div><div>While we're dealing with these issues, there's a check in can_fast_copy_blit that's supposed to effectively be pitch >= 0 but I'm pretty sure it's wrong in the face of tiled surfaces.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                  drm_intel_bo *src_buffer,<br>
                  GLuint src_offset,<br>
                  uint32_t src_tiling,<br>
                  uint32_t src_tr_mode,<br>
-                 GLshort dst_pitch,<br>
+                 uint32_t dst_pitch,<br>
                  drm_intel_bo *dst_buffer,<br>
                  GLuint dst_offset,<br>
                  uint32_t dst_tiling,<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_blit.h b/src/mesa/drivers/dri/i965/<wbr>intel_blit.h<br>
index 6925795656a..ae78dfe56dc 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>intel_blit.h<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>intel_blit.h<br>
@@ -31,12 +31,12 @@<br>
 bool<br>
 intelEmitCopyBlit(struct brw_context *brw,<br>
                   GLuint cpp,<br>
-                  GLshort src_pitch,<br>
+                  uint32_t src_pitch,<br>
                   drm_intel_bo *src_buffer,<br>
                   GLuint src_offset,<br>
                   uint32_t src_tiling,<br>
                   uint32_t src_tr_mode,<br>
-                  GLshort dst_pitch,<br>
+                  uint32_t dst_pitch,<br>
                   drm_intel_bo *dst_buffer,<br>
                   GLuint dst_offset,<br>
                   uint32_t dst_tiling,<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.11.0<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>