Commit 93a71442 authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

panfrost: Detect partial update

parent e8bcb696
......@@ -392,7 +392,7 @@ panfrost_clear(
bool clear_stencil = buffers & PIPE_CLEAR_STENCIL;
/* Remember that we've done something */
ctx->dirty |= PAN_DIRTY_DUMMY;
ctx->frame_cleared = true;
/* Alpha clear only meaningful without alpha channel */
bool has_alpha = ctx->pipe_framebuffer.nr_cbufs && util_format_has_alpha(ctx->pipe_framebuffer.cbufs[0]->format);
......@@ -1505,7 +1505,15 @@ panfrost_flush(
struct panfrost_context *ctx = panfrost_context(pipe);
/* If there is nothing drawn, skip the frame */
if (!ctx->draw_count && !(ctx->dirty & PAN_DIRTY_DUMMY)) return;
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 */
printf("Partial update beep beep\n");
}
/* Frame clear handled, reset */
ctx->frame_cleared = false;
/* Whether to stall the pipeline for immediately correct results */
bool flush_immediate = flags & PIPE_FLUSH_END_OF_FRAME;
......@@ -2373,8 +2381,10 @@ panfrost_set_framebuffer_state(struct pipe_context *pctx,
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);
#if 0
/* Don't consider the buffer dirty */
ctx->dirty &= ~PAN_DIRTY_DUMMY;
ctx->dirty &= ~PAN_DIRTY_CLEAR;
#endif
}
static void *
......
......@@ -58,7 +58,7 @@ struct prim_convert_context;
#define MAX_DRAW_CALLS 4096
#define MAX_VARYINGS 4096
#define PAN_DIRTY_DUMMY (1 << 0)
//#define PAN_DIRTY_CLEAR (1 << 0)
#define PAN_DIRTY_RASTERIZER (1 << 2)
#define PAN_DIRTY_FS (1 << 3)
#define PAN_DIRTY_FRAG_CORE (PAN_DIRTY_FS) /* Dirty writes are tied */
......@@ -144,9 +144,12 @@ struct panfrost_context {
mali_ptr vertex_jobs[MAX_DRAW_CALLS];
mali_ptr tiler_jobs[MAX_DRAW_CALLS];
/* Dirty flags are setup like any other driver */
/* 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;
struct mali_attr attributes[PIPE_MAX_ATTRIBS];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment