Mesa (master): intel/perf: specify sseu configuration when supported
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Apr 23 16:13:52 UTC 2020
Module: Mesa
Branch: master
Commit: a7998371ed0208583cdffb28a6befc1134a9a27b
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a7998371ed0208583cdffb28a6befc1134a9a27b
Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date: Mon Mar 2 14:43:30 2020 +0200
intel/perf: specify sseu configuration when supported
Because of functional requirements for Gen11, when perf is enabled we
only power half the EU array.
This change forces it to enable everything.
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 | 5 -----
src/intel/perf/gen_perf_private.h | 5 +++++
src/intel/perf/gen_perf_query.c | 10 +++++++++-
3 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/src/intel/perf/gen_perf.c b/src/intel/perf/gen_perf.c
index 43e14a2accb..189f71f6575 100644
--- a/src/intel/perf/gen_perf.c
+++ b/src/intel/perf/gen_perf.c
@@ -54,11 +54,6 @@
#define OA_REPORT_INVALID_CTX_ID (0xffffffff)
-static inline uint64_t to_user_pointer(void *ptr)
-{
- return (uintptr_t) ptr;
-}
-
static bool
is_dir_or_link(const struct dirent *entry, const char *parent_dir)
{
diff --git a/src/intel/perf/gen_perf_private.h b/src/intel/perf/gen_perf_private.h
index 3dc3461cbf3..ac222d53727 100644
--- a/src/intel/perf/gen_perf_private.h
+++ b/src/intel/perf/gen_perf_private.h
@@ -26,6 +26,11 @@
#include "gen_perf.h"
+static inline uint64_t to_user_pointer(void *ptr)
+{
+ return (uintptr_t) ptr;
+}
+
static inline void
gen_perf_query_add_stat_reg(struct gen_perf_query_info *query, uint32_t reg,
uint32_t numerator, uint32_t denominator,
diff --git a/src/intel/perf/gen_perf_query.c b/src/intel/perf/gen_perf_query.c
index 3ad511b0e00..57b01203a6f 100644
--- a/src/intel/perf/gen_perf_query.c
+++ b/src/intel/perf/gen_perf_query.c
@@ -30,6 +30,7 @@
#include "perf/gen_perf.h"
#include "perf/gen_perf_mdapi.h"
+#include "perf/gen_perf_private.h"
#include "perf/gen_perf_query.h"
#include "perf/gen_perf_regs.h"
@@ -347,6 +348,8 @@ gen_perf_close(struct gen_perf_context *perfquery,
}
}
+#define NUM_PERF_PROPERTIES(array) (ARRAY_SIZE(array) / 2)
+
static bool
gen_perf_open(struct gen_perf_context *perf_ctx,
int metrics_set_id,
@@ -366,12 +369,17 @@ gen_perf_open(struct gen_perf_context *perf_ctx,
DRM_I915_PERF_PROP_OA_METRICS_SET, metrics_set_id,
DRM_I915_PERF_PROP_OA_FORMAT, report_format,
DRM_I915_PERF_PROP_OA_EXPONENT, period_exponent,
+
+ /* SSEU configuration */
+ DRM_I915_PERF_PROP_GLOBAL_SSEU, to_user_pointer(&perf_ctx->perf->sseu),
};
struct drm_i915_perf_open_param param = {
.flags = I915_PERF_FLAG_FD_CLOEXEC |
I915_PERF_FLAG_FD_NONBLOCK |
I915_PERF_FLAG_DISABLED,
- .num_properties = ARRAY_SIZE(properties) / 2,
+ .num_properties = perf_ctx->perf->i915_perf_version >= 4 ?
+ NUM_PERF_PROPERTIES(properties) :
+ NUM_PERF_PROPERTIES(properties) - 1,
.properties_ptr = (uintptr_t) properties,
};
int fd = gen_ioctl(drm_fd, DRM_IOCTL_I915_PERF_OPEN, ¶m);
More information about the mesa-commit
mailing list