From 8b8eaa84a3e80d1df1c2467dc31432824cffd610 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Wed, 4 Sep 2019 17:05:47 +0300 Subject: [PATCH] intel/perf: make pipeline statistic query loading optional On Vulkan most of those are already covered by standard queries so add the ability to skip them. Signed-off-by: Lionel Landwerlin Reviewed-by: Jason Ekstrand Part-of: --- src/gallium/drivers/iris/iris_monitor.c | 3 ++- src/gallium/drivers/iris/iris_performance_query.c | 2 +- src/intel/perf/gen_perf.c | 9 ++++++--- src/intel/perf/gen_perf.h | 3 ++- src/intel/vulkan/anv_perf.c | 2 +- src/mesa/drivers/dri/i965/brw_performance_query.c | 3 ++- 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/gallium/drivers/iris/iris_monitor.c b/src/gallium/drivers/iris/iris_monitor.c index f2c0774b1c3..c4194052def 100644 --- a/src/gallium/drivers/iris/iris_monitor.c +++ b/src/gallium/drivers/iris/iris_monitor.c @@ -109,7 +109,8 @@ iris_monitor_init_metrics(struct iris_screen *screen) iris_perf_init_vtbl(perf_cfg); - gen_perf_init_metrics(perf_cfg, &screen->devinfo, screen->fd); + gen_perf_init_metrics(perf_cfg, &screen->devinfo, screen->fd, + true /* pipeline stats*/); screen->monitor_cfg = monitor_cfg; /* a gallium "group" is equivalent to a gen "query" diff --git a/src/gallium/drivers/iris/iris_performance_query.c b/src/gallium/drivers/iris/iris_performance_query.c index 825f4c44268..dbe649c2762 100644 --- a/src/gallium/drivers/iris/iris_performance_query.c +++ b/src/gallium/drivers/iris/iris_performance_query.c @@ -73,7 +73,7 @@ iris_init_perf_query_info(struct pipe_context *pipe) ice->batches[IRIS_BATCH_RENDER].hw_ctx_id, screen->fd); - gen_perf_init_metrics(perf_cfg, &screen->devinfo, screen->fd); + gen_perf_init_metrics(perf_cfg, &screen->devinfo, screen->fd, true /* pipeline_statistics */); return perf_cfg->n_queries; } diff --git a/src/intel/perf/gen_perf.c b/src/intel/perf/gen_perf.c index 189f71f6575..169bdd211e0 100644 --- a/src/intel/perf/gen_perf.c +++ b/src/intel/perf/gen_perf.c @@ -847,10 +847,13 @@ gen_perf_query_result_clear(struct gen_perf_query_result *result) void gen_perf_init_metrics(struct gen_perf_config *perf_cfg, const struct gen_device_info *devinfo, - int drm_fd) + int drm_fd, + bool include_pipeline_statistics) { - load_pipeline_statistic_metrics(perf_cfg, devinfo); - gen_perf_register_mdapi_statistic_query(perf_cfg, devinfo); + if (include_pipeline_statistics) { + load_pipeline_statistic_metrics(perf_cfg, devinfo); + gen_perf_register_mdapi_statistic_query(perf_cfg, devinfo); + } if (load_oa_metrics(perf_cfg, drm_fd, devinfo)) gen_perf_register_mdapi_oa_query(perf_cfg, devinfo); } diff --git a/src/intel/perf/gen_perf.h b/src/intel/perf/gen_perf.h index a3909165838..3f933a664fa 100644 --- a/src/intel/perf/gen_perf.h +++ b/src/intel/perf/gen_perf.h @@ -252,7 +252,8 @@ struct gen_perf_config { void gen_perf_init_metrics(struct gen_perf_config *perf_cfg, const struct gen_device_info *devinfo, - int drm_fd); + int drm_fd, + bool include_pipeline_statistics); /** Query i915 for a metric id using guid. */ diff --git a/src/intel/vulkan/anv_perf.c b/src/intel/vulkan/anv_perf.c index 9ee54a8c2a4..133315b2c8d 100644 --- a/src/intel/vulkan/anv_perf.c +++ b/src/intel/vulkan/anv_perf.c @@ -35,7 +35,7 @@ anv_get_perf(const struct gen_device_info *devinfo, int fd) { struct gen_perf_config *perf = gen_perf_new(NULL); - gen_perf_init_metrics(perf, devinfo, fd); + gen_perf_init_metrics(perf, devinfo, fd, false /* pipeline statistics */); /* We need DRM_I915_PERF_PROP_HOLD_PREEMPTION support, only available in * perf revision 2. diff --git a/src/mesa/drivers/dri/i965/brw_performance_query.c b/src/mesa/drivers/dri/i965/brw_performance_query.c index cc531d97ff7..ab2f200a1fa 100644 --- a/src/mesa/drivers/dri/i965/brw_performance_query.c +++ b/src/mesa/drivers/dri/i965/brw_performance_query.c @@ -506,7 +506,8 @@ brw_init_perf_query_info(struct gl_context *ctx) gen_perf_init_context(perf_ctx, perf_cfg, brw, brw->bufmgr, devinfo, brw->hw_ctx, brw->screen->fd); - gen_perf_init_metrics(perf_cfg, devinfo, brw->screen->fd); + gen_perf_init_metrics(perf_cfg, devinfo, brw->screen->fd, + true /* pipeline stats */); return perf_cfg->n_queries; } -- 2.30.2