intel/perf: prep work to enable new perf counters

Those are not part of the OA reports and need some additional
scaffolding. Those counters are only available when doing queries as
we need to emit MI_SRMs to record them.

Equations making use of those counters are not there yet, they will
come in a follow up commit updating a bunch of oa-*.xml files.

v2: Fix typo

v3: Use PERF_CNT_VALUE_MASK (Marcin)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6518>
This commit is contained in:
Lionel Landwerlin
2019-07-04 20:34:28 +03:00
committed by Marge Bot
parent 969f6efbc2
commit a6e980e9bf
8 changed files with 72 additions and 61 deletions

View File

@@ -423,6 +423,7 @@ init_oa_sys_vars(struct gen_perf_config *perf, const struct gen_device_info *dev
perf->sys_vars.gt_max_freq = max_freq_mhz * 1000000;
perf->sys_vars.timestamp_frequency = devinfo->timestamp_frequency;
perf->sys_vars.revision = devinfo->revision;
perf->sys_vars.query_mode = true;
compute_topology_builtins(perf, devinfo);
return true;
@@ -1117,6 +1118,18 @@ gen_perf_query_result_read_gt_frequency(struct gen_perf_query_result *result,
result->gt_frequency[1] *= 1000000ULL;
}
void
gen_perf_query_result_read_perfcnts(struct gen_perf_query_result *result,
const struct gen_perf_query_info *query,
const uint64_t *start,
const uint64_t *end)
{
for (uint32_t i = 0; i < 2; i++) {
result->accumulator[query->perfcnt_offset + i] =
(end[i] & PERF_CNT_VALUE_MASK) - (start[i] & PERF_CNT_VALUE_MASK);
}
}
void
gen_perf_query_result_clear(struct gen_perf_query_result *result)
{