Mesa (master): i965: perf: add mdapi pipeline statistics queries on gen10/11

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Apr 17 13:15:42 UTC 2019


Module: Mesa
Branch: master
Commit: a646485c28b95ce8a6a61d61c2afaeefcdf439a4
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a646485c28b95ce8a6a61d61c2afaeefcdf439a4

Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date:   Mon Jun 18 11:40:24 2018 +0100

i965: perf: add mdapi pipeline statistics queries on gen10/11

The Gen10+ expected format adds an additional counter which we can't
disclose yet. We can still make the size of the expected query result
match.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Reviewed-by: Mark Janes <mark.a.janes at intel.com>

---

 src/intel/perf/gen_perf_mdapi.h                         |  1 +
 src/mesa/drivers/dri/i965/brw_performance_query_mdapi.c | 10 +++++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/intel/perf/gen_perf_mdapi.h b/src/intel/perf/gen_perf_mdapi.h
index 45fe171b030..3c3aec2c64e 100644
--- a/src/intel/perf/gen_perf_mdapi.h
+++ b/src/intel/perf/gen_perf_mdapi.h
@@ -124,6 +124,7 @@ struct mdapi_pipeline_metrics {
    uint64_t HSInvocations;
    uint64_t DSInvocations;
    uint64_t CSInvocations;
+   uint64_t Reserved1; /* Gen10+ */
 };
 
 int gen_perf_query_result_write_mdapi(void *data, uint32_t data_size,
diff --git a/src/mesa/drivers/dri/i965/brw_performance_query_mdapi.c b/src/mesa/drivers/dri/i965/brw_performance_query_mdapi.c
index d95a9638731..f77560390d7 100644
--- a/src/mesa/drivers/dri/i965/brw_performance_query_mdapi.c
+++ b/src/mesa/drivers/dri/i965/brw_performance_query_mdapi.c
@@ -207,7 +207,7 @@ brw_perf_query_register_mdapi_statistic_query(struct brw_context *brw)
 {
    const struct gen_device_info *devinfo = &brw->screen->devinfo;
 
-   if (!(devinfo->gen >= 7 && devinfo->gen <= 9))
+   if (!(devinfo->gen >= 7 && devinfo->gen <= 11))
       return;
 
    struct gen_perf_query_info *query =
@@ -248,5 +248,13 @@ brw_perf_query_register_mdapi_statistic_query(struct brw_context *brw)
                                              "N compute shader invocations");
    }
 
+   if (devinfo->gen >= 10) {
+      /* Reuse existing CS invocation register until we can expose this new
+       * one.
+       */
+      gen_perf_query_info_add_basic_stat_reg(query, CS_INVOCATION_COUNT,
+                                             "Reserved1");
+   }
+
    query->data_size = sizeof(uint64_t) * query->n_counters;
 }




More information about the mesa-commit mailing list