intel/perf: create a vtable entry for emit_mi_flush
authorMark Janes <mark.a.janes@intel.com>
Wed, 26 Jun 2019 18:38:38 +0000 (11:38 -0700)
committerMark Janes <mark.a.janes@intel.com>
Thu, 8 Aug 2019 04:33:55 +0000 (21:33 -0700)
This method is needed to move subsequent methods into perf.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/intel/perf/gen_perf.h
src/mesa/drivers/dri/i965/brw_performance_query.c

index 3606748c4245fde7190fb15b78ac180093666629..6e69278ccdfd36d53d0008ab3996b338297587e9 100644 (file)
@@ -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,
index 63752e5eacabf20291c308daa94c707a8f715003..770dcb4a9c6e0c5c3b52eef3b700f378c1e1b733 100644 (file)
@@ -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;