intel/perf: restructure i915 perf version checks

Trying to make things more readable.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8525>
This commit is contained in:
Lionel Landwerlin
2020-09-01 13:09:04 +03:00
parent d8154c4006
commit bd7df91372
3 changed files with 49 additions and 19 deletions

View File

@@ -57,7 +57,7 @@ anv_get_perf(const struct gen_device_info *devinfo, int fd)
* perf revision 2.
*/
if (!(INTEL_DEBUG & DEBUG_NO_OACONFIG)) {
if (perf->i915_perf_version < 3)
if (!gen_perf_has_hold_preemption(perf))
goto err;
}
@@ -106,7 +106,7 @@ anv_device_perf_open(struct anv_device *device, uint64_t metric_id)
* enabled we would use only half on Gen11 because of functional
* requirements.
*/
if (device->physical->perf->i915_perf_version >= 4) {
if (gen_perf_has_global_sseu(device->physical->perf)) {
properties[p++] = DRM_I915_PERF_PROP_GLOBAL_SSEU;
properties[p++] = (uintptr_t) &device->physical->perf->sseu;
}