intel/perf: Add and use a function to return platform OA format

The platform version check to return the OA format was duplicated
in a few places, so adding a function and dropping this duplication.

While at it, already making it future proof for Xe KMD support and
split i915 specific code to its own file.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29077>
This commit is contained in:
José Roberto de Souza
2024-05-03 13:07:46 -07:00
committed by Marge Bot
parent b98538d54c
commit d27dcb815e
9 changed files with 53 additions and 13 deletions

View File

@@ -0,0 +1,20 @@
/*
* Copyright 2024 Intel Corporation
* SPDX-License-Identifier: MIT
*/
#include "perf/i915/intel_perf.h"
#include "perf/intel_perf.h"
#include "drm-uapi/i915_drm.h"
uint64_t i915_perf_get_oa_format(struct intel_perf_config *perf)
{
if (perf->devinfo->verx10 <= 75)
return I915_OA_FORMAT_A45_B8_C8;
else if (perf->devinfo->verx10 <= 120)
return I915_OA_FORMAT_A32u40_A4u32_B8_C8;
else
return I915_OA_FORMAT_A24u40_A14u32_B8_C8;
}