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: 65ae86b854 ("panfrost: Add support for KHR_partial_update()")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3676>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3676>
This commit is contained in:
Boris Brezillon
2020-01-31 13:42:19 +01:00
committed by Marge Bot
parent 2b089e26bf
commit b550b7ef3b
+2
View File
@@ -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: