drm_gem_map_attach(9)
π drm_gem_map_attach(9) β like, the GEM dma_buf attach situation π
okay bestie, welcome to the Kernel API Manual β¨ this one's a tiny little function with main character energy, so let's get into it π«Ά
β¨ NAME β¨
drm_gem_map_attach β the dma_buf attach implementation for GEM, periodt π«
πΈ SYNOPSIS πΈ
int drm_gem_map_attach (struct dma_buf *dma_buf , struct
dma_buf_attachment *attach );
π ARGUMENTS π
dma_bufβ the buffer you're attaching the device to, no cap π¦attachβ the buffer attachment data itself, iconic π
π₯ DESCRIPTION π₯
So here's the tea β β this function calls drm_gem_object_funcs.pin so the device-specific handling can do its thing. Literally that's the vibe.
You can use this as the dma_buf_ops.attach callback, iykyk π
β οΈ bestie listen: it Must be used together with drm_gem_map_detach. Like, they're a matching set, don't separate them π
And the returns? Returns 0 on success, and a negative error code on failure. That's it, that's the whole energy π
π SEE ALSO π
the way that this list just goes on and on β but every single one matters, so here we go, all of them, in order, exactly as they are π§:
- Kernel file
./drivers/gpu/drm/drm_prime.coverview and lifetime rules(9) drm_gem_dmabuf_export(9)drm_gem_dmabuf_release(9)drm_gem_prime_fd_to_handle(9)drm_gem_prime_handle_to_dmabuf(9)drm_gem_prime_handle_to_fd(9)- PRIME Helpers(9)
drm_gem_map_detach(9)drm_gem_map_dma_buf(9)drm_gem_unmap_dma_buf(9)drm_gem_dmabuf_vmap(9)drm_gem_dmabuf_vunmap(9)drm_gem_prime_mmap(9)drm_gem_dmabuf_mmap(9)drm_prime_pages_to_sg(9)drm_prime_get_contiguous_size(9)drm_gem_prime_export(9)drm_gem_is_prime_exported_dma_buf(9)drm_gem_prime_import_dev(9)drm_gem_prime_import(9)drm_prime_sg_to_page_array(9)drm_prime_sg_to_dma_addr_array(9)drm_prime_gem_destroy(9)
β¨ and that's the whole page bestie β¨ this iconic little number lives in ./drivers/gpu/drm, dated October 2026 β screenshot it, bookmark it, obsess over it πππ¦
π¦ 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