gallium/radeon: remove r600_atom::num_dw
authorMarek Olšák <marek.olsak@amd.com>
Wed, 4 Oct 2017 23:34:36 +0000 (01:34 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Sat, 7 Oct 2017 16:26:35 +0000 (18:26 +0200)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeon/r600_pipe_common.h
src/gallium/drivers/radeon/r600_query.c
src/gallium/drivers/radeon/r600_streamout.c
src/gallium/drivers/radeonsi/si_state_viewport.c

index 074b321de16765c242887709e368bdb6707f7f60..85307983c1082636d0c42624f2f4858766b9f7cd 100644 (file)
@@ -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;
index f41cd8e8f81c1c0f8a244a0b4e93fd0a9108694e..adf3522ebb867e99c447792f4c3d64f4518d0c58 100644 (file)
@@ -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;
 
index a6b466027ddbddb77d6c3afbd8d72aadb840a650..5c14b1bc2ec8b32616a78bc6eea408e8be1a496d 100644 (file)
@@ -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;
 }
index a96eb8adc1349358ce1143fa0697f96ca614bbf1..84f8cd8827ca8135256c8de323a53d12ffcee774 100644 (file)
@@ -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;
 }