UPSTREAM: iris: Check data alignment for copy_mem_mem

Check both source and destination offsets are aligned to 4. This
patch fixes dEQP-GLES{2|3}.functional.buffer.write.random.* tests
failures on guest side while trying to copy small (<16b) buffers
via glBufferSubData() with offset which isn't aligned to 4.
(cherry picked from commit a04d0a304ab9
 https://gitlab.freedesktop.org/mesa/mesa.git main)

BUG=b:177028255, b:185733295
TEST=CtsDeqp on volteer

Fixes: 9b1b9714 ("iris: Use MI_COPY_MEM_MEM for tiny resource_copy_region calls.")
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Lionel Landwerlin lionel.g.landwerlin@intel.com
Reviewed-by: Marcin Ĺšlusarz marcin.slusarz@intel.com
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10910>
Change-Id: I8ea1325c57c8e7418ec981d0e8ea3b79242574da
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/mesa/+/2910979
Reviewed-by: Ilja H. Friedel <ihf@chromium.org>
Commit-Queue: Ilja H. Friedel <ihf@chromium.org>
Tested-by: Ilja H. Friedel <ihf@chromium.org>
diff --git a/src/gallium/drivers/iris/iris_blit.c b/src/gallium/drivers/iris/iris_blit.c
index 9caac81..02bc58d 100644
--- a/src/gallium/drivers/iris/iris_blit.c
+++ b/src/gallium/drivers/iris/iris_blit.c
@@ -745,7 +745,8 @@
 
    /* Use MI_COPY_MEM_MEM for tiny (<= 16 byte, % 4) buffer copies. */
    if (p_src->target == PIPE_BUFFER && p_dst->target == PIPE_BUFFER &&
-       (src_box->width % 4 == 0) && src_box->width <= 16) {
+       dstx % 4 == 0 && src_box->x % 4 == 0 &&
+       src_box->width % 4 == 0 && src_box->width <= 16) {
       struct iris_bo *dst_bo = iris_resource_bo(p_dst);
       batch = get_preferred_batch(ice, dst_bo);
       iris_batch_maybe_flush(batch, 24 + 5 * (src_box->width / 4));