intel/perf: make pipeline statistic query loading optional
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Wed, 4 Sep 2019 14:05:47 +0000 (17:05 +0300)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Wed, 20 May 2020 11:02:27 +0000 (14:02 +0300)
On Vulkan most of those are already covered by standard queries so
add the ability to skip them.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2775>

src/gallium/drivers/iris/iris_monitor.c
src/gallium/drivers/iris/iris_performance_query.c
src/intel/perf/gen_perf.c
src/intel/perf/gen_perf.h
src/intel/vulkan/anv_perf.c
src/mesa/drivers/dri/i965/brw_performance_query.c

index f2c0774b1c3f387887895d025f45cfef79c387f1..c4194052defaf7a749a0ebc506d80f7705d05143 100644 (file)
@@ -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"
index 825f4c442684e5b362eb3fe27dcc221d5f1e1663..dbe649c27628891b7cc4a47be23d91d8a72edac5 100644 (file)
@@ -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;
 }
index 189f71f6575f5f370ea9009ebbe9b68e3e5f309e..169bdd211e0e039e92c194711988f0fecb3efd96 100644 (file)
@@ -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);
 }
index a390916583819899568dbf818f4fcc8738585343..3f933a664fad561716e872730070beeb984377cb 100644 (file)
@@ -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.
  */
index 9ee54a8c2a47659a59e44447de482a755d9c265b..133315b2c8d45b021cbf558a2a1d1e96ea7912c1 100644 (file)
@@ -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.
index cc531d97ff738afe11f1fda94d2cbf4f89e306bd..ab2f200a1faa4784c8d2e44ac39ba19213d1b827 100644 (file)
@@ -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;
 }