From 1cb4fc184fcbd96ea7b2a0290228bec6a6f46fb5 Mon Sep 17 00:00:00 2001 From: Mark Janes Date: Wed, 3 Jul 2019 15:36:42 -0700 Subject: [PATCH] iris/perf: add begin/end hooks Reviewed-by: Kenneth Graunke --- src/gallium/drivers/iris/iris_monitor.c | 21 +++++++++++++++++++++ src/gallium/drivers/iris/iris_monitor.h | 7 +++++++ 2 files changed, 28 insertions(+) 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 -- 2.30.2