<div dir="ltr"><div class="gmail_extra">This patch is technically correct (the best kind of correct!) but I'm not sure I like it. width/height and x/y will always come in pairs. This makes the code messier just to get rid of a coverity warning that can easily be verified to never be an issue (by just looking at all 3 callers).</div><div class="gmail_extra"><br></div><div class="gmail_extra">--Jason<br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_quote">On Mon, Oct 9, 2017 at 7:37 AM, Lionel Landwerlin <span dir="ltr"><<a href="mailto:lionel.g.landwerlin@intel.com" target="_blank">lionel.g.landwerlin@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">CID: 1418616, 1418607<br>
Signed-off-by: Lionel Landwerlin <<a href="mailto:lionel.g.landwerlin@intel.com">lionel.g.landwerlin@intel.com</a><wbr>><br>
---<br>
src/intel/blorp/blorp_blit.c | 16 +++++++++++-----<br>
1 file changed, 11 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/src/intel/blorp/blorp_blit.c b/src/intel/blorp/blorp_blit.c<br>
index 11c2116a758..84e46d7d31b 100644<br>
--- a/src/intel/blorp/blorp_blit.c<br>
+++ b/src/intel/blorp/blorp_blit.c<br>
@@ -2343,23 +2343,29 @@ blorp_surf_convert_to_<wbr>uncompressed(const struct isl_device *isl_dev,<br>
*/<br>
blorp_surf_convert_to_single_<wbr>slice(isl_dev, info);<br>
<br>
- if (width || height) {<br>
+ if (width) {<br>
#ifndef NDEBUG<br>
uint32_t right_edge_px = info->tile_x_sa + *x + *width;<br>
- uint32_t bottom_edge_px = info->tile_y_sa + *y + *height;<br>
assert(*width % fmtl->bw == 0 ||<br>
right_edge_px == info->surf.logical_level0_px.<wbr>width);<br>
+#endif<br>
+ *width = DIV_ROUND_UP(*width, fmtl->bw);<br>
+ }<br>
+ if (height) {<br>
+#ifndef NDEBUG<br>
+ uint32_t bottom_edge_px = info->tile_y_sa + *y + *height;<br>
assert(*height % fmtl->bh == 0 ||<br>
bottom_edge_px == info->surf.logical_level0_px.<wbr>height);<br>
#endif<br>
- *width = DIV_ROUND_UP(*width, fmtl->bw);<br>
*height = DIV_ROUND_UP(*height, fmtl->bh);<br>
}<br>
<br>
- if (x || y) {<br>
+ if (x) {<br>
assert(*x % fmtl->bw == 0);<br>
- assert(*y % fmtl->bh == 0);<br>
*x /= fmtl->bw;<br>
+ }<br>
+ if (y) {<br>
+ assert(*y % fmtl->bh == 0);<br>
*y /= fmtl->bh;<br>
}<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
2.14.2<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>