intel/perf: move free_sample_bufs into perf
authorMark Janes <mark.a.janes@intel.com>
Mon, 3 Jun 2019 23:16:40 +0000 (16:16 -0700)
committerMark Janes <mark.a.janes@intel.com>
Thu, 8 Aug 2019 04:33:55 +0000 (21:33 -0700)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/intel/perf/gen_perf.c
src/intel/perf/gen_perf.h
src/mesa/drivers/dri/i965/brw_performance_query.c

index 9df9451..4a3546c 100644 (file)
@@ -867,3 +867,13 @@ gen_perf_reap_old_sample_buffers(struct gen_perf_context *perf_ctx)
          return;
    }
 }
+
+void
+gen_perf_free_sample_bufs(struct gen_perf_context *perf_ctx)
+{
+   foreach_list_typed_safe(struct oa_sample_buf, buf, link,
+                           &perf_ctx->free_sample_buffers)
+      ralloc_free(buf);
+
+   exec_list_make_empty(&perf_ctx->free_sample_buffers);
+}
index a41414a..09f4ae1 100644 (file)
@@ -506,6 +506,7 @@ uint64_t gen_perf_query_get_metric_id(struct gen_perf_config *perf,
                                       const struct gen_perf_query_info *query);
 struct oa_sample_buf * gen_perf_get_free_sample_buf(struct gen_perf_context *perf);
 void gen_perf_reap_old_sample_buffers(struct gen_perf_context *perf_ctx);
+void gen_perf_free_sample_bufs(struct gen_perf_context *perf_ctx);
 
 
 #endif /* GEN_PERF_H */
index f60f031..6a8a3e4 100644 (file)
@@ -144,20 +144,6 @@ dump_perf_queries(struct brw_context *brw)
    _mesa_HashWalk(ctx->PerfQuery.Objects, dump_perf_query_callback, brw);
 }
 
-/******************************************************************************/
-
-static void
-free_sample_bufs(struct brw_context *brw)
-{
-   foreach_list_typed_safe(struct oa_sample_buf, buf, link,
-                           &brw->perf_ctx.free_sample_buffers)
-      ralloc_free(buf);
-
-   exec_list_make_empty(&brw->perf_ctx.free_sample_buffers);
-}
-
-/******************************************************************************/
-
 /**
  * Driver hook for glGetPerfQueryInfoINTEL().
  */
@@ -1393,7 +1379,7 @@ brw_delete_perf_query(struct gl_context *ctx,
     * buffers and close any current i915-perf stream.
     */
    if (--brw->perf_ctx.n_query_instances == 0) {
-      free_sample_bufs(brw);
+      gen_perf_free_sample_bufs(&brw->perf_ctx);
       close_perf(brw, obj->query);
    }