mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 04:30:10 +01:00
intel/perf: fix roll over PERF_CNT counter accumulation
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 5ba6d9941b ("intel/perf: add mdapi writes for register perf counters")
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9163>
This commit is contained in:
parent
018393d851
commit
8b44e45347
1 changed files with 6 additions and 2 deletions
|
|
@ -1144,8 +1144,12 @@ gen_perf_query_result_read_perfcnts(struct gen_perf_query_result *result,
|
|||
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);
|
||||
uint64_t v0 = start[i] & PERF_CNT_VALUE_MASK;
|
||||
uint64_t v1 = end[i] & PERF_CNT_VALUE_MASK;
|
||||
|
||||
result->accumulator[query->perfcnt_offset + i] = v0 > v1 ?
|
||||
(PERF_CNT_VALUE_MASK + 1 + v1 - v0) :
|
||||
(v1 - v0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue