From f57c8a6dc110e7701233f159ce166c63ea75ff5f Mon Sep 17 00:00:00 2001 From: Mark Janes Date: Wed, 26 Jun 2019 11:38:38 -0700 Subject: [PATCH] intel/perf: create a vtable entry for emit_mi_flush This method is needed to move subsequent methods into perf. Reviewed-by: Kenneth Graunke --- src/intel/perf/gen_perf.h | 1 + src/mesa/drivers/dri/i965/brw_performance_query.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/intel/perf/gen_perf.h b/src/intel/perf/gen_perf.h index 3606748c424..6e69278ccdf 100644 --- a/src/intel/perf/gen_perf.h +++ b/src/intel/perf/gen_perf.h @@ -217,6 +217,7 @@ struct gen_perf_config { struct { void *(*bo_alloc)(void *bufmgr, const char *name, uint64_t size); void (*bo_unreference)(void *bo); + void (*emit_mi_flush)(void *ctx); void (*emit_mi_report_perf_count)(void *ctx, void *bo, uint32_t offset_in_bytes, diff --git a/src/mesa/drivers/dri/i965/brw_performance_query.c b/src/mesa/drivers/dri/i965/brw_performance_query.c index 63752e5eaca..770dcb4a9c6 100644 --- a/src/mesa/drivers/dri/i965/brw_performance_query.c +++ b/src/mesa/drivers/dri/i965/brw_performance_query.c @@ -795,7 +795,7 @@ brw_begin_perf_query(struct gl_context *ctx, * This is our Begin synchronization point to drain current work on the * GPU before we capture our first counter snapshot... */ - brw_emit_mi_flush(brw); + perf_cfg->vtbl.emit_mi_flush(brw); switch (query->kind) { case GEN_PERF_QUERY_TYPE_OA: @@ -1004,7 +1004,7 @@ brw_end_perf_query(struct gl_context *ctx, * For more details see comment in brw_begin_perf_query for * corresponding flush. */ - brw_emit_mi_flush(brw); + perf_cfg->vtbl.emit_mi_flush(brw); switch (obj->queryinfo->kind) { case GEN_PERF_QUERY_TYPE_OA: @@ -1542,6 +1542,7 @@ brw_oa_emit_mi_report_perf_count(void *c, typedef void (*bo_unreference_t)(void *); typedef void (* emit_mi_report_t)(void *, void *, uint32_t, uint32_t); +typedef void (*emit_mi_flush_t)(void *); static void brw_oa_batchbuffer_flush(void *c, const char *file, int line) @@ -1570,6 +1571,7 @@ brw_init_perf_query_info(struct gl_context *ctx) perf_cfg->vtbl.bo_alloc = brw_oa_bo_alloc; perf_cfg->vtbl.bo_unreference = (bo_unreference_t)brw_bo_unreference; + perf_cfg->vtbl.emit_mi_flush = (emit_mi_flush_t)brw_emit_mi_flush; perf_cfg->vtbl.emit_mi_report_perf_count = (emit_mi_report_t)brw_oa_emit_mi_report_perf_count; perf_cfg->vtbl.batchbuffer_flush = brw_oa_batchbuffer_flush; -- 2.30.2