anv: use a query filled by the perf code
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Thu, 5 Mar 2020 08:54:46 +0000 (10:54 +0200)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Wed, 20 May 2020 11:02:27 +0000 (14:02 +0300)
We're about to use the offset fields from the query object. We can't
just use a made up object.

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/intel/vulkan/genX_query.c

index be7b860adedc4fb9df1fbf69a9e7e8afa2208b77..17ccfc66dc9a3216829e2b9a33fc87eda46f7fb3 100644 (file)
@@ -376,11 +376,6 @@ VkResult genX(GetQueryPoolResults)(
          const uint32_t *rpstat_begin = query_data + intel_perf_rpstart_offset(false);
          const uint32_t *rpstat_end = query_data + intel_perf_mi_rpc_offset(true);
          struct gen_perf_query_result result;
-         struct gen_perf_query_info metric = {
-            .oa_format = (GEN_GEN >= 8 ?
-                          I915_OA_FORMAT_A32u40_A4u32_B8_C8 :
-                          I915_OA_FORMAT_A45_B8_C8),
-         };
          uint32_t core_freq[2];
 #if GEN_GEN < 9
          core_freq[0] = ((*rpstat_begin >> 7) & 0x7f) * 1000000ULL;
@@ -390,7 +385,7 @@ VkResult genX(GetQueryPoolResults)(
          core_freq[1] = ((*rpstat_end >> 23) & 0x1ff) * 1000000ULL;
 #endif
          gen_perf_query_result_clear(&result);
-         gen_perf_query_result_accumulate(&result, &metric,
+         gen_perf_query_result_accumulate(&result, &device->physical->perf->queries[0],
                                           oa_begin, oa_end);
          gen_perf_query_result_read_frequencies(&result, &device->info,
                                                 oa_begin, oa_end);