intel/perf: Fix OA report accumulation on Gfx12+.
authorFrancisco Jerez <currojerez@riseup.net>
Mon, 4 Apr 2022 22:45:54 +0000 (15:45 -0700)
committerMarge Bot <emma+marge@anholt.net>
Tue, 12 Apr 2022 00:11:47 +0000 (00:11 +0000)
commite858da39e54ed34712ae044d80bcc23c398b53f3
treecfcc3b9823c2f0c8cda28d9306452be29371b4b6
parent6f98dc535a94107a6db069e04933af7c951cab27
intel/perf: Fix OA report accumulation on Gfx12+.

The intel_perf_query path used for performance queries on GL was
passing a bogus "end" pointer to intel_perf_query_result_accumulate(),
causing it to accumulate garbage values.  This was causing the values
of many performance counters to be corrupted.

The "end" pointer was incorrect because the current code was assuming
that different OA reports were located TOTAL_QUERY_DATA_SIZE bytes
apart, which is a hard-coded preprocessor define.  However recent
(Gfx12+) hardware generations use a variable query size determined by
the query layout.  Use the size derived from it instead, and remove
the stale define.

Fixes: 3c513250255d6a ("intel/perf: switch query code to use query layout")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15783>
src/intel/perf/intel_perf_query.c