drm_gem_dmabuf_mmap(9)
π drm_gem_dmabuf_mmap(9) β the Kernel API Manual page your bestie needed
okay so picture this: you're deep in the Kernel API Manual, flipping through pages, and you land on drm_gem_dmabuf_mmap(9). and honestly? she's a short one. a little icon, a little legend. let's get into it π
β¨ NAME β¨
drm_gem_dmabuf_mmap β the dma_buf mmap implementation for GEM, no cap π
πΈ SYNOPSIS πΈ
int drm_gem_dmabuf_mmap (struct dma_buf *dma_buf , struct vm_area_struct
*vma );
like, that's the whole signature. two args, one int coming back at you. periodt.
π¦ ARGUMENTS π¦
dma_bufβ the buffer that's getting mapped. she's the main character here π«Άvmaβ the virtual address range. the vibes zone, if you will β¨
π DESCRIPTION π
so what does she actually do? she provides the memory mapping for the buffer. that's it, that's the job π
and the cool part: you can literally use her as the dma_buf_ops.mmap callback. plug her right in, she's built for it. then she just forwards everything to drm_gem_prime_mmap β no extra drama, no side quests, just a clean handoff π§
returns 0 on success, or a negative error code if it fails π literally that simple.
π₯ SEE ALSO π₯
okay bestie, this list is long, so buckle up β every single one of these is getting its moment π
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_attach(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_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)
likeβ¦ go read them. all of them. i'll wait π
ngl this one's basically a fancy relay race β she catches themmapand passes it straight todrm_gem_prime_mmap. short page, iconic behaviour π
and that's the whole page, bestie!! source lives at ./drivers/gpu/drm and this cutie is dated October 2026 β mwah, go forth and map your buffers π
ππ
π¦ 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