panfrost: Draw the wallpaper when only depth/stencil bufs are cleared
authorBoris Brezillon <boris.brezillon@collabora.com>
Fri, 20 Sep 2019 06:55:54 +0000 (08:55 +0200)
committerBoris Brezillon <boris.brezillon@collabora.com>
Tue, 8 Oct 2019 08:07:54 +0000 (10:07 +0200)
When only the depth/stencil bufs are cleared, we should make sure the
color content is reloaded into the tile buffers if we want to preserve
their content.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
.gitlab-ci/deqp-panfrost-t760-fails.txt
.gitlab-ci/deqp-panfrost-t860-fails.txt
src/gallium/drivers/panfrost/pan_context.c
src/gallium/drivers/panfrost/pan_job.c

index 8ce1e4246807653b6f91b5cc6bf498396193438c..c2a2ef73e9dafd554b70cad9d8b5009c04b4d655 100644 (file)
@@ -935,7 +935,6 @@ dEQP-GLES2.functional.fragment_ops.random.92 Fail
 dEQP-GLES2.functional.fragment_ops.random.96 Fail
 dEQP-GLES2.functional.fragment_ops.random.99 Fail
 dEQP-GLES2.functional.fragment_ops.random.9 Fail
-dEQP-GLES2.functional.polygon_offset.default_factor_1_slope Fail
 dEQP-GLES2.functional.polygon_offset.default_render_with_units Fail
 dEQP-GLES2.functional.polygon_offset.fixed16_factor_1_slope Fail
 dEQP-GLES2.functional.polygon_offset.fixed16_render_with_units Fail
index fbafe8eedc9891733c2875d14b268024c2f4d220..91c1f14ce1a2a391a3ae5d9644f37e85d78f302d 100644 (file)
@@ -714,7 +714,6 @@ dEQP-GLES2.functional.fragment_ops.random.75 Fail
 dEQP-GLES2.functional.fragment_ops.random.81 Fail
 dEQP-GLES2.functional.fragment_ops.random.87 Fail
 dEQP-GLES2.functional.fragment_ops.random.96 Fail
-dEQP-GLES2.functional.polygon_offset.default_factor_1_slope Fail
 dEQP-GLES2.functional.polygon_offset.default_render_with_units Fail
 dEQP-GLES2.functional.polygon_offset.fixed16_factor_1_slope Fail
 dEQP-GLES2.functional.polygon_offset.fixed16_render_with_units Fail
index b8edf302803b5e21d23978f820b5c624b9e3e9a0..bb605280c363acdbc61a0189f81c0439724265cf 100644 (file)
@@ -1334,7 +1334,7 @@ panfrost_queue_draw(struct panfrost_context *ctx)
 
         if (rasterizer_discard)
                 panfrost_scoreboard_queue_vertex_job(batch, vertex, FALSE);
-        else if (ctx->wallpaper_batch)
+        else if (ctx->wallpaper_batch && batch->first_tiler.gpu)
                 panfrost_scoreboard_queue_fused_job_prepend(batch, vertex, tiler);
         else
                 panfrost_scoreboard_queue_fused_job(batch, vertex, tiler);
index ae482a9a7a602f1c6319dc7a387073bfe271d6f1..8ba75cde6c4194d44e74a5480a1a3386b304a526 100644 (file)
@@ -686,10 +686,23 @@ panfrost_batch_get_tiler_dummy(struct panfrost_batch *batch)
 static void
 panfrost_batch_draw_wallpaper(struct panfrost_batch *batch)
 {
+        /* Color 0 is cleared, no need to draw the wallpaper.
+         * TODO: MRT wallpapers.
+         */
+        if (batch->clear & PIPE_CLEAR_COLOR0)
+                return;
+
         /* Nothing to reload? TODO: MRT wallpapers */
         if (batch->key.cbufs[0] == NULL)
                 return;
 
+        /* No draw calls, and no clear on the depth/stencil bufs.
+         * Drawing the wallpaper would be useless.
+         */
+        if (!batch->last_tiler.gpu &&
+            !(batch->clear & PIPE_CLEAR_DEPTHSTENCIL))
+                return;
+
         /* Check if the buffer has any content on it worth preserving */
 
         struct pipe_surface *surf = batch->key.cbufs[0];
@@ -911,8 +924,7 @@ panfrost_batch_submit(struct panfrost_batch *batch)
                 goto out;
         }
 
-        if (!batch->clear && batch->last_tiler.gpu)
-                panfrost_batch_draw_wallpaper(batch);
+        panfrost_batch_draw_wallpaper(batch);
 
         panfrost_scoreboard_link_batch(batch);