From 1aee273e3b8acf59151c236ad367642662f6c9f9 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 31 Jan 2020 13:42:19 +0100 Subject: 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: (cherry picked from commit b550b7ef3b8d12f533b67b1a03159a127a3ff34a) --- .pick_status.json | 2 +- src/gallium/drivers/panfrost/pan_job.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 00a1c305618..f19eb505ca5 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -4,7 +4,7 @@ "description": "panfrost: Fix the damage box clamping logic", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "65ae86b85422ae0d41624dd56f935d85b0164a13" }, diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c index 86fc4be606b..1b143478f85 100644 --- a/src/gallium/drivers/panfrost/pan_job.c +++ b/src/gallium/drivers/panfrost/pan_job.c @@ -750,9 +750,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: -- cgit v1.2.1