From 708337e62e86cfb2df893f0733bb7c5a4938fab6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christian=20K=C3=B6nig?= Date: Thu, 2 Aug 2012 14:43:23 +0200 Subject: [PATCH] radeonsi: move init state to new state handling MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- .../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 c27221ca675..0d0d64b8bac 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 a9be2ad26ea..d6b3b74860d 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 610f8b1708c..6d458d48bdc 100644 --- a/src/gallium/drivers/radeonsi/r600_hw_context_priv.h +++ b/src/gallium/drivers/radeonsi/r600_hw_context_priv.h @@ -35,11 +35,6 @@ #define PKT_COUNT_C 0xC000FFFF #define PKT_COUNT_S(x) (((x) & 0x3FFF) << 16) -/* - * r600_hw_context.c - */ -void r600_init_cs(struct r600_context *ctx); - /* * evergreen_hw_context.c */ diff --git a/src/gallium/drivers/radeonsi/radeonsi_pipe.h b/src/gallium/drivers/radeonsi/radeonsi_pipe.h index 4b9884e4421..ec2f7906877 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 1cd361013cc..e8a7b77da7e 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); -- 2.30.2