From: Eric Anholt Date: Mon, 31 Oct 2011 23:59:05 +0000 (-0700) Subject: intel: Add safety asserts for the blit engine's pitch alignment requirements. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a1488eec38d5a76f4e04245a6ce8302444800805;p=mesa.git intel: Add safety asserts for the blit engine's pitch alignment requirements. Reviewed-by: Brian Paul --- diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c index def226c16b7..8d7693d7b88 100644 --- a/src/mesa/drivers/dri/intel/intel_blit.c +++ b/src/mesa/drivers/dri/intel/intel_blit.c @@ -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. */