[Mesa-dev] [PATCH 02/13] radeonsi: remove init config from states

Marek Olšák maraeo at gmail.com
Sun Jan 4 15:18:41 PST 2015


From: Marek Olšák <marek.olsak at amd.com>

It really doesn't do anything there.
---
 src/gallium/drivers/radeonsi/si_hw_context.c | 3 +--
 src/gallium/drivers/radeonsi/si_pipe.c       | 1 +
 src/gallium/drivers/radeonsi/si_pipe.h       | 1 +
 src/gallium/drivers/radeonsi/si_pm4.c        | 1 -
 src/gallium/drivers/radeonsi/si_state.c      | 2 +-
 src/gallium/drivers/radeonsi/si_state.h      | 1 -
 6 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_hw_context.c b/src/gallium/drivers/radeonsi/si_hw_context.c
index 983a097..5ebd0be 100644
--- a/src/gallium/drivers/radeonsi/si_hw_context.c
+++ b/src/gallium/drivers/radeonsi/si_hw_context.c
@@ -142,8 +142,7 @@ void si_begin_new_cs(struct si_context *ctx)
 	si_pm4_reset_emitted(ctx);
 
 	/* The CS initialization should be emitted before everything else. */
-	si_pm4_emit(ctx, ctx->queued.named.init);
-	ctx->emitted.named.init = ctx->queued.named.init;
+	si_pm4_emit(ctx, ctx->init_config);
 
 	ctx->clip_regs.dirty = true;
 	ctx->framebuffer.atom.dirty = true;
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
index afb6364..4b66499 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -43,6 +43,7 @@ static void si_destroy_context(struct pipe_context *context)
 	pipe_resource_reference(&sctx->null_const_buf.buffer, NULL);
 	r600_resource_reference(&sctx->border_color_table, NULL);
 
+	si_pm4_free_state(sctx, sctx->init_config, ~0);
 	si_pm4_delete_state(sctx, gs_rings, sctx->gs_rings);
 	si_pm4_delete_state(sctx, gs_onoff, sctx->gs_on);
 	si_pm4_delete_state(sctx, gs_onoff, sctx->gs_off);
diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h
index 9ba4970..83d046e 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.h
+++ b/src/gallium/drivers/radeonsi/si_pipe.h
@@ -98,6 +98,7 @@ struct si_context {
 	void				*custom_blend_decompress;
 	void				*custom_blend_fastclear;
 	struct si_screen		*screen;
+	struct si_pm4_state		*init_config;
 
 	union {
 		struct {
diff --git a/src/gallium/drivers/radeonsi/si_pm4.c b/src/gallium/drivers/radeonsi/si_pm4.c
index 21ab9f2..2729346 100644
--- a/src/gallium/drivers/radeonsi/si_pm4.c
+++ b/src/gallium/drivers/radeonsi/si_pm4.c
@@ -169,7 +169,6 @@ void si_pm4_emit_dirty(struct si_context *sctx)
 		if (!state || sctx->emitted.array[i] == state)
 			continue;
 
-		assert(state != sctx->queued.named.init);
 		si_pm4_emit(sctx, state);
 		sctx->emitted.array[i] = state;
 	}
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index 5a417b0..b6b4091 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -3085,5 +3085,5 @@ void si_init_config(struct si_context *sctx)
 		si_pm4_set_reg(pm4, R_00B01C_SPI_SHADER_PGM_RSRC3_PS, S_00B01C_CU_EN(0xffff));
 	}
 
-	si_pm4_set_state(sctx, init, pm4);
+	sctx->init_config = pm4;
 }
diff --git a/src/gallium/drivers/radeonsi/si_state.h b/src/gallium/drivers/radeonsi/si_state.h
index 0e06767..504b428 100644
--- a/src/gallium/drivers/radeonsi/si_state.h
+++ b/src/gallium/drivers/radeonsi/si_state.h
@@ -88,7 +88,6 @@ struct si_vertex_element
 
 union si_state {
 	struct {
-		struct si_pm4_state		*init;
 		struct si_state_blend		*blend;
 		struct si_pm4_state		*blend_color;
 		struct si_pm4_state		*clip;
-- 
2.1.0



More information about the mesa-dev mailing list