Lines Matching defs:oa_config
388 struct i915_oa_config *oa_config;
398 struct i915_oa_config *oa_config =
399 container_of(ref, typeof(*oa_config), ref);
401 kfree(oa_config->flex_regs);
402 kfree(oa_config->b_counter_regs);
403 kfree(oa_config->mux_regs);
405 kfree_rcu(oa_config, rcu);
411 struct i915_oa_config *oa_config;
414 oa_config = idr_find(&perf->metrics_idr, metrics_set);
415 if (oa_config)
416 oa_config = i915_oa_config_get(oa_config);
419 return oa_config;
424 i915_oa_config_put(oa_bo->oa_config);
1665 i915_oa_config_put(stream->oa_config);
2223 struct i915_oa_config *oa_config)
2236 config_length += num_lri_dwords(oa_config->mux_regs_len);
2237 config_length += num_lri_dwords(oa_config->b_counter_regs_len);
2238 config_length += num_lri_dwords(oa_config->flex_regs_len);
2261 oa_config->mux_regs,
2262 oa_config->mux_regs_len);
2264 oa_config->b_counter_regs,
2265 oa_config->b_counter_regs_len);
2267 oa_config->flex_regs,
2268 oa_config->flex_regs_len);
2288 oa_bo->oa_config = i915_oa_config_get(oa_config);
2310 get_oa_vma(struct i915_perf_stream *stream, struct i915_oa_config *oa_config)
2319 if (oa_bo->oa_config == oa_config &&
2320 memcmp(oa_bo->oa_config->uuid,
2321 oa_config->uuid,
2322 sizeof(oa_config->uuid)) == 0)
2326 oa_bo = alloc_oa_config_buffer(stream, oa_config);
2336 struct i915_oa_config *oa_config,
2345 vma = get_oa_vma(stream, oa_config);
2432 stream->oa_config, oa_context(stream),
2448 static u32 oa_config_flex_reg(const struct i915_oa_config *oa_config,
2459 if (!oa_config)
2462 for (i = 0; i < oa_config->flex_regs_len; i++) {
2463 if (i915_mmio_reg_offset(oa_config->flex_regs[i].addr) == mmio)
2464 return oa_config->flex_regs[i].value;
2502 oa_config_flex_reg(stream->oa_config, flex_regs[i]);
2786 const struct i915_oa_config *oa_config,
2819 regs[i].value = oa_config_flex_reg(oa_config, regs[i].reg);
2831 struct i915_oa_config *oa_config = stream->oa_config;
2868 ret = lrc_configure_all_contexts(stream, oa_config, active);
2873 stream->oa_config, oa_context(stream),
2945 stream->oa_config, oa_context(stream),
3355 stream->oa_config = i915_perf_get_oa_config(perf, props->metrics_set);
3356 if (!stream->oa_config) {
3415 stream->oa_config->uuid);
3672 long ret = stream->oa_config->id;
3678 if (config != stream->oa_config) {
3692 config = xchg(&stream->oa_config, config);
4614 struct i915_oa_config *oa_config =
4615 container_of(attr, typeof(*oa_config), sysfs_metric_id);
4617 return sprintf(buf, "%d\n", oa_config->id);
4621 struct i915_oa_config *oa_config)
4623 sysfs_attr_init(&oa_config->sysfs_metric_id.attr);
4624 oa_config->sysfs_metric_id.attr.name = "id";
4625 oa_config->sysfs_metric_id.attr.mode = S_IRUGO;
4626 oa_config->sysfs_metric_id.show = show_dynamic_id;
4627 oa_config->sysfs_metric_id.store = NULL;
4629 oa_config->attrs[0] = &oa_config->sysfs_metric_id.attr;
4630 oa_config->attrs[1] = NULL;
4632 oa_config->sysfs_metric.name = oa_config->uuid;
4633 oa_config->sysfs_metric.attrs = oa_config->attrs;
4636 &oa_config->sysfs_metric);
4657 struct i915_oa_config *oa_config, *tmp;
4684 oa_config = kzalloc(sizeof(*oa_config), GFP_KERNEL);
4685 if (!oa_config) {
4691 oa_config->perf = perf;
4692 kref_init(&oa_config->ref);
4701 /* Last character in oa_config->uuid will be 0 because oa_config is
4704 memcpy(oa_config->uuid, args->uuid, sizeof(args->uuid));
4706 oa_config->mux_regs_len = args->n_mux_regs;
4718 oa_config->mux_regs = regs;
4720 oa_config->b_counter_regs_len = args->n_boolean_regs;
4732 oa_config->b_counter_regs = regs;
4740 oa_config->flex_regs_len = args->n_flex_regs;
4752 oa_config->flex_regs = regs;
4763 if (!strcmp(tmp->uuid, oa_config->uuid)) {
4771 err = create_dynamic_oa_sysfs_entry(perf, oa_config);
4779 oa_config->id = idr_alloc(&perf->metrics_idr,
4780 oa_config, 2,
4782 if (oa_config->id < 0) {
4785 err = oa_config->id;
4788 id = oa_config->id;
4791 "Added config %s id=%i\n", oa_config->uuid, oa_config->id);
4799 i915_oa_config_put(oa_config);
4821 struct i915_oa_config *oa_config;
4837 oa_config = idr_find(&perf->metrics_idr, *arg);
4838 if (!oa_config) {
4845 GEM_BUG_ON(*arg != oa_config->id);
4847 sysfs_remove_group(perf->metrics_kobj, &oa_config->sysfs_metric);
4854 "Removed config %s id=%i\n", oa_config->uuid, oa_config->id);
4856 i915_oa_config_put(oa_config);