Mesa (master): intel/perf: store default sseu configuration

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 23 16:13:52 UTC 2020


Module: Mesa
Branch: master
Commit: 8f152ed101fbf3fad3f914a19d260c3bab556c45
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8f152ed101fbf3fad3f914a19d260c3bab556c45

Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date:   Mon Mar  2 14:42:22 2020 +0200

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 at intel.com>
Acked-by: Tapani Pälli <tapani.palli at intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli at intel.com>
Reviewed-by: Mark Janes <mark.a.janes at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4021>

---

 src/intel/perf/gen_perf.c | 15 +++++++++++++++
 src/intel/perf/gen_perf.h |  5 +++++
 2 files changed, 20 insertions(+)

diff --git a/src/intel/perf/gen_perf.c b/src/intel/perf/gen_perf.c
index 1bf2424e108..43e14a2accb 100644
--- a/src/intel/perf/gen_perf.c
+++ b/src/intel/perf/gen_perf.c
@@ -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.
     */
diff --git a/src/intel/perf/gen_perf.h b/src/intel/perf/gen_perf.h
index 4f0805f2b26..a3909165838 100644
--- a/src/intel/perf/gen_perf.h
+++ b/src/intel/perf/gen_perf.h
@@ -38,6 +38,8 @@
 #include "compiler/glsl/list.h"
 #include "util/ralloc.h"
 
+#include "drm-uapi/i915_drm.h"
+
 struct gen_device_info;
 
 struct gen_perf_config;
@@ -195,6 +197,9 @@ struct gen_perf_config {
    /* Version of the i915-perf subsystem, refer to i915_drm.h. */
    int i915_perf_version;
 
+   /* Powergating configuration for the running the query. */
+   struct drm_i915_gem_context_param_sseu sseu;
+
    struct gen_perf_query_info *queries;
    int n_queries;
 



More information about the mesa-commit mailing list