i915_perf_open_ioctl(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… i915_perf_open_ioctl(9) β€” like, the kernel API manual, bestie ✨

okay so before we even start β€” this whole page lives in the Kernel API Manual, and the star of the show is i915_perf_open_ioctl(9). yes the title is a mouthful, no we're not renaming it, it's iconic as-is πŸŽ€


🌸 NAME 🌸

i915_perf_open_ioctl β€” the DRM ioctl() that lets userspace open a stream FD πŸ¦‹


✨ SYNOPSIS ✨

int i915_perf_open_ioctl (struct drm_device *dev , void *data , struct
       drm_file *file );

literally the whole signature, no cap πŸ’…


🫢 ARGUMENTS 🫢

  • dev β€” the drm device πŸ‘‘
  • data β€” the ioctl data, copied over from userspace and not validated yet (so, like, treat it with suspicion until further notice πŸ™ˆ)
  • file β€” the drm file πŸ“

πŸ’– DESCRIPTION πŸ’–

so what this does is validate the stream open parameters that userspace handed over β€” that includes the flags and an array of u64 key, value pair properties. vibe check first, streaming second ✨

and here's the cute part: we assume, like, very little up front about what kind of stream is being opened. for instance, we don't assume it's for periodic OA unit metrics. an i915-perf stream is expected to be a suitable interface for other forms of buffered data written by the GPU besides periodic OA metrics β€” so it's giving main character energy for more than just one use case πŸ’…

lowkey important note, bestie: we copy the properties from userspace outside of the i915 perf mutex, and that's on purpose β€” it avoids an awkward lockdep situation with mmap_lock 😭 so don't come for that ordering, it's deliberate.

most of the actual implementation details are handled by i915_perf_open_ioctl_locked, after taking the gt->perf.lock mutex for serializing with any non-file-operation driver hooks πŸ”₯


⭐ RETURN ⭐

you get either a newly opened i915 Perf stream file descriptor, or a negative error code on failure. slay or cry, there is no in between πŸ’€


🌈 SEE ALSO 🌈

okay this list is long, so buckle up 🧚 β€” but every single one of these matters:


πŸ₯Ί and that's the page!! sourced from ./drivers/gpu/drm/i915, dated October 2026, and yes it really is i915_perf_open_ioctl(9) the whole way through. read it, bookmark it, tell your friends. mwah πŸ’‹πŸ’œ

πŸ“¦ where this page comes from