mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-21 22:50:37 +02:00
freedreno: Remove the "active" member of queries.
The state tracker only gets to begin/query/destroy when !active and end when active, so we have no need to try to track this ourselves. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4356>
This commit is contained in:
parent
b7fe793869
commit
a99ff93374
4 changed files with 9 additions and 21 deletions
|
|
@ -63,11 +63,7 @@ fd_begin_query(struct pipe_context *pctx, struct pipe_query *pq)
|
|||
{
|
||||
struct fd_query *q = fd_query(pq);
|
||||
|
||||
if (q->active)
|
||||
return false;
|
||||
|
||||
q->funcs->begin_query(fd_context(pctx), q);
|
||||
q->active = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -80,14 +76,10 @@ fd_end_query(struct pipe_context *pctx, struct pipe_query *pq)
|
|||
/* there are a couple special cases, which don't have
|
||||
* a matching ->begin_query():
|
||||
*/
|
||||
if (skip_begin_query(q->type) && !q->active)
|
||||
if (skip_begin_query(q->type))
|
||||
fd_begin_query(pctx, pq);
|
||||
|
||||
if (!q->active)
|
||||
return false;
|
||||
|
||||
q->funcs->end_query(fd_context(pctx), q);
|
||||
q->active = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -98,9 +90,6 @@ fd_get_query_result(struct pipe_context *pctx, struct pipe_query *pq,
|
|||
{
|
||||
struct fd_query *q = fd_query(pq);
|
||||
|
||||
if (q->active)
|
||||
return false;
|
||||
|
||||
util_query_clear_result(result, q->type);
|
||||
|
||||
return q->funcs->get_query_result(fd_context(pctx), q, wait, result);
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ struct fd_query_funcs {
|
|||
|
||||
struct fd_query {
|
||||
const struct fd_query_funcs *funcs;
|
||||
bool active;
|
||||
int type;
|
||||
unsigned index;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ fd_acc_destroy_query(struct fd_context *ctx, struct fd_query *q)
|
|||
{
|
||||
struct fd_acc_query *aq = fd_acc_query(q);
|
||||
|
||||
DBG("%p: active=%d", q, q->active);
|
||||
DBG("%p", q);
|
||||
|
||||
pipe_resource_reference(&aq->prsc, NULL);
|
||||
list_del(&aq->node);
|
||||
|
|
@ -81,7 +81,7 @@ fd_acc_begin_query(struct fd_context *ctx, struct fd_query *q)
|
|||
struct fd_acc_query *aq = fd_acc_query(q);
|
||||
const struct fd_acc_sample_provider *p = aq->provider;
|
||||
|
||||
DBG("%p: active=%d", q, q->active);
|
||||
DBG("%p", q);
|
||||
|
||||
/* ->begin_query() discards previous results, so realloc bo: */
|
||||
realloc_query_bo(ctx, aq);
|
||||
|
|
@ -102,7 +102,7 @@ fd_acc_end_query(struct fd_context *ctx, struct fd_query *q)
|
|||
struct fd_acc_query *aq = fd_acc_query(q);
|
||||
const struct fd_acc_sample_provider *p = aq->provider;
|
||||
|
||||
DBG("%p: active=%d", q, q->active);
|
||||
DBG("%p", q);
|
||||
|
||||
if (batch && is_active(aq, batch->stage))
|
||||
p->pause(aq, batch);
|
||||
|
|
@ -119,7 +119,7 @@ fd_acc_get_query_result(struct fd_context *ctx, struct fd_query *q,
|
|||
const struct fd_acc_sample_provider *p = aq->provider;
|
||||
struct fd_resource *rsc = fd_resource(aq->prsc);
|
||||
|
||||
DBG("%p: wait=%d, active=%d", q, wait, q->active);
|
||||
DBG("%p: wait=%d", q, wait);
|
||||
|
||||
assert(list_is_empty(&aq->node));
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
@ -138,7 +138,7 @@ 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);
|
||||
|
|
@ -157,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);
|
||||
|
|
@ -180,7 +180,7 @@ 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))
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue