[Mesa-dev] [PATCH 3/8] radeonsi: move init state to new state handling
Christian König
deathsimple at vodafone.de
Wed Aug 8 04:05:03 PDT 2012
Signed-off-by: Christian König <deathsimple at vodafone.de>
---
.../drivers/radeonsi/evergreen_hw_context.c | 1 -
src/gallium/drivers/radeonsi/r600_hw_context.c | 16 +---------------
.../drivers/radeonsi/r600_hw_context_priv.h | 5 -----
src/gallium/drivers/radeonsi/radeonsi_pipe.h | 1 -
src/gallium/drivers/radeonsi/si_state.c | 5 +++++
5 files changed, 6 insertions(+), 22 deletions(-)
diff --git a/src/gallium/drivers/radeonsi/evergreen_hw_context.c b/src/gallium/drivers/radeonsi/evergreen_hw_context.c
index c27221c..0d0d64b 100644
--- a/src/gallium/drivers/radeonsi/evergreen_hw_context.c
+++ b/src/gallium/drivers/radeonsi/evergreen_hw_context.c
@@ -38,7 +38,6 @@ int si_context_init(struct r600_context *ctx)
ctx->cs = ctx->ws->cs_create(ctx->ws);
- r600_init_cs(ctx);
ctx->max_db = 8;
return 0;
}
diff --git a/src/gallium/drivers/radeonsi/r600_hw_context.c b/src/gallium/drivers/radeonsi/r600_hw_context.c
index a9be2ad..d6b3b74 100644
--- a/src/gallium/drivers/radeonsi/r600_hw_context.c
+++ b/src/gallium/drivers/radeonsi/r600_hw_context.c
@@ -128,18 +128,6 @@ static inline void r600_context_ps_partial_flush(struct r600_context *ctx)
ctx->flags &= ~R600_CONTEXT_DRAW_PENDING;
}
-void r600_init_cs(struct r600_context *ctx)
-{
- struct radeon_winsys_cs *cs = ctx->cs;
-
- /* All asics require this one */
- cs->buf[cs->cdw++] = PKT3(PKT3_CONTEXT_CONTROL, 1, 0);
- cs->buf[cs->cdw++] = 0x80000000;
- cs->buf[cs->cdw++] = 0x80000000;
-
- ctx->init_dwords = cs->cdw;
-}
-
/* initialize */
void r600_need_cs_space(struct r600_context *ctx, unsigned num_dw,
boolean count_draw_in)
@@ -209,7 +197,7 @@ void r600_context_flush(struct r600_context *ctx, unsigned flags)
bool queries_suspended = false;
bool streamout_suspended = false;
- if (cs->cdw == ctx->init_dwords)
+ if (!cs->cdw)
return;
/* suspend queries */
@@ -238,8 +226,6 @@ void r600_context_flush(struct r600_context *ctx, unsigned flags)
ctx->pm4_dirty_cdwords = 0;
ctx->flags = 0;
- r600_init_cs(ctx);
-
if (streamout_suspended) {
ctx->streamout_start = TRUE;
ctx->streamout_append_bitmask = ~0;
diff --git a/src/gallium/drivers/radeonsi/r600_hw_context_priv.h b/src/gallium/drivers/radeonsi/r600_hw_context_priv.h
index 610f8b1..6d458d4 100644
--- a/src/gallium/drivers/radeonsi/r600_hw_context_priv.h
+++ b/src/gallium/drivers/radeonsi/r600_hw_context_priv.h
@@ -36,11 +36,6 @@
#define PKT_COUNT_S(x) (((x) & 0x3FFF) << 16)
/*
- * r600_hw_context.c
- */
-void r600_init_cs(struct r600_context *ctx);
-
-/*
* evergreen_hw_context.c
*/
void evergreen_flush_vgt_streamout(struct r600_context *ctx);
diff --git a/src/gallium/drivers/radeonsi/radeonsi_pipe.h b/src/gallium/drivers/radeonsi/radeonsi_pipe.h
index 9aebc6d..ee28065 100644
--- a/src/gallium/drivers/radeonsi/radeonsi_pipe.h
+++ b/src/gallium/drivers/radeonsi/radeonsi_pipe.h
@@ -181,7 +181,6 @@ struct r600_context {
struct radeon_winsys_cs *cs;
unsigned pm4_dirty_cdwords;
- unsigned init_dwords;
/* The list of active queries. Only one query of each type can be active. */
struct list_head active_query_list;
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c
index 1cd3610..e8a7b77 100644
--- a/src/gallium/drivers/radeonsi/si_state.c
+++ b/src/gallium/drivers/radeonsi/si_state.c
@@ -2354,6 +2354,11 @@ void si_init_config(struct r600_context *rctx)
{
struct si_pm4_state *pm4 = CALLOC_STRUCT(si_pm4_state);
+ si_pm4_cmd_begin(pm4, PKT3_CONTEXT_CONTROL);
+ si_pm4_cmd_add(pm4, 0x80000000);
+ si_pm4_cmd_add(pm4, 0x80000000);
+ si_pm4_cmd_end(pm4, false);
+
si_pm4_set_reg(pm4, R_028A4C_PA_SC_MODE_CNTL_1, 0x0);
si_pm4_set_reg(pm4, R_028A10_VGT_OUTPUT_PATH_CNTL, 0x0);
--
1.7.9.5
More information about the mesa-dev
mailing list