crocus/blt: add pitch/offset checks to fix blt corruption

I lost these in my conversion from i965 but they are necessary.

This should fix corruption in qt fonts at seen in the minecraft
launcher.

Fixes: f3630548f1 ("crocus: initial gallium driver for Intel gfx 4-7")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12329>
This commit is contained in:
Dave Airlie
2021-08-11 13:32:41 -04:00
committed by Marge Bot
parent cb2e712b9e
commit 58e95f99bd

View File

@@ -188,6 +188,13 @@ static bool emit_copy_blt(struct crocus_batch *batch,
}
}
/* Blit pitch must be dword-aligned. Otherwise, the hardware appears to drop
* the low bits. Offsets must be naturally aligned.
*/
if (src_pitch % 4 != 0 || src_offset % cpp != 0 ||
dst_pitch % 4 != 0 || dst_offset % cpp != 0)
return false;
/* For tiled source and destination, pitch value should be specified
* as a number of Dwords.
*/