dma_buf_pin(9)
π dma_buf_pin(9) π
okay so bestie, welcome to the Kernel API Manual β yes that's the manual name, we're being official for like two seconds β and today's main character is dma_buf_pin. It locks down a DMA-buf. That's it. That's the vibe. π
β¨ NAME β¨
dma_buf_pin β lock down the DMA-buf, no cap π
πΈ SYNOPSIS πΈ
int dma_buf_pin(struct dma_buf_attachment *attach);
π¦ ARGUMENTS π¦
attach[in]β the attachment that should be pinned. literally the whole point, she's the one getting locked down π«Ά
π DESCRIPTION π
okay so listen, this is exclusive. Only dynamic importers may call this β and by dynamic importers I mean the ones who set up attach with dma_buf_dynamic_attach. If that's not you, this is not your function, periodt. π
And even if you are a dynamic importer, this is for limited use cases β like scanout. Not for temporary pin operations. like, temporary pinning? different thing, not this, don't try it here. π
Also, and this is important, bestie: it is not permitted to let userspace pin arbitrary amounts of buffers through this interface. Arbitrary amounts? no ma'am. that's a hard no. put it down. π
And when you're done pinning β and you will be done eventually β the buffers must be unpinned by calling dma_buf_unpin. it's giving "clean up after yourself" energy and honestly? iconic. β¨
π RETURN π
0on success π- a negative error code on failure π
π§ SEE ALSO π§
the whole friend group, fr fr. kernel file ./drivers/dma-buf/dma-buf.c plus:
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_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(9)dma_buf_vmap_unlocked(9)dma_buf_vunmap(9)dma_buf_vunmap_unlocked(9)
that's the whole page, bestie, u ate that π β¨
and before u go β cute sign-off time π this one lives at ./drivers/dma-buf, it's stamped October 2026, and it's filed under dma_buf_pin(9) in the Kernel API Manual. mwah, go pin something responsibly π«Άπ
π¦ 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