diff options
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_query_hw.c')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_query_hw.c | 41 |
1 files changed, 10 insertions, 31 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_query_hw.c b/src/gallium/drivers/freedreno/freedreno_query_hw.c index ef458ce5db2..2ebf8ade585 100644 --- a/src/gallium/drivers/freedreno/freedreno_query_hw.c +++ b/src/gallium/drivers/freedreno/freedreno_query_hw.c @@ -40,26 +40,6 @@ struct fd_hw_sample_period { struct list_head list; }; -/* maps query_type to sample provider idx: */ -static int pidx(unsigned query_type) -{ - switch (query_type) { - case PIPE_QUERY_OCCLUSION_COUNTER: - return 0; - case PIPE_QUERY_OCCLUSION_PREDICATE: - return 1; - /* TODO currently queries only emitted in main pass (not in binning pass).. - * which is fine for occlusion query, but pretty much not anything else. - */ - case PIPE_QUERY_TIME_ELAPSED: - return 2; - case PIPE_QUERY_TIMESTAMP: - return 3; - default: - return -1; - } -} - static struct fd_hw_sample * get_sample(struct fd_batch *batch, struct fd_ringbuffer *ring, unsigned query_type) @@ -72,7 +52,7 @@ get_sample(struct fd_batch *batch, struct fd_ringbuffer *ring, if (!batch->sample_cache[idx]) { struct fd_hw_sample *new_samp = - ctx->sample_providers[idx]->get_sample(batch, ring); + ctx->hw_sample_providers[idx]->get_sample(batch, ring); fd_hw_sample_reference(ctx, &batch->sample_cache[idx], new_samp); util_dynarray_append(&batch->samples, struct fd_hw_sample *, new_samp); batch->needs_flush = true; @@ -170,7 +150,7 @@ fd_hw_begin_query(struct fd_context *ctx, struct fd_query *q) /* add to active list: */ assert(list_empty(&hq->list)); - list_addtail(&hq->list, &ctx->active_queries); + list_addtail(&hq->list, &ctx->hw_active_queries); return true; } @@ -294,7 +274,7 @@ fd_hw_create_query(struct fd_context *ctx, unsigned query_type) struct fd_query *q; int idx = pidx(query_type); - if ((idx < 0) || !ctx->sample_providers[idx]) + if ((idx < 0) || !ctx->hw_sample_providers[idx]) return NULL; hq = CALLOC_STRUCT(fd_hw_query); @@ -303,7 +283,7 @@ fd_hw_create_query(struct fd_context *ctx, unsigned query_type) DBG("%p: query_type=%u", hq, query_type); - hq->provider = ctx->sample_providers[idx]; + hq->provider = ctx->hw_sample_providers[idx]; list_inithead(&hq->periods); list_inithead(&hq->list); @@ -405,7 +385,7 @@ fd_hw_query_set_stage(struct fd_batch *batch, struct fd_ringbuffer *ring, { if (stage != batch->stage) { struct fd_hw_query *hq; - LIST_FOR_EACH_ENTRY(hq, &batch->ctx->active_queries, list) { + LIST_FOR_EACH_ENTRY(hq, &batch->ctx->hw_active_queries, list) { bool was_active = is_active(hq, batch->stage); bool now_active = is_active(hq, stage); @@ -428,9 +408,9 @@ fd_hw_query_enable(struct fd_batch *batch, struct fd_ringbuffer *ring) struct fd_context *ctx = batch->ctx; for (int idx = 0; idx < MAX_HW_SAMPLE_PROVIDERS; idx++) { if (batch->active_providers & (1 << idx)) { - assert(ctx->sample_providers[idx]); - if (ctx->sample_providers[idx]->enable) - ctx->sample_providers[idx]->enable(ctx, ring); + assert(ctx->hw_sample_providers[idx]); + if (ctx->hw_sample_providers[idx]->enable) + ctx->hw_sample_providers[idx]->enable(ctx, ring); } } batch->active_providers = 0; /* clear it for next frame */ @@ -444,9 +424,9 @@ fd_hw_query_register_provider(struct pipe_context *pctx, int idx = pidx(provider->query_type); assert((0 <= idx) && (idx < MAX_HW_SAMPLE_PROVIDERS)); - assert(!ctx->sample_providers[idx]); + assert(!ctx->hw_sample_providers[idx]); - ctx->sample_providers[idx] = provider; + ctx->hw_sample_providers[idx] = provider; } void @@ -458,7 +438,6 @@ fd_hw_query_init(struct pipe_context *pctx) 16); slab_create(&ctx->sample_period_pool, sizeof(struct fd_hw_sample_period), 16); - list_inithead(&ctx->active_queries); } void |