diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2020-08-26 06:03:18 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2020-08-26 06:03:18 +0000 |
commit | af5e8f5366b05c3d4f8521f318c143a5c5dc3ea9 (patch) | |
tree | c5691445908b1beca9facf0e5e3c5d7f35f74228 /lib/mesa/src/gallium/drivers/freedreno/freedreno_query_hw.c | |
parent | 27c93456b58343162f7c4ad20ca6bea0c9a91646 (diff) |
Merge Mesa 20.1.6
Diffstat (limited to 'lib/mesa/src/gallium/drivers/freedreno/freedreno_query_hw.c')
-rw-r--r-- | lib/mesa/src/gallium/drivers/freedreno/freedreno_query_hw.c | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/lib/mesa/src/gallium/drivers/freedreno/freedreno_query_hw.c b/lib/mesa/src/gallium/drivers/freedreno/freedreno_query_hw.c index 1c7048d3f..961e9c607 100644 --- a/lib/mesa/src/gallium/drivers/freedreno/freedreno_query_hw.c +++ b/lib/mesa/src/gallium/drivers/freedreno/freedreno_query_hw.c @@ -124,7 +124,7 @@ 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); + DBG("%p", q); destroy_periods(ctx, hq); list_del(&hq->list); @@ -132,13 +132,13 @@ fd_hw_destroy_query(struct fd_context *ctx, struct fd_query *q) free(hq); } -static bool +static void fd_hw_begin_query(struct fd_context *ctx, struct fd_query *q) { struct fd_batch *batch = fd_context_batch(ctx); struct fd_hw_query *hq = fd_hw_query(q); - DBG("%p: active=%d", q, q->active); + DBG("%p", q); /* begin_query() should clear previous results: */ destroy_periods(ctx, hq); @@ -147,10 +147,8 @@ fd_hw_begin_query(struct fd_context *ctx, struct fd_query *q) resume_query(batch, hq, batch->draw); /* add to active list: */ - assert(list_empty(&hq->list)); + assert(list_is_empty(&hq->list)); list_addtail(&hq->list, &ctx->hw_active_queries); - - return true; } static void @@ -159,7 +157,7 @@ fd_hw_end_query(struct fd_context *ctx, struct fd_query *q) struct fd_batch *batch = fd_context_batch(ctx); struct fd_hw_query *hq = fd_hw_query(q); - DBG("%p: active=%d", q, q->active); + DBG("%p", q); if (batch && is_active(hq, batch->stage)) pause_query(batch, hq, batch->draw); @@ -182,12 +180,12 @@ 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); + DBG("%p: wait=%d", q, wait); - if (LIST_IS_EMPTY(&hq->periods)) + if (list_is_empty(&hq->periods)) return true; - assert(LIST_IS_EMPTY(&hq->list)); + assert(list_is_empty(&hq->list)); assert(!hq->period); /* if !wait, then check the last sample (the one most likely to @@ -209,7 +207,7 @@ fd_hw_get_query_result(struct fd_context *ctx, struct fd_query *q, * spin forever: */ if (hq->no_wait_cnt++ > 5) - fd_batch_flush(rsc->write_batch, false); + fd_batch_flush(rsc->write_batch); return false; } @@ -237,7 +235,7 @@ fd_hw_get_query_result(struct fd_context *ctx, struct fd_query *q, struct fd_resource *rsc = fd_resource(start->prsc); if (rsc->write_batch) - fd_batch_flush(rsc->write_batch, true); + fd_batch_flush(rsc->write_batch); /* some piglit tests at least do query with no draws, I guess: */ if (!rsc->bo) @@ -266,7 +264,7 @@ static const struct fd_query_funcs hw_query_funcs = { }; struct fd_query * -fd_hw_create_query(struct fd_context *ctx, unsigned query_type) +fd_hw_create_query(struct fd_context *ctx, unsigned query_type, unsigned index) { struct fd_hw_query *hq; struct fd_query *q; @@ -289,6 +287,7 @@ fd_hw_create_query(struct fd_context *ctx, unsigned query_type) q = &hq->base; q->funcs = &hw_query_funcs; q->type = query_type; + q->index = index; return q; } @@ -380,6 +379,15 @@ fd_hw_query_prepare_tile(struct fd_batch *batch, uint32_t n, void fd_hw_query_set_stage(struct fd_batch *batch, enum fd_render_stage stage) { + /* special case: internal blits (like mipmap level generation) + * go through normal draw path (via util_blitter_blit()).. but + * we need to ignore the FD_STAGE_DRAW which will be set, so we + * don't enable queries which should be paused during internal + * blits: + */ + if (batch->stage == FD_STAGE_BLIT && stage != FD_STAGE_NULL) + stage = FD_STAGE_BLIT; + if (stage != batch->stage) { struct fd_hw_query *hq; LIST_FOR_EACH_ENTRY(hq, &batch->ctx->hw_active_queries, list) { |