summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMark Janes <[email protected]>2019-06-03 16:16:40 -0700
committerMark Janes <[email protected]>2019-08-07 21:33:55 -0700
commit4b2c8852070232927ddc1a38c8a6f3c7f4c1e1fd (patch)
tree982e602edcc41b07875c1c153b589b2b320a31e9 /src
parent2f712d21b9913833462031c0a3c52bcf90046e15 (diff)
intel/perf: move free_sample_bufs into perf
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/intel/perf/gen_perf.c10
-rw-r--r--src/intel/perf/gen_perf.h1
-rw-r--r--src/mesa/drivers/dri/i965/brw_performance_query.c16
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);
}