i915_gem_mmap_ioctl(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 NAME 🌸

okay so welcome to the i915_gem_mmap_ioctl(9) page from the Kernel API Manual β€” manual name folded in right here at the top, bestie, because we are absolutely not copying that header line. This one is i915_gem_mmap_ioctl, and it maps the contents of an object, returning the address it is mapped to. πŸ’…

πŸ¦‹ SYNOPSIS πŸ¦‹

like, here is the signature exactly:

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

πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” the drm device ✨
  • data β€” the ioctl data blob 🫢
  • file β€” the drm file πŸŽ€

πŸ’– DESCRIPTION πŸ’–

So the mapping does hold a reference on the contents of the object, but it does not imply a ref on the object itself. tiny but important distinction, okay? 😭

⚠️ IMPORTANT: DRM driver writers who look at this function as an example for how to do GEM mmap support β€” please, please don't implement mmap support like here. The modern way to implement DRM mmap support is with an mmap offset ioctl (like i915_gem_mmap_gtt) and then using the mmap syscall on the DRM fd directly. That way debug tooling like valgrind will understand what's going on; hiding the mmap call in a driver private ioctl will break that. The i915 driver only does cpu mmaps this way because we didn't know better. πŸ’€

✨ SEE ALSO ✨


xoxo, from the source/version ./drivers/gpu/drm/i915/gem, dated October 2026 β€” i915_gem_mmap_ioctl(9) out πŸ’–

πŸ“¦ where this page comes from