STRUCT DRM_I915_GEM_MMAP_OFFSET(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct drm_..._mmap_offset(9) ✨

okay so this is from the Kernel API Manual bestie, and it's literally the glow-up guide to drm_i915_gem_mmap_offset. buckle up πŸŽ€


πŸ’– NAME πŸ’–

struct drm_i915_gem_mmap_offset β€” Retrieve an offset so we can mmap this buffer object. that's it, that's the whole vibe πŸ¦‹


🌸 SYNOPSIS 🌸

no cap, here's the whole struct, verbatim, don't touch:

struct drm_i915_gem_mmap_offset {
    __u32 handle;
    __u32 pad;
    __u64 offset;
    __u64 flags;
  #define I915_MMAP_OFFSET_GTT    0;
  #define I915_MMAP_OFFSET_WC     1;
  #define I915_MMAP_OFFSET_WB     2;
  #define I915_MMAP_OFFSET_UC     3;
  #define I915_MMAP_OFFSET_FIXED  4;
    __u64 extensions;
 };

🫢 Members 🫢

  • handle β€” Handle for the object being mapped. the main character of the whole operation ngl πŸ‘‘
  • pad β€” Must be zero. like, must. fr fr. it's padding, it wants to be left alone πŸ’€
  • offset β€” The fake offset to use for subsequent mmap call. fake it till you make it, iconic behavior ✨

This is a fixed-size type for 32/64 compatibility. iykyk 🧚

  • flags β€” Flags for extended behaviour.

It is mandatory that one of the MMAP_OFFSET types should be included. mandatory mandatory, no skipping:

  • I915_MMAP_OFFSET_GTT: Use mmap with the object bound to GTT. (Write-Combined)
  • I915_MMAP_OFFSET_WC: Use Write-Combined caching.
  • I915_MMAP_OFFSET_WB: Use Write-Back caching.
  • I915_MMAP_OFFSET_FIXED: Use object placement to determine caching.
🚨 On devices with local memory I915_MMAP_OFFSET_FIXED is the only valid type. On devices without local memory, this caching mode is invalid. so like… know your hardware bestie, don't just vibe-check it and hope 😭

As caching mode when specifying I915_MMAP_OFFSET_FIXED, WC or WB will be used, depending on the object placement on creation. WB will be used when the object can only exist in system memory, WC otherwise. the object picks its own outfit based on where it lives, honestly slay πŸ’…

  • extensions β€” Zero-terminated chain of extensions.

No current extensions defined; mbz. (that's "must be zero" β€” it's giving "nothing to see here" πŸ™ˆ)


🌈 Description 🌈

This struct is passed as argument to the DRM_IOCTL_I915_GEM_MMAP_OFFSET ioctl, and is used to retrieve the fake offset to mmap an object specified by handle. it's the little handshake before the actual mapping, and honestly it ate πŸ”₯

The legacy way of using DRM_IOCTL_I915_GEM_MMAP is removed on gen12+. gone. not coming back. rest in peace πŸͺ¦

DRM_IOCTL_I915_GEM_MMAP_GTT is an older supported alias to this struct, but will behave as setting the extensions to 0, and flags to I915_MMAP_OFFSET_GTT. so it's the same struct wearing a slightly different hat 🎩


⭐ SEE ALSO ⭐

go follow all of these, they're mutuals:

  • Kernel file ./tools/perf/trace/beauty/include/uapi/drm/i915_drm.h
  • uevents generated by i915 on its device node(9)
  • struct i915_user_extension(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_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)

okay that's the whole page bestie, you're so smart for reading all of it 🫢 signed off from ./tools/perf/trace/beauty/incl..., dated October 2026 β€” the source and version say hi, and this page is officially done. periodt πŸ’…βœ¨

πŸ“¦ where this page comes from