From a7998371ed0208583cdffb28a6befc1134a9a27b Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Mon, 2 Mar 2020 14:43:30 +0200 Subject: [PATCH] intel/perf: specify sseu configuration when supported MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Acked-by: Tapani Pälli Reviewed-by: Rafael Antognolli Reviewed-by: Mark Janes Reviewed-by: Kenneth Graunke Part-of: --- 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); -- 2.30.2