panfrost: Workaround bug in partial update implementation
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 13 Aug 2019 14:19:27 +0000 (07:19 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 13 Aug 2019 18:13:48 +0000 (11:13 -0700)
We can't intersect with empty regions.

Fixes: 65ae86b8542 ("panfrost: Add support for KHR_partial_update()")
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/gallium/drivers/panfrost/pan_context.c

index 8177f8917f3f890967adb68b85d080c3273debab..da0afcd8ec732754197385ea325277ea4f9b5e34 100644 (file)
@@ -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