Lines Matching refs:oa_config
388 struct i915_oa_config *oa_config; member
398 struct i915_oa_config *oa_config = in i915_oa_config_release() local
399 container_of(ref, typeof(*oa_config), ref); in i915_oa_config_release()
401 kfree(oa_config->flex_regs); in i915_oa_config_release()
402 kfree(oa_config->b_counter_regs); in i915_oa_config_release()
403 kfree(oa_config->mux_regs); in i915_oa_config_release()
405 kfree_rcu(oa_config, rcu); in i915_oa_config_release()
411 struct i915_oa_config *oa_config; in i915_perf_get_oa_config() local
414 oa_config = idr_find(&perf->metrics_idr, metrics_set); in i915_perf_get_oa_config()
415 if (oa_config) in i915_perf_get_oa_config()
416 oa_config = i915_oa_config_get(oa_config); in i915_perf_get_oa_config()
419 return oa_config; in i915_perf_get_oa_config()
424 i915_oa_config_put(oa_bo->oa_config); in free_oa_config_bo()
1636 i915_oa_config_put(stream->oa_config); in free_oa_configs()
2194 struct i915_oa_config *oa_config) in alloc_oa_config_buffer() argument
2207 config_length += num_lri_dwords(oa_config->mux_regs_len); in alloc_oa_config_buffer()
2208 config_length += num_lri_dwords(oa_config->b_counter_regs_len); in alloc_oa_config_buffer()
2209 config_length += num_lri_dwords(oa_config->flex_regs_len); in alloc_oa_config_buffer()
2232 oa_config->mux_regs, in alloc_oa_config_buffer()
2233 oa_config->mux_regs_len); in alloc_oa_config_buffer()
2235 oa_config->b_counter_regs, in alloc_oa_config_buffer()
2236 oa_config->b_counter_regs_len); in alloc_oa_config_buffer()
2238 oa_config->flex_regs, in alloc_oa_config_buffer()
2239 oa_config->flex_regs_len); in alloc_oa_config_buffer()
2259 oa_bo->oa_config = i915_oa_config_get(oa_config); in alloc_oa_config_buffer()
2281 get_oa_vma(struct i915_perf_stream *stream, struct i915_oa_config *oa_config) in get_oa_vma() argument
2290 if (oa_bo->oa_config == oa_config && in get_oa_vma()
2291 memcmp(oa_bo->oa_config->uuid, in get_oa_vma()
2292 oa_config->uuid, in get_oa_vma()
2293 sizeof(oa_config->uuid)) == 0) in get_oa_vma()
2297 oa_bo = alloc_oa_config_buffer(stream, oa_config); in get_oa_vma()
2307 struct i915_oa_config *oa_config, in emit_oa_config() argument
2316 vma = get_oa_vma(stream, oa_config); in emit_oa_config()
2403 stream->oa_config, oa_context(stream), in hsw_enable_metric_set()
2419 static u32 oa_config_flex_reg(const struct i915_oa_config *oa_config, in oa_config_flex_reg() argument
2430 if (!oa_config) in oa_config_flex_reg()
2433 for (i = 0; i < oa_config->flex_regs_len; i++) { in oa_config_flex_reg()
2434 if (i915_mmio_reg_offset(oa_config->flex_regs[i].addr) == mmio) in oa_config_flex_reg()
2435 return oa_config->flex_regs[i].value; in oa_config_flex_reg()
2473 oa_config_flex_reg(stream->oa_config, flex_regs[i]); in gen8_update_reg_state_unlocked()
2757 const struct i915_oa_config *oa_config, in gen12_configure_all_contexts() argument
2777 const struct i915_oa_config *oa_config, in lrc_configure_all_contexts() argument
2810 regs[i].value = oa_config_flex_reg(oa_config, regs[i].reg); in lrc_configure_all_contexts()
2822 struct i915_oa_config *oa_config = stream->oa_config; in gen8_enable_metric_set() local
2859 ret = lrc_configure_all_contexts(stream, oa_config, active); in gen8_enable_metric_set()
2864 stream->oa_config, oa_context(stream), in gen8_enable_metric_set()
2881 struct i915_oa_config *oa_config = stream->oa_config; in gen12_enable_metric_set() local
2930 ret = gen12_configure_all_contexts(stream, oa_config, active); in gen12_enable_metric_set()
2946 stream->oa_config, oa_context(stream), in gen12_enable_metric_set()
3360 stream->oa_config = i915_perf_get_oa_config(perf, props->metrics_set); in i915_oa_stream_init()
3361 if (!stream->oa_config) { in i915_oa_stream_init()
3420 stream->oa_config->uuid); in i915_oa_stream_init()
3677 long ret = stream->oa_config->id; in i915_perf_config_locked()
3683 if (config != stream->oa_config) { in i915_perf_config_locked()
3697 config = xchg(&stream->oa_config, config); in i915_perf_config_locked()
4622 struct i915_oa_config *oa_config = in show_dynamic_id() local
4623 container_of(attr, typeof(*oa_config), sysfs_metric_id); in show_dynamic_id()
4625 return sprintf(buf, "%d\n", oa_config->id); in show_dynamic_id()
4629 struct i915_oa_config *oa_config) in create_dynamic_oa_sysfs_entry() argument
4631 sysfs_attr_init(&oa_config->sysfs_metric_id.attr); in create_dynamic_oa_sysfs_entry()
4632 oa_config->sysfs_metric_id.attr.name = "id"; in create_dynamic_oa_sysfs_entry()
4633 oa_config->sysfs_metric_id.attr.mode = S_IRUGO; in create_dynamic_oa_sysfs_entry()
4634 oa_config->sysfs_metric_id.show = show_dynamic_id; in create_dynamic_oa_sysfs_entry()
4635 oa_config->sysfs_metric_id.store = NULL; in create_dynamic_oa_sysfs_entry()
4637 oa_config->attrs[0] = &oa_config->sysfs_metric_id.attr; in create_dynamic_oa_sysfs_entry()
4638 oa_config->attrs[1] = NULL; in create_dynamic_oa_sysfs_entry()
4640 oa_config->sysfs_metric.name = oa_config->uuid; in create_dynamic_oa_sysfs_entry()
4641 oa_config->sysfs_metric.attrs = oa_config->attrs; in create_dynamic_oa_sysfs_entry()
4644 &oa_config->sysfs_metric); in create_dynamic_oa_sysfs_entry()
4665 struct i915_oa_config *oa_config, *tmp; in i915_perf_add_config_ioctl() local
4695 oa_config = kzalloc(sizeof(*oa_config), GFP_KERNEL); in i915_perf_add_config_ioctl()
4696 if (!oa_config) { in i915_perf_add_config_ioctl()
4702 oa_config->perf = perf; in i915_perf_add_config_ioctl()
4703 kref_init(&oa_config->ref); in i915_perf_add_config_ioctl()
4715 memcpy(oa_config->uuid, args->uuid, sizeof(args->uuid)); in i915_perf_add_config_ioctl()
4717 oa_config->mux_regs_len = args->n_mux_regs; in i915_perf_add_config_ioctl()
4729 oa_config->mux_regs = regs; in i915_perf_add_config_ioctl()
4731 oa_config->b_counter_regs_len = args->n_boolean_regs; in i915_perf_add_config_ioctl()
4743 oa_config->b_counter_regs = regs; in i915_perf_add_config_ioctl()
4751 oa_config->flex_regs_len = args->n_flex_regs; in i915_perf_add_config_ioctl()
4763 oa_config->flex_regs = regs; in i915_perf_add_config_ioctl()
4774 if (!strcmp(tmp->uuid, oa_config->uuid)) { in i915_perf_add_config_ioctl()
4782 err = create_dynamic_oa_sysfs_entry(perf, oa_config); in i915_perf_add_config_ioctl()
4790 oa_config->id = idr_alloc(&perf->metrics_idr, in i915_perf_add_config_ioctl()
4791 oa_config, 2, in i915_perf_add_config_ioctl()
4793 if (oa_config->id < 0) { in i915_perf_add_config_ioctl()
4796 err = oa_config->id; in i915_perf_add_config_ioctl()
4799 id = oa_config->id; in i915_perf_add_config_ioctl()
4802 "Added config %s id=%i\n", oa_config->uuid, oa_config->id); in i915_perf_add_config_ioctl()
4810 i915_oa_config_put(oa_config); in i915_perf_add_config_ioctl()
4832 struct i915_oa_config *oa_config; in i915_perf_remove_config_ioctl() local
4851 oa_config = idr_find(&perf->metrics_idr, *arg); in i915_perf_remove_config_ioctl()
4852 if (!oa_config) { in i915_perf_remove_config_ioctl()
4859 GEM_BUG_ON(*arg != oa_config->id); in i915_perf_remove_config_ioctl()
4861 sysfs_remove_group(perf->metrics_kobj, &oa_config->sysfs_metric); in i915_perf_remove_config_ioctl()
4868 "Removed config %s id=%i\n", oa_config->uuid, oa_config->id); in i915_perf_remove_config_ioctl()
4870 i915_oa_config_put(oa_config); in i915_perf_remove_config_ioctl()