diff options
author | Lionel Landwerlin <[email protected]> | 2018-03-14 15:44:56 +0000 |
---|---|---|
committer | Lionel Landwerlin <[email protected]> | 2018-03-22 20:14:22 +0000 |
commit | c1900f5b0fb7a6f22a13f67e2645f3754b5df245 (patch) | |
tree | fba566e29ff7954a161e0e29e9015f2a9d3b39f9 /src/intel/dev/gen_device_info.h | |
parent | 2d26c9993389a8eb8f7125e2440a2e7c5729a405 (diff) |
intel: devinfo: add helper functions to fill fusing masks values
There are a couple of ways we can get the fusing information from the
kernel :
- Through DRM_I915_GETPARAM with the SLICE_MASK/SUBSLICE_MASK
parameters
- Through the new DRM_IOCTL_I915_QUERY by requesting the
DRM_I915_QUERY_TOPOLOGY_INFO
The second method is more accurate and also gives us the EUs fusing
masks. It's also a requirement for CNL as this platform has asymetric
subslices and the first method SUBSLICE_MASK value is assumed uniform
across slices.
v2: Change gen_device_info_update_from_masks() to generate topology
and call into gen_device_info_update_from_topology (Lionel/Ken)
Signed-off-by: Lionel Landwerlin <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/intel/dev/gen_device_info.h')
-rw-r--r-- | src/intel/dev/gen_device_info.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/intel/dev/gen_device_info.h b/src/intel/dev/gen_device_info.h index 793ce094850..4d08f0dfedd 100644 --- a/src/intel/dev/gen_device_info.h +++ b/src/intel/dev/gen_device_info.h @@ -34,6 +34,8 @@ extern "C" { #endif +struct drm_i915_query_topology_info; + #define GEN_DEVICE_MAX_SLICES (6) /* Maximum on gen10 */ #define GEN_DEVICE_MAX_SUBSLICES (8) /* Maximum on gen11 */ #define GEN_DEVICE_MAX_EUS_PER_SUBSLICE (10) /* Maximum on Haswell */ @@ -121,7 +123,9 @@ struct gen_device_info unsigned num_subslices[GEN_DEVICE_MAX_SUBSLICES]; /** - * Number of EU per subslice. + * Upper bound of number of EU per subslice (some SKUs might have just 1 EU + * fused across all subslices, like 47 EUs, in which case this number won't + * be acurate for one subslice). */ unsigned num_eu_per_subslice; @@ -248,6 +252,15 @@ int gen_device_name_to_pci_device_id(const char *name); bool gen_get_device_info(int devid, struct gen_device_info *devinfo); const char *gen_get_device_name(int devid); +/* Used with SLICE_MASK/SUBSLICE_MASK values from DRM_I915_GETPARAM. */ +void gen_device_info_update_from_masks(struct gen_device_info *devinfo, + uint32_t slice_mask, + uint32_t subslice_mask, + uint32_t n_eus); +/* Used with DRM_IOCTL_I915_QUERY & DRM_I915_QUERY_TOPOLOGY_INFO. */ +void gen_device_info_update_from_topology(struct gen_device_info *devinfo, + const struct drm_i915_query_topology_info *topology); + #ifdef __cplusplus } #endif |