From 4b2c8852070232927ddc1a38c8a6f3c7f4c1e1fd Mon Sep 17 00:00:00 2001 From: Mark Janes Date: Mon, 3 Jun 2019 16:16:40 -0700 Subject: [PATCH] intel/perf: move free_sample_bufs into perf Reviewed-by: Kenneth Graunke --- src/intel/perf/gen_perf.c | 10 ++++++++++ src/intel/perf/gen_perf.h | 1 + .../drivers/dri/i965/brw_performance_query.c | 16 +--------------- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/intel/perf/gen_perf.c b/src/intel/perf/gen_perf.c index 9df94512dc6..4a3546cb1ec 100644 --- a/src/intel/perf/gen_perf.c +++ b/src/intel/perf/gen_perf.c @@ -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); +} diff --git a/src/intel/perf/gen_perf.h b/src/intel/perf/gen_perf.h index a41414a662c..09f4ae1da64 100644 --- a/src/intel/perf/gen_perf.h +++ b/src/intel/perf/gen_perf.h @@ -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 */ diff --git a/src/mesa/drivers/dri/i965/brw_performance_query.c b/src/mesa/drivers/dri/i965/brw_performance_query.c index f60f0317bf1..6a8a3e4fb83 100644 --- a/src/mesa/drivers/dri/i965/brw_performance_query.c +++ b/src/mesa/drivers/dri/i965/brw_performance_query.c @@ -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); } -- 2.30.2