i915_perf_open_ioctl(9)
π 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:
- Kernel file
./drivers/gpu/drm/i915/i915_perf.c i915 Perf Overview(9)i915 Perf History and Comparison with Core Perf(9)OA Tail Pointer Race(9)struct perf_open_properties(9)oa_buffer_check_unlocked(9)append_oa_status(9)append_oa_sample(9)gen8_append_oa_reports(9)gen8_oa_read(9)gen7_append_oa_reports(9)gen7_oa_read(9)i915_oa_wait_unlocked(9)i915_oa_poll_wait(9)i915_oa_read(9)oa_get_render_ctx_id(9)oa_put_render_ctx_id(9)i915_oa_stream_enable(9)i915_oa_stream_disable(9)i915_oa_stream_init(9)i915_perf_read(9)i915_perf_poll_locked(9)i915_perf_poll(9)i915_perf_enable_locked(9)i915_perf_disable_locked(9)i915_perf_ioctl_locked(9)i915_perf_ioctl(9)i915_perf_destroy_locked(9)i915_perf_release(9)i915_perf_open_ioctl_locked(9)read_properties_unlocked(9)i915_perf_register(9)i915_perf_unregister(9)i915_perf_add_config_ioctl(9)i915_perf_remove_config_ioctl(9)i915_perf_init(9)i915_perf_fini(9)i915_perf_ioctl_version(9)
π₯Ί 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms