From 0c56330361958a9fb600c6536d424cb8ddc53e6b Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 13 Aug 2019 07:19:27 -0700 Subject: 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 --- src/gallium/drivers/panfrost/pan_context.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/gallium') 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 -- cgit v1.2.3