STRUCT I915_USER_EXTENSION(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct i915_user_extension(9) ✨

okay so bestie, welcome to the Kernel API Manual πŸ’– this one's all about struct i915_user_extension β€” literally the base class for defining a chain of extensions. it's giving "linked list but make it uAPI" and honestly? iconic. πŸŽ€


🌸 NAME 🌸

struct i915_user_extension β€” base class for defining a chain of extensions πŸ¦‹


✨ SYNOPSIS ✨

struct i915_user_extension {
    __u64 next_extension;
    __u32 name;
    __u32 flags;
    __u32 rsvd[4];
 };

πŸŽ€ Members πŸŽ€

  • next_extension β€” pointer to the next struct i915_user_extension, or zero if you've hit the end of the chain. that's the "no more besties after me" signal πŸ’…
  • name β€” the name of the extension.
note that the name here is just some integer. like, don't go looking for a string, it's not that kind of party πŸ™ˆ
also note: the namespace for this is not global for the whole driver. its scope/meaning is limited to the specific piece of uAPI which has embedded the struct i915_user_extension. so like, context matters, always 🌈
  • flags β€” MBZ. all undefined bits must be zero. no cap, zero means zero πŸ’€
  • rsvd β€” MBZ. reserved for future use; must be zero. it's literally sitting there being saved for later, main character energy πŸ‘‘

πŸ’– Description πŸ’–

many interfaces need to grow over time. in most cases we can simply extend the struct and have userspace pass in more data. another option β€” as demonstrated by Vulkan's approach to providing extensions for forward and backward compatibility β€” is to use a list of optional structs to provide those extra details. slay, honestly 🫢

the key advantage to using an extension chain is that it lets us redefine the interface more easily than an ever growing struct of increasing complexity, and it lets large parts of that interface be entirely optional. the downside? more pointer chasing 😭 specifically, chasing across the __user boundary with pointers encapsulated inside u64. it's giving "trust me bro, it's worth it."

example chaining:

     struct i915_user_extension ext3 {
             .next_extension = 0, // end
             .name = ...,
     };
     struct i915_user_extension ext2 {
             .next_extension = (uintptr_t)ext3,
             .name = ...,
     };
     struct i915_user_extension ext1 {
             .next_extension = (uintptr_t)ext2,
             .name = ...,
     };

typically the struct i915_user_extension would be embedded in some uAPI struct, and in this case we would feed it the head of the chain (i.e ext1), which would then apply all of the above extensions. head of the chain = first one in the group chat, and she passes the message along πŸ’Œ


πŸ”₯ SEE ALSO πŸ”₯

  • Kernel file ./tools/perf/trace/beauty/include/uapi/drm/i915_drm.h
  • uevents generated by i915 on its device node(9)
  • enum drm_i915_gem_engine_class(9)
  • struct i915_engine_class_instance(9)
  • perf_events exposed by i915 through /sys/bus/event_sources/drivers/i915(9)
  • struct drm_i915_getparam(9)
  • drm_i915_getparam_t(9)
  • struct drm_i915_gem_mmap_offset(9)
  • struct drm_i915_gem_set_domain(9)
  • struct drm_i915_gem_exec_fence(9)
  • struct drm_i915_gem_execbuffer_ext_timeline_fences(9)
  • struct drm_i915_gem_execbuffer2(9)
  • struct drm_i915_gem_caching(9)
  • struct drm_i915_gem_context_create_ext(9)
  • struct drm_i915_gem_context_param(9)
  • Virtual Engine uAPI(9)
  • struct i915_context_engines_parallel_submit(9)
  • Context Engine Map uAPI(9)
  • struct drm_i915_gem_context_create_ext_setparam(9)
  • struct drm_i915_gem_vm_control(9)
  • struct drm_i915_gem_userptr(9)
  • struct drm_i915_perf_oa_config(9)
  • struct drm_i915_query_item(9)
  • struct drm_i915_query(9)
  • struct drm_i915_query_topology_info(9)
  • Engine Discovery uAPI(9)
  • struct drm_i915_engine_info(9)
  • struct drm_i915_query_engine_info(9)
  • struct drm_i915_query_perf_config(9)
  • enum drm_i915_gem_memory_class(9)
  • struct drm_i915_gem_memory_class_instance(9)
  • struct drm_i915_memory_region_info(9)
  • struct drm_i915_query_memory_regions(9)
  • struct drm_i915_query_guc_submission_version(9)
  • GuC HWCONFIG blob uAPI(9)
  • struct drm_i915_gem_create_ext(9)
  • struct drm_i915_gem_create_ext_memory_regions(9)
  • struct drm_i915_gem_create_ext_protected_content(9)
  • struct drm_i915_gem_create_ext_set_pat(9)

and that's the whole page, bestie, you ate that πŸ“ before you go: this lil beauty came from ./tools/perf/trace/beauty/incl... and she's dated October 2026, so jot that down in your notes app πŸ“ mwah, go forth and chain your extensions responsibly πŸ’œπŸ§š

πŸ“¦ where this page comes from