iris/perf: add begin/end hooks
authorMark Janes <mark.a.janes@intel.com>
Wed, 3 Jul 2019 22:36:42 +0000 (15:36 -0700)
committerMark Janes <mark.a.janes@intel.com>
Sat, 10 Aug 2019 02:28:24 +0000 (19:28 -0700)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/gallium/drivers/iris/iris_monitor.c
src/gallium/drivers/iris/iris_monitor.h

index 8733260d926f8ca2dfb5f240b008704922838a6d..e072bf6b5a874e8b8e90a1b05f88bf2f570513dc 100644 (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;
+}
index b3279f4a3118500c12d844b44855f934fd03fd38..9616ff16df5a7115fb9a8309dab804cae9f124ff 100644 (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