iris/perf: add begin/end hooks

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Mark Janes 2019-07-03 15:36:42 -07:00
parent 8c4c346665
commit 1cb4fc184f
2 changed files with 28 additions and 0 deletions

View file

@ -390,3 +390,24 @@ void iris_destroy_monitor_object(struct pipe_context *ctx,
monitor->active_counters = NULL;
free(monitor);
}
bool
iris_begin_monitor(struct pipe_context *ctx,
struct iris_monitor_object *monitor)
{
struct iris_context *ice = (void *) ctx;
struct gen_perf_context *perf_ctx = ice->perf_ctx;
return gen_perf_begin_query(perf_ctx, monitor->query);
}
bool
iris_end_monitor(struct pipe_context *ctx,
struct iris_monitor_object *monitor)
{
struct iris_context *ice = (void *) ctx;
struct gen_perf_context *perf_ctx = ice->perf_ctx;
gen_perf_end_query(perf_ctx, monitor->query);
return true;
}

View file

@ -57,4 +57,11 @@ struct pipe_query;
void iris_destroy_monitor_object(struct pipe_context *ctx,
struct iris_monitor_object *monitor);
bool
iris_begin_monitor(struct pipe_context *ctx,
struct iris_monitor_object *monitor);
bool
iris_end_monitor(struct pipe_context *ctx,
struct iris_monitor_object *monitor);
#endif