From: Rob Clark Date: Wed, 20 Jul 2016 18:50:14 +0000 (-0400) Subject: freedreno: add some hw query traces X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4175606474acda62775c41fa95a577e0796ff17f;p=mesa.git freedreno: add some hw query traces Signed-off-by: Rob Clark --- diff --git a/src/gallium/drivers/freedreno/freedreno_query_hw.c b/src/gallium/drivers/freedreno/freedreno_query_hw.c index 481c66d3925..e5ef51a0b98 100644 --- a/src/gallium/drivers/freedreno/freedreno_query_hw.c +++ b/src/gallium/drivers/freedreno/freedreno_query_hw.c @@ -104,6 +104,7 @@ resume_query(struct fd_batch *batch, struct fd_hw_query *hq, struct fd_ringbuffer *ring) { int idx = pidx(hq->provider->query_type); + DBG("%p", hq); assert(idx >= 0); /* query never would have been created otherwise */ assert(!hq->period); batch->active_providers |= (1 << idx); @@ -119,6 +120,7 @@ pause_query(struct fd_batch *batch, struct fd_hw_query *hq, struct fd_ringbuffer *ring) { int idx = pidx(hq->provider->query_type); + DBG("%p", hq); assert(idx >= 0); /* query never would have been created otherwise */ assert(hq->period && !hq->period->end); assert(batch->active_providers & (1 << idx)); @@ -144,6 +146,8 @@ fd_hw_destroy_query(struct fd_context *ctx, struct fd_query *q) { struct fd_hw_query *hq = fd_hw_query(q); + DBG("%p: active=%d", q, q->active); + destroy_periods(ctx, hq); list_del(&hq->list); @@ -156,6 +160,8 @@ fd_hw_begin_query(struct fd_context *ctx, struct fd_query *q) struct fd_batch *batch = ctx->batch; struct fd_hw_query *hq = fd_hw_query(q); + DBG("%p: active=%d", q, q->active); + if (q->active) return false; @@ -179,16 +185,22 @@ fd_hw_end_query(struct fd_context *ctx, struct fd_query *q) { struct fd_batch *batch = ctx->batch; struct fd_hw_query *hq = fd_hw_query(q); + /* there are a couple special cases, which don't have * a matching ->begin_query(): */ if (skip_begin_query(q->type) && !q->active) { fd_hw_begin_query(ctx, q); } + + DBG("%p: active=%d", q, q->active); + if (!q->active) return; + if (batch && is_active(hq, batch->stage)) pause_query(batch, hq, batch->draw); + q->active = false; /* remove from active list: */ list_delinit(&hq->list); @@ -208,6 +220,8 @@ fd_hw_get_query_result(struct fd_context *ctx, struct fd_query *q, const struct fd_hw_sample_provider *p = hq->provider; struct fd_hw_sample_period *period; + DBG("%p: wait=%d, active=%d", q, wait, q->active); + if (q->active) return false; @@ -308,6 +322,8 @@ fd_hw_create_query(struct fd_context *ctx, unsigned query_type) if (!hq) return NULL; + DBG("%p: query_type=%u", hq, query_type); + hq->provider = ctx->sample_providers[idx]; list_inithead(&hq->periods);