memcpy(config.uuid, query->guid, sizeof(config.uuid));
- config.n_mux_regs = query->n_mux_regs;
- config.mux_regs_ptr = (uintptr_t) query->mux_regs;
+ config.n_mux_regs = query->config.n_mux_regs;
+ config.mux_regs_ptr = (uintptr_t) query->config.mux_regs;
- config.n_boolean_regs = query->n_b_counter_regs;
- config.boolean_regs_ptr = (uintptr_t) query->b_counter_regs;
+ config.n_boolean_regs = query->config.n_b_counter_regs;
+ config.boolean_regs_ptr = (uintptr_t) query->config.b_counter_regs;
- config.n_flex_regs = query->n_flex_regs;
- config.flex_regs_ptr = (uintptr_t) query->flex_regs;
+ config.n_flex_regs = query->config.n_flex_regs;
+ config.flex_regs_ptr = (uintptr_t) query->config.flex_regs;
ret = gen_ioctl(fd, DRM_IOCTL_I915_PERF_ADD_CONFIG, &config);
if (ret < 0) {
uint32_t val;
};
+/* Register programming for a given query */
+struct gen_perf_configuration {
+ struct gen_perf_query_register_prog *flex_regs;
+ uint32_t n_flex_regs;
+
+ struct gen_perf_query_register_prog *mux_regs;
+ uint32_t n_mux_regs;
+
+ struct gen_perf_query_register_prog *b_counter_regs;
+ uint32_t n_b_counter_regs;
+};
+
struct gen_perf_query_info {
enum gen_perf_query_type {
GEN_PERF_QUERY_TYPE_OA,
int b_offset;
int c_offset;
- /* Register programming for a given query */
- struct gen_perf_query_register_prog *flex_regs;
- uint32_t n_flex_regs;
-
- struct gen_perf_query_register_prog *mux_regs;
- uint32_t n_mux_regs;
-
- struct gen_perf_query_register_prog *b_counter_regs;
- uint32_t n_b_counter_regs;
+ struct gen_perf_configuration config;
};
struct gen_perf_config {
c_indent(3)
for register in register_config.findall('register'):
- c("query->%s[query->n_%s++] = (struct gen_perf_query_register_prog) { .reg = %s, .val = %s };" %
+ c("query->config.%s[query->config.n_%s++] = (struct gen_perf_query_register_prog) { .reg = %s, .val = %s };" %
(t, t, register.get('address'), register.get('value')))
if availability:
.c_offset = 46,
"""))
+ c(".config = {")
+ c_indent(3)
for reg_type, reg_length in register_lengths.items():
c(".{0} = {1}_{2}_{3},".format(reg_type, gen.chipset, set.underscore_name, reg_type))
c(".n_{0} = 0, /* Determined at runtime */".format(reg_type))
+ c_outdent(3)
+ c("},")
c_outdent(3)
c("};\n")