Lines Matching refs:oa_config

389 	struct i915_oa_config *oa_config;  member
399 struct i915_oa_config *oa_config = in i915_oa_config_release() local
400 container_of(ref, typeof(*oa_config), ref); in i915_oa_config_release()
402 kfree(oa_config->flex_regs); in i915_oa_config_release()
403 kfree(oa_config->b_counter_regs); in i915_oa_config_release()
404 kfree(oa_config->mux_regs); in i915_oa_config_release()
406 kfree_rcu(oa_config, rcu); in i915_oa_config_release()
412 struct i915_oa_config *oa_config; in i915_perf_get_oa_config() local
415 oa_config = idr_find(&perf->metrics_idr, metrics_set); in i915_perf_get_oa_config()
416 if (oa_config) in i915_perf_get_oa_config()
417 oa_config = i915_oa_config_get(oa_config); in i915_perf_get_oa_config()
420 return oa_config; in i915_perf_get_oa_config()
425 i915_oa_config_put(oa_bo->oa_config); in free_oa_config_bo()
1640 i915_oa_config_put(stream->oa_config); in free_oa_configs()
2190 struct i915_oa_config *oa_config) in alloc_oa_config_buffer() argument
2203 config_length += num_lri_dwords(oa_config->mux_regs_len); in alloc_oa_config_buffer()
2204 config_length += num_lri_dwords(oa_config->b_counter_regs_len); in alloc_oa_config_buffer()
2205 config_length += num_lri_dwords(oa_config->flex_regs_len); in alloc_oa_config_buffer()
2228 oa_config->mux_regs, in alloc_oa_config_buffer()
2229 oa_config->mux_regs_len); in alloc_oa_config_buffer()
2231 oa_config->b_counter_regs, in alloc_oa_config_buffer()
2232 oa_config->b_counter_regs_len); in alloc_oa_config_buffer()
2234 oa_config->flex_regs, in alloc_oa_config_buffer()
2235 oa_config->flex_regs_len); in alloc_oa_config_buffer()
2255 oa_bo->oa_config = i915_oa_config_get(oa_config); in alloc_oa_config_buffer()
2277 get_oa_vma(struct i915_perf_stream *stream, struct i915_oa_config *oa_config) in get_oa_vma() argument
2286 if (oa_bo->oa_config == oa_config && in get_oa_vma()
2287 memcmp(oa_bo->oa_config->uuid, in get_oa_vma()
2288 oa_config->uuid, in get_oa_vma()
2289 sizeof(oa_config->uuid)) == 0) in get_oa_vma()
2293 oa_bo = alloc_oa_config_buffer(stream, oa_config); in get_oa_vma()
2303 struct i915_oa_config *oa_config, in emit_oa_config() argument
2312 vma = get_oa_vma(stream, oa_config); in emit_oa_config()
2399 stream->oa_config, oa_context(stream), in hsw_enable_metric_set()
2415 static u32 oa_config_flex_reg(const struct i915_oa_config *oa_config, in oa_config_flex_reg() argument
2426 if (!oa_config) in oa_config_flex_reg()
2429 for (i = 0; i < oa_config->flex_regs_len; i++) { in oa_config_flex_reg()
2430 if (i915_mmio_reg_offset(oa_config->flex_regs[i].addr) == mmio) in oa_config_flex_reg()
2431 return oa_config->flex_regs[i].value; in oa_config_flex_reg()
2469 oa_config_flex_reg(stream->oa_config, flex_regs[i]); in gen8_update_reg_state_unlocked()
2753 const struct i915_oa_config *oa_config, in lrc_configure_all_contexts() argument
2786 regs[i].value = oa_config_flex_reg(oa_config, regs[i].reg); in lrc_configure_all_contexts()
2798 struct i915_oa_config *oa_config = stream->oa_config; in gen8_enable_metric_set() local
2835 ret = lrc_configure_all_contexts(stream, oa_config, active); in gen8_enable_metric_set()
2840 stream->oa_config, oa_context(stream), in gen8_enable_metric_set()
2912 stream->oa_config, oa_context(stream), in gen12_enable_metric_set()
3319 stream->oa_config = i915_perf_get_oa_config(perf, props->metrics_set); in i915_oa_stream_init()
3320 if (!stream->oa_config) { in i915_oa_stream_init()
3360 stream->oa_config->uuid); in i915_oa_stream_init()
3613 long ret = stream->oa_config->id; in i915_perf_config_locked()
3619 if (config != stream->oa_config) { in i915_perf_config_locked()
3633 config = xchg(&stream->oa_config, config); in i915_perf_config_locked()
4554 struct i915_oa_config *oa_config = in show_dynamic_id() local
4555 container_of(attr, typeof(*oa_config), sysfs_metric_id); in show_dynamic_id()
4557 return sprintf(buf, "%d\n", oa_config->id); in show_dynamic_id()
4561 struct i915_oa_config *oa_config) in create_dynamic_oa_sysfs_entry() argument
4563 sysfs_attr_init(&oa_config->sysfs_metric_id.attr); in create_dynamic_oa_sysfs_entry()
4564 oa_config->sysfs_metric_id.attr.name = "id"; in create_dynamic_oa_sysfs_entry()
4565 oa_config->sysfs_metric_id.attr.mode = S_IRUGO; in create_dynamic_oa_sysfs_entry()
4566 oa_config->sysfs_metric_id.show = show_dynamic_id; in create_dynamic_oa_sysfs_entry()
4567 oa_config->sysfs_metric_id.store = NULL; in create_dynamic_oa_sysfs_entry()
4569 oa_config->attrs[0] = &oa_config->sysfs_metric_id.attr; in create_dynamic_oa_sysfs_entry()
4570 oa_config->attrs[1] = NULL; in create_dynamic_oa_sysfs_entry()
4572 oa_config->sysfs_metric.name = oa_config->uuid; in create_dynamic_oa_sysfs_entry()
4573 oa_config->sysfs_metric.attrs = oa_config->attrs; in create_dynamic_oa_sysfs_entry()
4576 &oa_config->sysfs_metric); in create_dynamic_oa_sysfs_entry()
4597 struct i915_oa_config *oa_config, *tmp; in i915_perf_add_config_ioctl() local
4624 oa_config = kzalloc(sizeof(*oa_config), GFP_KERNEL); in i915_perf_add_config_ioctl()
4625 if (!oa_config) { in i915_perf_add_config_ioctl()
4631 oa_config->perf = perf; in i915_perf_add_config_ioctl()
4632 kref_init(&oa_config->ref); in i915_perf_add_config_ioctl()
4644 memcpy(oa_config->uuid, args->uuid, sizeof(args->uuid)); in i915_perf_add_config_ioctl()
4646 oa_config->mux_regs_len = args->n_mux_regs; in i915_perf_add_config_ioctl()
4658 oa_config->mux_regs = regs; in i915_perf_add_config_ioctl()
4660 oa_config->b_counter_regs_len = args->n_boolean_regs; in i915_perf_add_config_ioctl()
4672 oa_config->b_counter_regs = regs; in i915_perf_add_config_ioctl()
4680 oa_config->flex_regs_len = args->n_flex_regs; in i915_perf_add_config_ioctl()
4692 oa_config->flex_regs = regs; in i915_perf_add_config_ioctl()
4703 if (!strcmp(tmp->uuid, oa_config->uuid)) { in i915_perf_add_config_ioctl()
4711 err = create_dynamic_oa_sysfs_entry(perf, oa_config); in i915_perf_add_config_ioctl()
4719 oa_config->id = idr_alloc(&perf->metrics_idr, in i915_perf_add_config_ioctl()
4720 oa_config, 2, in i915_perf_add_config_ioctl()
4722 if (oa_config->id < 0) { in i915_perf_add_config_ioctl()
4725 err = oa_config->id; in i915_perf_add_config_ioctl()
4728 id = oa_config->id; in i915_perf_add_config_ioctl()
4731 "Added config %s id=%i\n", oa_config->uuid, oa_config->id); in i915_perf_add_config_ioctl()
4739 i915_oa_config_put(oa_config); in i915_perf_add_config_ioctl()
4761 struct i915_oa_config *oa_config; in i915_perf_remove_config_ioctl() local
4777 oa_config = idr_find(&perf->metrics_idr, *arg); in i915_perf_remove_config_ioctl()
4778 if (!oa_config) { in i915_perf_remove_config_ioctl()
4785 GEM_BUG_ON(*arg != oa_config->id); in i915_perf_remove_config_ioctl()
4787 sysfs_remove_group(perf->metrics_kobj, &oa_config->sysfs_metric); in i915_perf_remove_config_ioctl()
4794 "Removed config %s id=%i\n", oa_config->uuid, oa_config->id); in i915_perf_remove_config_ioctl()
4796 i915_oa_config_put(oa_config); in i915_perf_remove_config_ioctl()