[Mesa-dev] [PATCH 3/3] panfrost: Cleanup cruft related to clears
Alyssa Rosenzweig
alyssa at rosenzweig.io
Wed Feb 27 00:56:43 UTC 2019
Signed-off-by: Alyssa Rosenzweig <alyssa at rosenzweig.io>
---
src/gallium/drivers/panfrost/pan_context.c | 25 +++-------------------
src/gallium/drivers/panfrost/pan_context.h | 10 ---------
2 files changed, 3 insertions(+), 32 deletions(-)
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index b3bee2aa36d..92ecf9f2803 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -1586,8 +1586,6 @@ panfrost_submit_frame(struct panfrost_context *ctx, bool flush_immediate)
#endif
}
-bool dont_scanout = false;
-
void
panfrost_flush(
struct pipe_context *pipe,
@@ -1595,23 +1593,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;
@@ -2410,10 +2395,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 *
diff --git a/src/gallium/drivers/panfrost/pan_context.h b/src/gallium/drivers/panfrost/pan_context.h
index 06c8e69bbe9..b1a0a09146d 100644
--- a/src/gallium/drivers/panfrost/pan_context.h
+++ b/src/gallium/drivers/panfrost/pan_context.h
@@ -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];
--
2.20.1
More information about the mesa-dev
mailing list