panfrost: Cleanup cruft related to clears
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Wed, 27 Feb 2019 00:30:59 +0000 (00:30 +0000)
committerAlyssa Rosenzweig <alyssa@rosenzweig.io>
Mon, 4 Mar 2019 04:59:12 +0000 (04:59 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
src/gallium/drivers/panfrost/pan_context.c
src/gallium/drivers/panfrost/pan_context.h

index d05863d35a041e7c3d13a96c434816597ac186f0..f3d5366214521ab969980f3ba0c95d8b875c5b55 100644 (file)
@@ -1583,8 +1583,6 @@ panfrost_submit_frame(struct panfrost_context *ctx, bool flush_immediate)
 #endif
 }
 
-bool dont_scanout = false;
-
 void
 panfrost_flush(
         struct pipe_context *pipe,
@@ -1592,23 +1590,10 @@ panfrost_flush(
         unsigned flags)
 {
         struct panfrost_context *ctx = pan_context(pipe);
+        struct panfrost_job *job = panfrost_get_job_for_fbo(ctx);
 
-        /* If there is nothing drawn, skip the frame */
-        if (!ctx->draw_count && !ctx->frame_cleared) return;
-
-        if (!ctx->frame_cleared) {
-                /* While there are draws, there was no clear. This is a partial
-                 * update, which needs to be handled via the "wallpaper"
-                 * method. We also need to fake a clear, just to get the
-                 * FRAGMENT job correct. */
-
-                panfrost_clear(&ctx->base, ctx->last_clear.buffers, ctx->last_clear.color, ctx->last_clear.depth, ctx->last_clear.stencil);
-
-                panfrost_draw_wallpaper(pipe);
-        }
-
-        /* Frame clear handled, reset */
-        ctx->frame_cleared = false;
+        /* Nothing to do! */
+        if (!ctx->draw_count && !job->clear) return;
 
         /* Whether to stall the pipeline for immediately correct results */
         bool flush_immediate = flags & PIPE_FLUSH_END_OF_FRAME;
@@ -2407,10 +2392,6 @@ panfrost_set_framebuffer_state(struct pipe_context *pctx,
                         }
                 }
         }
-
-        /* Force a clear XXX wrong? */
-        if (ctx->last_clear.color)
-                panfrost_clear(&ctx->base, ctx->last_clear.buffers, ctx->last_clear.color, ctx->last_clear.depth, ctx->last_clear.stencil);
 }
 
 static void *
index 06c8e69bbe98efec9cd0c6edb433d72a5f857117..b1a0a09146daf29675bcc42cc96de17e9cdc301c 100644 (file)
@@ -121,13 +121,6 @@ struct panfrost_context {
         struct panfrost_memory misc_1;
         struct panfrost_memory depth_stencil_buffer;
 
-        struct {
-                unsigned buffers;
-                const union pipe_color_union *color;
-                double depth;
-                unsigned stencil;
-        } last_clear;
-
         struct panfrost_query *occlusion_query;
 
         /* Each render job has multiple framebuffer descriptors associated with
@@ -174,9 +167,6 @@ struct panfrost_context {
         /* Per-draw Dirty flags are setup like any other driver */
         int dirty;
 
-        /* Per frame dirty flag - whether there was a clear. If not, we need to do a partial update, maybe */
-        bool frame_cleared;
-
         unsigned vertex_count;
 
         union mali_attr attributes[PIPE_MAX_ATTRIBS];