STRUCT I915_OA_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct i915_oa_ops(9) πŸ’…

okay so bestie, this page is from the Kernel API Manual, and it's literally the Gen specific implementation of an OA unit stream. It's giving β€œone struct to rule all the Gen-specific fiddly bits” energy, and honestly? Iconic. ✨


🌸 NAME 🌸

  • struct i915_oa_ops β€” Gen specific implementation of an OA unit stream.

πŸ¦‹ SYNOPSIS πŸ¦‹

no cap, here's the exact shape of it:

struct i915_oa_ops {
    bool (*is_valid_b_counter_reg)(struct i915_perf *perf, u32 addr);
    bool (*is_valid_mux_reg)(struct i915_perf *perf, u32 addr);
    bool (*is_valid_flex_reg)(struct i915_perf *perf, u32 addr);
    int (*enable_metric_set)(struct i915_perf_stream *stream, struct i915_active *active);
    void (*disable_metric_set)(struct i915_perf_stream *stream);
    void (*oa_enable)(struct i915_perf_stream *stream);
    void (*oa_disable)(struct i915_perf_stream *stream);
    int (*read)(struct i915_perf_stream *stream, char __user *buf, size_t count, size_t *offset);
    u32 (*oa_hw_tail_read)(struct i915_perf_stream *stream);
};

🧚 Members 🧚

  • is_valid_b_counter_reg β€” Validates register's address for programming boolean counters for a particular platform. πŸ’–
  • is_valid_mux_reg β€” Validates register's address for programming mux for a particular platform. ✨
  • is_valid_flex_reg β€” Validates register's address for programming flex EU filtering for a particular platform. πŸ¦‹
  • enable_metric_set β€” Selects and applies any MUX configuration to set up the Boolean and Custom (B/C) counters that are part of the counter reports being sampled. May apply system constraints such as disabling EU clock gating as required. πŸ‘‘
  • disable_metric_set β€” Remove system constraints associated with using the OA unit. πŸŽ€
  • oa_enable β€” Enable periodic sampling. πŸ”₯
  • oa_disable β€” Disable periodic sampling. πŸ’€
  • read β€” Copy data from the circular OA buffer into a given userspace buffer. 🫢
  • oa_hw_tail_read β€” read the OA tail pointer register. ⭐

In particular this enables us to share all the fiddly code for handling the OA unit tail pointer race that affects multiple generations. fr fr, that's the whole vibe β€” shared fiddly-code handling, no cap. πŸ’œ


🌈 SEE ALSO 🌈

  • Kernel file ./drivers/gpu/drm/i915/i915_perf_types.h
  • struct i915_perf_stream_ops(9)
  • struct i915_perf_stream(9)

xoxo πŸ’– from the Kernel API Manual, source ./drivers/gpu/drm/i915, dated October 2026, page struct i915_oa_ops(9) πŸŽ€

πŸ“¦ where this page comes from