intel: Add safety asserts for the blit engine's pitch alignment requirements.
authorEric Anholt <eric@anholt.net>
Mon, 31 Oct 2011 23:59:05 +0000 (16:59 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 4 Nov 2011 06:29:53 +0000 (23:29 -0700)
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/drivers/dri/intel/intel_blit.c

index def226c16b790677245cd149e0f79657ac4a0190..8d7693d7b88ea25f33500c0d2a286873a4f5add7 100644 (file)
@@ -146,6 +146,12 @@ intelEmitCopyBlit(struct intel_context *intel,
    src_pitch *= cpp;
    dst_pitch *= cpp;
 
+   /* Blit pitch must be dword-aligned.  Otherwise, the hardware appears to drop
+    * the low bits.
+    */
+   assert(src_pitch % 4 == 0);
+   assert(dst_pitch % 4 == 0);
+
    /* For big formats (such as floating point), do the copy using 32bpp and
     * multiply the coordinates.
     */