i965: perf: query topology
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Wed, 21 Feb 2018 19:15:46 +0000 (19:15 +0000)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Thu, 22 Mar 2018 20:14:22 +0000 (20:14 +0000)
commit57a11550bc6195c404496e4278920ea63a343f08
tree86e49b4c8d3677007c85aad8ea98dd762ef81e66
parentc1900f5b0fb7a6f22a13f67e2645f3754b5df245
i965: perf: query topology

With the introduction of asymmetric slices in CNL, we cannot rely on
the previous SUBSLICE_MASK getparam to tell userspace what subslices
are available.

We introduce a new uAPI in the kernel driver to report exactly what
part of the GPU are fused and require this to be available on Gen10+.

Prior generations can continue to rely on GETPARAM on older kernels.

This patch is quite a lot of code because we have to support lots of
different kernel versions, ranging from not providing any information
(for Haswell on 4.13 through 4.17), to being able to query through
GETPARAM (for gen8/9 on 4.13 through 4.17), to finally requiring 4.17
for Gen10+.

This change stores topology information in a unified way on
brw_context.topology from the various kernel APIs. And then generates
the appropriate values for the equations from that unified topology.

v2: Move slice/subslice masks fields to gen_device_info (Rafael)

v3: Add a gen_device_info_subslice_available() helper (Lionel)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/intel/dev/gen_device_info.h
src/mesa/drivers/dri/i965/brw_performance_query.c