From: Boris Brezillon Date: Fri, 31 Jan 2020 12:42:19 +0000 (+0100) Subject: panfrost: Fix the damage box clamping logic X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b550b7ef3b8d12f533b67b1a03159a127a3ff34a;p=mesa.git panfrost: Fix the damage box clamping logic When the rendering are is not covering the whole FBO, and the biggest damage rect is empty, we can have damage.max{x,y} > damage.min{x,y}, which leads to invalid reload boxes. Fixes: 65ae86b85422 ("panfrost: Add support for KHR_partial_update()") Signed-off-by: Boris Brezillon Reviewed-by: Alyssa Rosenzweig Tested-by: Marge Bot Part-of: --- diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c index 747e9c95556..8f3acd24e1b 100644 --- a/src/gallium/drivers/panfrost/pan_job.c +++ b/src/gallium/drivers/panfrost/pan_job.c @@ -777,9 +777,11 @@ panfrost_batch_draw_wallpaper(struct panfrost_batch *batch) damage.maxx = MIN2(batch->maxx, rsrc->damage.biggest_rect.x + rsrc->damage.biggest_rect.width); + damage.maxx = MAX2(damage.maxx, damage.minx); damage.maxy = MIN2(batch->maxy, rsrc->damage.biggest_rect.y + rsrc->damage.biggest_rect.height); + damage.maxy = MAX2(damage.maxy, damage.miny); /* One damage rectangle means we can end up with at most 4 reload * regions: