Mesa (17.0): i965: Round copy size to the nearest block in intel_miptree_copy

Emil Velikov evelikov at kemper.freedesktop.org
Wed May 31 17:22:32 UTC 2017


Module: Mesa
Branch: 17.0
Commit: 8e614856e3ae6af917aa14b84afbd2d378025682
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8e614856e3ae6af917aa14b84afbd2d378025682

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Sat May 13 11:02:22 2017 -0700

i965: Round copy size to the nearest block in intel_miptree_copy

The width and height of the copy don't have to be aligned to the block
size if they specify the right or bottom edges of the image.  (See also
the comment and asserts right above).  We need to round them up when we
do the division in order to get it 100% right.

Reviewed-by: Ben Widawsky <ben at bwidawsk.net>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Cc: "17.0 17.1" <mesa-stable at lists.freedesktop.org>
(cherry picked from commit 0901d0bc4c78313eaaf29dff74c6a7bf5514f75b)

---

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

diff --git a/src/mesa/drivers/dri/i965/intel_blit.c b/src/mesa/drivers/dri/i965/intel_blit.c
index 4d4ab911cb..bb05ffe13e 100644
--- a/src/mesa/drivers/dri/i965/intel_blit.c
+++ b/src/mesa/drivers/dri/i965/intel_blit.c
@@ -430,8 +430,8 @@ intel_miptree_copy(struct brw_context *brw,
 
       src_x /= (int)bw;
       src_y /= (int)bh;
-      src_width /= (int)bw;
-      src_height /= (int)bh;
+      src_width = DIV_ROUND_UP(src_width, (int)bw);
+      src_height = DIV_ROUND_UP(src_height, (int)bh);
    }
    src_x += src_image_x;
    src_y += src_image_y;




More information about the mesa-commit mailing list