dma_buf_vmap(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… dma_buf_vmap β€” Kernel API Manual, but make it a group chat ✨

Okay bestie, so this one is from the Kernel API Manual and it's literally about giving your buffer object a virtual mapping into kernel address space. Same restrictions as for vmap and friends apply β€” no cap.


✨ NAME ✨

dma_buf_vmap β€” Create virtual mapping for the buffer object into kernel address space. Same restrictions as for vmap and friends apply.

Like, it's the "hey can I get a kernel-side pointer to this thing" function 🫢


πŸŽ€ SYNOPSIS πŸŽ€

int dma_buf_vmap (struct dma_buf *dmabuf , struct iosys_map *map );

🌸 ARGUMENTS 🌸

  • dmabuf [in] β€” the buffer to vmap. The main character of this whole operation πŸ‘‘
  • map [out] β€” returns the vmap pointer. She's output-only, she gets filled in for you πŸ’–

πŸ¦‹ DESCRIPTION πŸ¦‹

So this call may fail due to lack of virtual mapping address space β€” yes, that's a real possibility, keep it in mind 😭 These calls are optional in drivers. No pressure, no drama.

The intended use for them is for mapping objects linear in kernel space for high use objects. Like, the popular kids. The ones everybody's touching πŸ”₯

Real talk: to ensure coherency, users must call dma_buf_begin_cpu_access and dma_buf_end_cpu_access around any cpu access performed through this mapping. Do not skip this, I'm begging πŸ™ˆ

Returns 0 on success, or a negative errno code otherwise. Periodt.


⭐ SEE ALSO ⭐

Icons only. Go read these next:


That's the whole vibe check, bestie πŸ’œ This lil page came from ./drivers/dma-buf and it's dated October 2026 β€” so yes, she's from the future, slay 🧚✨

πŸ“¦ where this page comes from