The get_size perf counter callback is also inlined and removed.
Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
}
/* Compute result bases and CS size per group */
- query->b.num_cs_dw_begin = pc->num_start_cs_dwords;
query->b.num_cs_dw_end = pc->num_stop_cs_dwords;
-
- query->b.num_cs_dw_begin += pc->num_instance_cs_dwords; /* conservative */
query->b.num_cs_dw_end += pc->num_instance_cs_dwords;
i = 0;
query->b.result_size += sizeof(uint64_t) * instances * group->num_counters;
i += instances * group->num_counters;
- pc->get_size(block, group->num_counters, group->selectors,
- &select_dw, &read_dw);
- query->b.num_cs_dw_begin += select_dw;
+ read_dw = 6 * group->num_counters;
query->b.num_cs_dw_end += instances * read_dw;
- query->b.num_cs_dw_begin += pc->num_instance_cs_dwords; /* conservative */
query->b.num_cs_dw_end += instances * pc->num_instance_cs_dwords;
}
if (query->shaders) {
if (query->shaders == R600_PC_SHADERS_WINDOWING)
query->shaders = 0xffffffff;
- query->b.num_cs_dw_begin += pc->num_shaders_cs_dwords;
}
/* Map user-supplied query array to result indices */
case PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE:
query->result_size = 16 * sscreen->info.num_render_backends;
query->result_size += 16; /* for the fence + alignment */
- query->num_cs_dw_begin = 6;
query->num_cs_dw_end = 6 + si_gfx_write_fence_dwords(sscreen);
break;
case PIPE_QUERY_TIME_ELAPSED:
query->result_size = 24;
- query->num_cs_dw_begin = 8;
query->num_cs_dw_end = 8 + si_gfx_write_fence_dwords(sscreen);
break;
case PIPE_QUERY_TIMESTAMP:
case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
/* NumPrimitivesWritten, PrimitiveStorageNeeded. */
query->result_size = 32;
- query->num_cs_dw_begin = 6;
query->num_cs_dw_end = 6;
query->stream = index;
break;
case PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE:
/* NumPrimitivesWritten, PrimitiveStorageNeeded. */
query->result_size = 32 * R600_MAX_STREAMS;
- query->num_cs_dw_begin = 6 * R600_MAX_STREAMS;
query->num_cs_dw_end = 6 * R600_MAX_STREAMS;
break;
case PIPE_QUERY_PIPELINE_STATISTICS:
/* 11 values on GCN. */
query->result_size = 11 * 16;
query->result_size += 8; /* for the fence + alignment */
- query->num_cs_dw_begin = 6;
query->num_cs_dw_end = 6 + si_gfx_write_fence_dwords(sscreen);
break;
default:
assert(ctx->num_cs_dw_queries_suspend == 0);
}
-static unsigned r600_queries_num_cs_dw_for_resuming(struct r600_common_context *ctx,
- struct list_head *query_list)
-{
- struct r600_query_hw *query;
- unsigned num_dw = 0;
-
- LIST_FOR_EACH_ENTRY(query, query_list, list) {
- /* begin + end */
- num_dw += query->num_cs_dw_begin + query->num_cs_dw_end;
-
- /* Workaround for the fact that
- * num_cs_dw_nontimer_queries_suspend is incremented for every
- * resumed query, which raises the bar in need_cs_space for
- * queries about to be resumed.
- */
- num_dw += query->num_cs_dw_end;
- }
- /* guess for ZPASS enable or PERFECT_ZPASS_COUNT enable updates */
- num_dw += 13;
-
- return num_dw;
-}
-
void si_resume_queries(struct r600_common_context *ctx)
{
struct r600_query_hw *query;
- unsigned num_cs_dw = r600_queries_num_cs_dw_for_resuming(ctx, &ctx->active_queries);
assert(ctx->num_cs_dw_queries_suspend == 0);
/* Size of the result in memory for both begin_query and end_query,
* this can be one or two numbers, or it could even be a size of a structure. */
unsigned result_size;
- /* The number of dwords for begin_query or end_query. */
- unsigned num_cs_dw_begin;
+ /* The number of dwords for end_query. */
unsigned num_cs_dw_end;
/* Linked list of queries */
struct list_head list;
unsigned num_blocks;
struct r600_perfcounter_block *blocks;
- unsigned num_start_cs_dwords;
unsigned num_stop_cs_dwords;
unsigned num_instance_cs_dwords;
- unsigned num_shaders_cs_dwords;
unsigned num_shader_types;
const char * const *shader_type_suffixes;
const unsigned *shader_type_bits;
- void (*get_size)(struct r600_perfcounter_block *,
- unsigned count, unsigned *selectors,
- unsigned *num_select_dw, unsigned *num_read_dw);
-
void (*emit_instance)(struct r600_common_context *,
int se, int instance);
void (*emit_shaders)(struct r600_common_context *, unsigned shaders);
{ &cik_CPC, 35 },
};
-static void si_pc_get_size(struct r600_perfcounter_block *group,
- unsigned count, unsigned *selectors,
- unsigned *num_select_dw, unsigned *num_read_dw)
-{
- struct si_pc_block *sigroup = (struct si_pc_block *)group->data;
- struct si_pc_block_base *regs = sigroup->b;
- unsigned layout_multi = regs->layout & SI_PC_MULTI_MASK;
-
- if (regs->layout & SI_PC_FAKE) {
- *num_select_dw = 0;
- } else if (layout_multi == SI_PC_MULTI_BLOCK) {
- if (count < regs->num_multi)
- *num_select_dw = 2 * (count + 2) + regs->num_prelude;
- else
- *num_select_dw = 2 + count + regs->num_multi + regs->num_prelude;
- } else if (layout_multi == SI_PC_MULTI_TAIL) {
- *num_select_dw = 4 + count + MIN2(count, regs->num_multi) + regs->num_prelude;
- } else if (layout_multi == SI_PC_MULTI_CUSTOM) {
- assert(regs->num_prelude == 0);
- *num_select_dw = 3 * (count + MIN2(count, regs->num_multi));
- } else {
- assert(layout_multi == SI_PC_MULTI_ALTERNATE);
-
- *num_select_dw = 2 + count + MIN2(count, regs->num_multi) + regs->num_prelude;
- }
-
- *num_read_dw = 6 * count;
-}
-
static void si_pc_emit_instance(struct r600_common_context *ctx,
int se, int instance)
{
if (!pc)
return;
- pc->num_start_cs_dwords = 14;
pc->num_stop_cs_dwords = 14 + si_gfx_write_fence_dwords(screen);
pc->num_instance_cs_dwords = 3;
- pc->num_shaders_cs_dwords = 4;
pc->num_shader_types = ARRAY_SIZE(si_pc_shader_type_bits);
pc->shader_type_suffixes = si_pc_shader_type_suffixes;
pc->shader_type_bits = si_pc_shader_type_bits;
- pc->get_size = si_pc_get_size;
pc->emit_instance = si_pc_emit_instance;
pc->emit_shaders = si_pc_emit_shaders;
pc->emit_select = si_pc_emit_select;