From: Mark Janes Date: Wed, 3 Jul 2019 22:36:42 +0000 (-0700) Subject: iris/perf: add begin/end hooks X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1cb4fc184fcbd96ea7b2a0290228bec6a6f46fb5;p=mesa.git iris/perf: add begin/end hooks Reviewed-by: Kenneth Graunke --- diff --git a/src/gallium/drivers/iris/iris_monitor.c b/src/gallium/drivers/iris/iris_monitor.c index 8733260d926..e072bf6b5a8 100644 --- a/src/gallium/drivers/iris/iris_monitor.c +++ b/src/gallium/drivers/iris/iris_monitor.c @@ -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; +} diff --git a/src/gallium/drivers/iris/iris_monitor.h b/src/gallium/drivers/iris/iris_monitor.h index b3279f4a311..9616ff16df5 100644 --- a/src/gallium/drivers/iris/iris_monitor.h +++ b/src/gallium/drivers/iris/iris_monitor.h @@ -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