From: Alyssa Rosenzweig Date: Tue, 13 Aug 2019 14:19:27 +0000 (-0700) Subject: panfrost: Workaround bug in partial update implementation X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0c56330361958a9fb600c6536d424cb8ddc53e6b;p=mesa.git panfrost: Workaround bug in partial update implementation We can't intersect with empty regions. Fixes: 65ae86b8542 ("panfrost: Add support for KHR_partial_update()") Signed-off-by: Alyssa Rosenzweig --- diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index 8177f8917f3..da0afcd8ec7 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -1389,10 +1389,15 @@ panfrost_draw_wallpaper(struct pipe_context *pipe) * KHR_partial_update() spec states that trying to render outside of * the damage region is "undefined behavior", so we should be safe. */ - panfrost_job_intersection_scissor(batch, rsrc->damage.extent.minx, - rsrc->damage.extent.miny, - rsrc->damage.extent.maxx, - rsrc->damage.extent.maxy); + unsigned damage_width = (rsrc->damage.extent.maxx - rsrc->damage.extent.minx); + unsigned damage_height = (rsrc->damage.extent.maxy - rsrc->damage.extent.miny); + + if (damage_width && damage_height) { + panfrost_job_intersection_scissor(batch, rsrc->damage.extent.minx, + rsrc->damage.extent.miny, + rsrc->damage.extent.maxx, + rsrc->damage.extent.maxy); + } /* FIXME: Looks like aligning on a tile is not enough, but * aligning on twice the tile size seems to works. We don't