dma_buf_vmap(9)
π 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 calldma_buf_begin_cpu_accessanddma_buf_end_cpu_accessaround 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:
- Kernel file
./drivers/dma-buf/dma-buf.c dma_buf_iter_begin(9)dma_buf_iter_next(9)implicit fence polling(9)dma_buf_set_name(9)dma buf device access(9)dma_buf_export(9)dma_buf_fd(9)dma_buf_fd_install(9)dma_buf_get(9)dma_buf_put(9)locking convention(9)dma_buf_dynamic_attach(9)dma_buf_attach(9)dma_buf_detach(9)dma_buf_pin(9)dma_buf_unpin(9)dma_buf_map_attachment(9)dma_buf_map_attachment_unlocked(9)dma_buf_unmap_attachment(9)dma_buf_unmap_attachment_unlocked(9)dma_buf_attach_revocable(9)dma_buf_invalidate_mappings(9)cpu access(9)dma_buf_begin_cpu_access(9)dma_buf_end_cpu_access(9)dma_buf_mmap(9)dma_buf_vmap_unlocked(9)dma_buf_vunmap(9)dma_buf_vunmap_unlocked(9)
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
- 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