Mesa (staging/18.1): i965/miptree: Fix can_blit_slice()

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Aug 23 16:35:22 UTC 2018


Module: Mesa
Branch: staging/18.1
Commit: 03f138f08da182bea562456437f432904c0053d3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=03f138f08da182bea562456437f432904c0053d3

Author: Nanley Chery <nanley.g.chery at intel.com>
Date:   Mon Jul 23 10:09:20 2018 -0700

i965/miptree: Fix can_blit_slice()

Check the destination's row pitch against the BLT engine's row pitch
limitation as well.

Fixes: 0288fe8d0417730bdd5b3477130dd1dc32bdbcd3
("i965/miptree: Use the correct BLT pitch")

v2: Fix the Fixes tag (Dylan).
    Check the destination row pitch (Chris).

Reported-by: Dylan Baker <dylan at pnwbakers.com>
Cc: <mesa-stable at lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
(cherry picked from commit b041fc06491f4a017458df4a58d4ac519bb3bc94)

---

 src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index 084fcad348..8d6d1f00a4 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -3577,10 +3577,9 @@ can_blit_slice(struct intel_mipmap_tree *mt,
                const struct intel_miptree_map *map)
 {
    /* See intel_miptree_blit() for details on the 32k pitch limit. */
-   if (intel_miptree_blt_pitch(mt) >= 32768)
-      return false;
-
-   return true;
+   const unsigned src_blt_pitch = intel_miptree_blt_pitch(mt);
+   const unsigned dst_blt_pitch = ALIGN(map->w * mt->cpp, 64);
+   return src_blt_pitch < 32768 && dst_blt_pitch < 32768;
 }
 
 static bool




More information about the mesa-commit mailing list