i965/blit: Remember to include miptree buffer offset in relocs
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 31 Jul 2017 09:56:15 +0000 (10:56 +0100)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 3 Aug 2017 01:06:35 +0000 (18:06 -0700)
Remember to add the offset to the start of the buffer in the relocation
or else we write 0xff into random bytes elsewhere.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
src/mesa/drivers/dri/i965/intel_blit.c
src/mesa/drivers/dri/i965/intel_pixel_bitmap.c

index b1db7aa2293b971f81d0347f2918d80f8bbd1a81..a9cdf489f15c8ca3f010e56253a56c1027337c6a 100644 (file)
@@ -830,11 +830,11 @@ intel_miptree_set_alpha_to_one(struct brw_context *brw,
          if (brw->gen >= 8) {
             OUT_RELOC64(mt->bo,
                         I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
-                        offset);
+                        mt->offset + offset);
          } else {
             OUT_RELOC(mt->bo,
                       I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER,
-                      offset);
+                      mt->offset + offset);
          }
          OUT_BATCH(0xffffffff); /* white, but only alpha gets written */
          ADVANCE_BATCH_TILED(dst_y_tiled, false);
index aeea3c8bd6ae2f2d8b1b0aafcfc1670d0fec1370..8d467adc56e98409822f2f4281c4370405f99642 100644 (file)
@@ -294,7 +294,7 @@ do_blit_bitmap( struct gl_context *ctx,
                                                color,
                                                irb->mt->surf.row_pitch,
                                                irb->mt->bo,
-                                               0,
+                                               irb->mt->offset,
                                                irb->mt->surf.tiling,
                                                dstx + px,
                                                dsty + py,