intel/perf: fix calculation of used counter space

It matters only when counters are not ordered by offset.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5788>
This commit is contained in:
Marcin Ślusarz 2020-06-10 15:29:53 +02:00 committed by Marge Bot
parent 6d988ad4a2
commit e7e6f70938

View file

@ -1469,7 +1469,9 @@ get_oa_counter_data(struct gen_perf_context *perf_ctx,
/* So far we aren't using uint32, double or bool32... */
unreachable("unexpected counter data type");
}
written = counter->offset + counter_size;
if (counter->offset + counter_size > written)
written = counter->offset + counter_size;
}
}