Commit b22bacc6 authored by Christian Gmeiner's avatar Christian Gmeiner

etnaviv: push query active handling into generic layer

We want the same active handling for every query type. So lets
handle it in the generic layer.
Signed-off-by: Christian Gmeiner's avatarChristian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-By: Wladimir J. van der Laan's avatarWladimir J. van der Laan <laanwj@gmail.com>
parent bee61d16
......@@ -55,8 +55,15 @@ static boolean
etna_begin_query(struct pipe_context *pctx, struct pipe_query *pq)
{
struct etna_query *q = etna_query(pq);
boolean ret;
return q->funcs->begin_query(etna_context(pctx), q);
if (q->active)
return false;
ret = q->funcs->begin_query(etna_context(pctx), q);
q->active = ret;
return ret;
}
static bool
......@@ -64,7 +71,12 @@ etna_end_query(struct pipe_context *pctx, struct pipe_query *pq)
{
struct etna_query *q = etna_query(pq);
if (!q->active)
return false;
q->funcs->end_query(etna_context(pctx), q);
q->active = false;
return true;
}
......@@ -74,6 +86,9 @@ etna_get_query_result(struct pipe_context *pctx, struct pipe_query *pq,
{
struct etna_query *q = etna_query(pq);
if (q->active)
return false;
return q->funcs->get_query_result(etna_context(pctx), q, wait, result);
}
......
......@@ -62,7 +62,6 @@ etna_sw_begin_query(struct etna_context *ctx, struct etna_query *q)
{
struct etna_sw_query *sq = etna_sw_query(q);
q->active = true;
sq->begin_value = read_counter(ctx, q->type);
return true;
......@@ -73,7 +72,6 @@ etna_sw_end_query(struct etna_context *ctx, struct etna_query *q)
{
struct etna_sw_query *sq = etna_sw_query(q);
q->active = false;
sq->end_value = read_counter(ctx, q->type);
}
......@@ -83,9 +81,6 @@ etna_sw_get_query_result(struct etna_context *ctx, struct etna_query *q,
{
struct etna_sw_query *sq = etna_sw_query(q);
if (q->active)
return false;
util_query_clear_result(result, q->type);
result->u64 = sq->end_value - sq->begin_value;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment