[Mesa-dev] [PATCH 16/17] intel: Add safety asserts for the blit engine's pitch alignment requirements.

Eric Anholt eric at anholt.net
Tue Nov 1 16:17:41 PDT 2011


---
 src/mesa/drivers/dri/intel/intel_blit.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c
index def226c..8d7693d 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.
     */
-- 
1.7.7



More information about the mesa-dev mailing list