i965: Expose OA counters via INTEL_performance_query
authorRobert Bragg <robert@sixbynine.org>
Thu, 4 Jun 2015 21:42:38 +0000 (22:42 +0100)
committerRobert Bragg <robert@sixbynine.org>
Thu, 9 Mar 2017 13:45:50 +0000 (13:45 +0000)
commit458468c136e044b8be13bfbe5a92549400c3541d
tree970c266d2a128a0c0824bfa19063b8f096c0be6f
parenta98ffe24772e041687ae1e5706951a7d630ee35b
i965: Expose OA counters via INTEL_performance_query

This adds support for exposing basic Observation Architecture
performance counters on Haswell.

This support is based on the i915 perf kernel interface which is used
to configure the OA unit, allowing Mesa to emit MI_REPORT_PERF_COUNT
commands around queries to collect counter snapshots.

To take into account the small chance that some of the 32bit counters
could wrap around for long queries (~50 milliseconds for a GT3 Haswell @
1.1GHz) the implementation also collects periodic metrics.

Signed-off-by: Robert Bragg <robert@sixbynine.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_performance_query.c