Mesa (master): intel/perf: fix calculation of used counter space
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Aug 10 14:00:43 UTC 2020
Module: Mesa
Branch: master
Commit: e7e6f709389be9744841d42dade3fcee8e8c6a30
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e7e6f709389be9744841d42dade3fcee8e8c6a30
Author: Marcin Ślusarz <marcin.slusarz at intel.com>
Date: Wed Jun 10 15:29:53 2020 +0200
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 at intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5788>
---
src/intel/perf/gen_perf_query.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
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;
}
}
More information about the mesa-commit
mailing list