anv: disable perf queries on non RCS engines
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Thu, 9 Jun 2022 18:17:01 +0000 (21:17 +0300)
committerMarge Bot <emma+marge@anholt.net>
Thu, 23 Jun 2022 22:47:37 +0000 (22:47 +0000)
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17015>

src/intel/vulkan/anv_perf.c

index 975b294..1e5ca0c 100644 (file)
@@ -357,6 +357,15 @@ VkResult anv_EnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(
    VK_OUTARRAY_MAKE_TYPED(VkPerformanceCounterDescriptionKHR, out_desc,
                           pCounterDescriptions, &desc_count);
 
+   /* We cannot support performance queries on anything other than RCS,
+    * because the MI_REPORT_PERF_COUNT command is not available on other
+    * engines.
+    */
+   struct anv_queue_family *queue_family =
+      &pdevice->queue.families[queueFamilyIndex];
+   if (queue_family->engine_class != I915_ENGINE_CLASS_RENDER)
+      return vk_outarray_status(&out);
+
    for (int c = 0; c < (perf ? perf->n_counters : 0); c++) {
       const struct intel_perf_query_counter *intel_counter = perf->counter_infos[c].counter;