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 b1db7aa..a9cdf48 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 aeea3c8..8d467ad 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,