Commit e0bc251e authored by Christian Gmeiner's avatar Christian Gmeiner Committed by Marge Bot
Browse files

etnaviv: extend result(..) to return if data is ready



For the upcoming conversion of perfmon queries to the acc query
framework we need a way to tell that the data is not ready.
Signed-off-by: Christian Gmeiner's avatarChristian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <mesa/mesa!1530>
parent e5b0eed0
......@@ -85,7 +85,7 @@ occlusion_suspend(struct etna_acc_query *aq, struct etna_context *ctx)
resource_written(ctx, aq->prsc);
}
static void
static bool
occlusion_result(struct etna_acc_query *aq, void *buf,
union pipe_query_result *result)
{
......@@ -99,6 +99,8 @@ occlusion_result(struct etna_acc_query *aq, void *buf,
result->u64 = sum;
else
result->b = !!sum;
return true;
}
static void
......@@ -214,12 +216,14 @@ etna_acc_get_query_result(struct etna_context *ctx, struct etna_query *q,
return false;
void *ptr = etna_bo_map(rsc->bo);
p->result(aq, ptr, result);
aq->samples = 0;
bool success = p->result(aq, ptr, result);
if (success)
aq->samples = 0;
etna_bo_cpu_fini(rsc->bo);
return true;
return success;
}
static const struct etna_query_funcs acc_query_funcs = {
......
......@@ -39,8 +39,8 @@ struct etna_acc_sample_provider {
void (*resume)(struct etna_acc_query *aq, struct etna_context *ctx);
void (*suspend)(struct etna_acc_query *aq, struct etna_context *ctx);
void (*result)(struct etna_acc_query *aq, void *buf,
union pipe_query_result *result);
bool (*result)(struct etna_acc_query *aq, void *buf,
union pipe_query_result *result);
};
struct etna_acc_query {
......
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