From: Marcin Ślusarz Date: Wed, 10 Jun 2020 13:29:53 +0000 (+0200) Subject: intel/perf: fix calculation of used counter space X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e7e6f709389be9744841d42dade3fcee8e8c6a30;p=mesa.git intel/perf: fix calculation of used counter space It matters only when counters are not ordered by offset. Signed-off-by: Marcin Ślusarz Reviewed-by: Lionel Landwerlin Part-of: --- diff --git a/src/intel/perf/gen_perf_query.c b/src/intel/perf/gen_perf_query.c index 57b01203a6f..755ec9a83dd 100644 --- a/src/intel/perf/gen_perf_query.c +++ b/src/intel/perf/gen_perf_query.c @@ -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; } }