anv: force whole EU array to be powered for perf queries
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Mon, 2 Mar 2020 12:44:55 +0000 (14:44 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 23 Apr 2020 15:55:59 +0000 (15:55 +0000)
Because of functional requirements for Gen11, when perf is enabled we
only power half the EU array.

This change forces it to enable everything.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Mark Janes <mark.a.janes@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4021>

src/intel/vulkan/anv_perf.c

index 5c8fd5288b22c39c52ff7b69c94184333663b851..9ee54a8c2a47659a59e44447de482a755d9c265b 100644 (file)
@@ -83,6 +83,16 @@ anv_device_perf_open(struct anv_device *device, uint64_t metric_id)
    properties[p++] = DRM_I915_PERF_PROP_HOLD_PREEMPTION;
    properties[p++] = true;
 
+   /* If global SSEU is available, pin it to the default. This will ensure on
+    * Gen11 for instance we use the full EU array. Initially when perf was
+    * enabled we would use only half on Gen11 because of functional
+    * requirements.
+    */
+   if (device->physical->perf->i915_perf_version >= 4) {
+      properties[p++] = DRM_I915_PERF_PROP_GLOBAL_SSEU;
+      properties[p++] = (uintptr_t) &device->physical->perf->sseu;
+   }
+
    memset(&param, 0, sizeof(param));
    param.flags = 0;
    param.flags |= I915_PERF_FLAG_FD_CLOEXEC | I915_PERF_FLAG_FD_NONBLOCK;