Mesa (master): freedreno: add helper to mark all state dirty

Rob Clark robclark at kemper.freedesktop.org
Tue Apr 18 20:51:10 UTC 2017


Module: Mesa
Branch: master
Commit: 71f9e03d211a17e7c53de595966d4c0ed41a97f1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=71f9e03d211a17e7c53de595966d4c0ed41a97f1

Author: Rob Clark <robdclark at gmail.com>
Date:   Sun Apr 16 12:21:49 2017 -0400

freedreno: add helper to mark all state dirty

This will simplify things when we break out per-shader-stage dirty bits.

Signed-off-by: Rob Clark <robdclark at gmail.com>

---

 src/gallium/drivers/freedreno/freedreno_batch.c   | 2 +-
 src/gallium/drivers/freedreno/freedreno_context.h | 7 +++++++
 src/gallium/drivers/freedreno/freedreno_draw.c    | 8 ++++----
 src/gallium/drivers/freedreno/freedreno_state.c   | 2 +-
 4 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/freedreno/freedreno_batch.c b/src/gallium/drivers/freedreno/freedreno_batch.c
index 5cd6a697e1..f97282b340 100644
--- a/src/gallium/drivers/freedreno/freedreno_batch.c
+++ b/src/gallium/drivers/freedreno/freedreno_batch.c
@@ -264,7 +264,7 @@ batch_flush(struct fd_batch *batch)
 	 */
 	fd_hw_query_set_stage(batch, batch->draw, FD_STAGE_NULL);
 
-	batch->ctx->dirty = ~0;
+	fd_context_all_dirty(batch->ctx);
 	batch_flush_reset_dependencies(batch, true);
 
 	if (batch->ctx->screen->reorder) {
diff --git a/src/gallium/drivers/freedreno/freedreno_context.h b/src/gallium/drivers/freedreno/freedreno_context.h
index 67291a097c..9db34ef8a0 100644
--- a/src/gallium/drivers/freedreno/freedreno_context.h
+++ b/src/gallium/drivers/freedreno/freedreno_context.h
@@ -325,6 +325,13 @@ fd_context_unlock(struct fd_context *ctx)
 	mtx_unlock(&ctx->screen->lock);
 }
 
+/* mark all state dirty: */
+static inline void
+fd_context_all_dirty(struct fd_context *ctx)
+{
+	ctx->dirty = ~0;
+}
+
 static inline struct pipe_scissor_state *
 fd_context_get_scissor(struct fd_context *ctx)
 {
diff --git a/src/gallium/drivers/freedreno/freedreno_draw.c b/src/gallium/drivers/freedreno/freedreno_draw.c
index 22d20c489c..f911d4a609 100644
--- a/src/gallium/drivers/freedreno/freedreno_draw.c
+++ b/src/gallium/drivers/freedreno/freedreno_draw.c
@@ -95,7 +95,7 @@ fd_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
 
 	if (ctx->in_blit) {
 		fd_batch_reset(batch);
-		ctx->dirty = ~0;
+		fd_context_all_dirty(ctx);
 	}
 
 	batch->blit = ctx->in_blit;
@@ -207,7 +207,7 @@ fd_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
 		ctx->streamout.offsets[i] += info->count;
 
 	if (fd_mesa_debug & FD_DBG_DDRAW)
-		ctx->dirty = 0xffffffff;
+		fd_context_all_dirty(ctx);
 
 	fd_batch_check_size(batch);
 
@@ -307,7 +307,7 @@ fd_clear(struct pipe_context *pctx, unsigned buffers,
 
 	if (ctx->in_blit) {
 		fd_batch_reset(batch);
-		ctx->dirty = ~0;
+		fd_context_all_dirty(ctx);
 	}
 
 	/* for bookkeeping about which buffers have been cleared (and thus
@@ -377,7 +377,7 @@ fd_clear(struct pipe_context *pctx, unsigned buffers,
 			FD_DIRTY_FRAMEBUFFER;
 
 	if (fd_mesa_debug & FD_DBG_DCLEAR)
-		ctx->dirty = 0xffffffff;
+		fd_context_all_dirty(ctx);
 }
 
 static void
diff --git a/src/gallium/drivers/freedreno/freedreno_state.c b/src/gallium/drivers/freedreno/freedreno_state.c
index 804d2b7862..06dfd228dc 100644
--- a/src/gallium/drivers/freedreno/freedreno_state.c
+++ b/src/gallium/drivers/freedreno/freedreno_state.c
@@ -131,7 +131,7 @@ fd_set_framebuffer_state(struct pipe_context *pctx,
 		fd_batch_reference(&ctx->batch, NULL);
 		fd_reset_wfi(batch);
 		ctx->batch = batch;
-		ctx->dirty = ~0;
+		fd_context_all_dirty(ctx);
 
 		if (old_batch && old_batch->blit && !old_batch->back_blit) {
 			/* for blits, there is not really much point in hanging on




More information about the mesa-commit mailing list