intel/perf: store default sseu configuration

This is the powergating configuration of the EU array. The default is
everything powered.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
Reviewed-by: Mark Janes <mark.a.janes@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4021>
This commit is contained in:
Lionel Landwerlin
2020-03-02 14:42:22 +02:00
committed by Marge Bot
parent ea8cb79742
commit 8f152ed101
2 changed files with 20 additions and 0 deletions

View File

@@ -559,6 +559,18 @@ i915_perf_version(int drm_fd)
return ret < 0 ? 0 : tmp;
}
static void
i915_get_sseu(int drm_fd, struct drm_i915_gem_context_param_sseu *sseu)
{
struct drm_i915_gem_context_param arg = {
.param = I915_CONTEXT_PARAM_SSEU,
.size = sizeof(*sseu),
.value = to_user_pointer(sseu)
};
gen_ioctl(drm_fd, DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM, &arg);
}
static bool
load_oa_metrics(struct gen_perf_config *perf, int fd,
const struct gen_device_info *devinfo)
@@ -570,6 +582,9 @@ load_oa_metrics(struct gen_perf_config *perf, int fd,
perf->i915_query_supported = i915_query_perf_config_supported(perf, fd);
perf->i915_perf_version = i915_perf_version(fd);
/* Record the default SSEU configuration. */
i915_get_sseu(fd, &perf->sseu);
/* The existence of this sysctl parameter implies the kernel supports
* the i915 perf interface.
*/