return;
}
+bool si_is_timer_query(unsigned type)
+{
+ return type == PIPE_QUERY_TIME_ELAPSED ||
+ type == PIPE_QUERY_TIMESTAMP ||
+ type == PIPE_QUERY_TIMESTAMP_DISJOINT;
+}
+
bool si_query_needs_begin(unsigned type)
{
return type != PIPE_QUERY_TIMESTAMP;
}
/* Count in queries_suspend. */
- num_dw += ctx->num_cs_dw_queries_suspend;
+ num_dw += ctx->num_cs_dw_nontimer_queries_suspend;
/* Count in streamout_end at the end of CS. */
num_dw += ctx->num_cs_dw_streamout_end;
return;
/* suspend queries */
- if (ctx->num_cs_dw_queries_suspend) {
+ if (ctx->num_cs_dw_nontimer_queries_suspend) {
r600_context_queries_suspend(ctx);
queries_suspended = true;
}
cs->buf[cs->cdw++] = PKT3(PKT3_NOP, 0, 0);
cs->buf[cs->cdw++] = r600_context_bo_reloc(ctx, query->buffer, RADEON_USAGE_WRITE);
- ctx->num_cs_dw_queries_suspend += query->num_cs_dw;
+ if (!si_is_timer_query(query->type)) {
+ ctx->num_cs_dw_nontimer_queries_suspend += query->num_cs_dw;
+ }
}
void r600_query_end(struct r600_context *ctx, struct r600_query *query)
cs->buf[cs->cdw++] = r600_context_bo_reloc(ctx, query->buffer, RADEON_USAGE_WRITE);
query->results_end = (query->results_end + query->result_size) % query->buffer->b.b.width0;
- ctx->num_cs_dw_queries_suspend -= query->num_cs_dw;
+
+ if (si_query_needs_begin(query->type) && !si_is_timer_query(query->type)) {
+ ctx->num_cs_dw_nontimer_queries_suspend -= query->num_cs_dw;
+ }
}
void r600_query_predication(struct r600_context *ctx, struct r600_query *query, int operation,
{
struct r600_query *query;
- LIST_FOR_EACH_ENTRY(query, &ctx->active_query_list, list) {
+ LIST_FOR_EACH_ENTRY(query, &ctx->active_nontimer_query_list, list) {
r600_query_end(ctx, query);
}
- assert(ctx->num_cs_dw_queries_suspend == 0);
+ assert(ctx->num_cs_dw_nontimer_queries_suspend == 0);
}
void r600_context_queries_resume(struct r600_context *ctx)
{
struct r600_query *query;
- assert(ctx->num_cs_dw_queries_suspend == 0);
+ assert(ctx->num_cs_dw_nontimer_queries_suspend == 0);
- LIST_FOR_EACH_ENTRY(query, &ctx->active_query_list, list) {
+ LIST_FOR_EACH_ENTRY(query, &ctx->active_nontimer_query_list, list) {
r600_query_begin(ctx, query);
}
}
memset(&rquery->result, 0, sizeof(rquery->result));
rquery->results_start = rquery->results_end;
r600_query_begin(rctx, (struct r600_query *)query);
- LIST_ADDTAIL(&rquery->list, &rctx->active_query_list);
+
+ if (!si_is_timer_query(rquery->type)) {
+ LIST_ADDTAIL(&rquery->list, &rctx->active_nontimer_query_list);
+ }
}
static void r600_end_query(struct pipe_context *ctx, struct pipe_query *query)
r600_query_end(rctx, rquery);
- if (si_query_needs_begin(rquery->type)) {
+ if (si_query_needs_begin(rquery->type) && !si_is_timer_query(rquery->type)) {
LIST_DELINIT(&rquery->list);
}
}