From efd72b31cb31a850fd792081efe5b1e75592f7d3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Thu, 5 Oct 2017 01:34:36 +0200 Subject: [PATCH] gallium/radeon: remove r600_atom::num_dw MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Nicolai Hähnle --- src/gallium/drivers/radeon/r600_pipe_common.h | 2 -- src/gallium/drivers/radeon/r600_query.c | 15 ------------- src/gallium/drivers/radeon/r600_streamout.c | 21 ++----------------- .../drivers/radeonsi/si_state_viewport.c | 3 --- 4 files changed, 2 insertions(+), 39 deletions(-) diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h index 074b321de16..85307983c10 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.h +++ b/src/gallium/drivers/radeon/r600_pipe_common.h @@ -480,7 +480,6 @@ struct r600_common_screen { * command stream. */ struct r600_atom { void (*emit)(struct r600_common_context *ctx, struct r600_atom *state); - unsigned num_dw; unsigned short id; }; @@ -498,7 +497,6 @@ struct r600_so_target { struct r600_streamout { struct r600_atom begin_atom; bool begin_emitted; - unsigned num_dw_for_end; unsigned enabled_mask; unsigned num_targets; diff --git a/src/gallium/drivers/radeon/r600_query.c b/src/gallium/drivers/radeon/r600_query.c index f41cd8e8f81..adf3522ebb8 100644 --- a/src/gallium/drivers/radeon/r600_query.c +++ b/src/gallium/drivers/radeon/r600_query.c @@ -1777,11 +1777,8 @@ static void r600_render_condition(struct pipe_context *ctx, { struct r600_common_context *rctx = (struct r600_common_context *)ctx; struct r600_query_hw *rquery = (struct r600_query_hw *)query; - struct r600_query_buffer *qbuf; struct r600_atom *atom = &rctx->render_cond_atom; - /* Compute the size of SET_PREDICATION packets. */ - atom->num_dw = 0; if (query) { bool needs_workaround = false; @@ -1824,16 +1821,6 @@ static void r600_render_condition(struct pipe_context *ctx, rctx->render_cond_force_off = old_force_off; } - - if (needs_workaround) { - atom->num_dw = 5; - } else { - for (qbuf = &rquery->buffer; qbuf; qbuf = qbuf->previous) - atom->num_dw += (qbuf->results_end / rquery->result_size) * 5; - - if (rquery->b.type == PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE) - atom->num_dw *= R600_MAX_STREAMS; - } } rctx->render_cond = query; @@ -1870,8 +1857,6 @@ static unsigned r600_queries_num_cs_dw_for_resuming(struct r600_common_context * */ num_dw += query->num_cs_dw_end; } - /* primitives generated query */ - num_dw += ctx->streamout.enable_atom.num_dw; /* guess for ZPASS enable or PERFECT_ZPASS_COUNT enable updates */ num_dw += 13; diff --git a/src/gallium/drivers/radeon/r600_streamout.c b/src/gallium/drivers/radeon/r600_streamout.c index a6b466027dd..5c14b1bc2ec 100644 --- a/src/gallium/drivers/radeon/r600_streamout.c +++ b/src/gallium/drivers/radeon/r600_streamout.c @@ -76,26 +76,10 @@ static void r600_so_target_destroy(struct pipe_context *ctx, void si_streamout_buffers_dirty(struct r600_common_context *rctx) { - struct r600_atom *begin = &rctx->streamout.begin_atom; - unsigned num_bufs = util_bitcount(rctx->streamout.enabled_mask); - unsigned num_bufs_appended = util_bitcount(rctx->streamout.enabled_mask & - rctx->streamout.append_bitmask); - - if (!num_bufs) + if (!rctx->streamout.enabled_mask) return; - rctx->streamout.num_dw_for_end = - 12 + /* flush_vgt_streamout */ - num_bufs * 11; /* STRMOUT_BUFFER_UPDATE, BUFFER_SIZE */ - - begin->num_dw = 12; /* flush_vgt_streamout */ - begin->num_dw += num_bufs * 4; /* SET_CONTEXT_REG */ - begin->num_dw += - num_bufs_appended * 8 + /* STRMOUT_BUFFER_UPDATE */ - (num_bufs - num_bufs_appended) * 6; + /* STRMOUT_BUFFER_UPDATE */ - - rctx->set_atom_dirty(rctx, begin, true); - + rctx->set_atom_dirty(rctx, &rctx->streamout.begin_atom, true); r600_set_streamout_enable(rctx, true); } @@ -323,5 +307,4 @@ void si_streamout_init(struct r600_common_context *rctx) rctx->b.stream_output_target_destroy = r600_so_target_destroy; rctx->streamout.begin_atom.emit = r600_emit_streamout_begin; rctx->streamout.enable_atom.emit = r600_emit_streamout_enable; - rctx->streamout.enable_atom.num_dw = 6; } diff --git a/src/gallium/drivers/radeonsi/si_state_viewport.c b/src/gallium/drivers/radeonsi/si_state_viewport.c index a96eb8adc13..84f8cd8827c 100644 --- a/src/gallium/drivers/radeonsi/si_state_viewport.c +++ b/src/gallium/drivers/radeonsi/si_state_viewport.c @@ -426,9 +426,6 @@ void si_init_viewport_functions(struct si_context *ctx) ctx->scissors.atom.emit = si_emit_scissors; ctx->viewports.atom.emit = si_emit_viewport_states; - ctx->scissors.atom.num_dw = (2 + 16 * 2) + 6; - ctx->viewports.atom.num_dw = 2 + 16 * 6; - ctx->b.b.set_scissor_states = si_set_scissor_states; ctx->b.b.set_viewport_states = si_set_viewport_states; } -- 2.30.2