drm_gem_dmabuf_vmap(9)
π drm_gem_dmabuf_vmap(9) β like, the Kernel API Manual page for it, bestie π
okay so this is drm_gem_dmabuf_vmap from the Kernel API Manual, and it's literally the whole "dma_buf vmap implementation for GEM" situation. yes that's the NAME section, don't @ me β¨
πΈ SYNOPSIS πΈ
int drm_gem_dmabuf_vmap (struct dma_buf *dma_buf , struct iosys_map *map );
like, it takes two things and returns an int. that's it. that's the whole vibe π«Ά
π¦ ARGUMENTS π¦
dma_bufβ the buffer that's getting mapped, bestie. the actual thing. πmapβ the virtual address of the buffer. where it goes. π
π DESCRIPTION π
So what it does β it sets up a kernel virtual mapping. no cap, that's the job. π§
You can use this as the dma_buf_ops.vmap callback β like, that's genuinely what it's for, iykyk. It then calls into drm_gem_object_funcs.vmap for the device specific handling, because the driver gets to have its main character moment too. π
The kernel virtual address is returned in map. so that's where you look for it, okay? don't go hunting elsewhere. π
It returns 0 on success, or a negative errno code otherwise. periodt. π
β SEE ALSO β
okay this list is long bestie, but here's the whole thing, no skipping, we eat the whole plate π:
- 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_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)
ngl the whole PRIME friend group is here. read the ./drivers/gpu/drm/drm_prime.c overview first if you want the lore, and definitely check the lifetime rules because lifetime stuff is where things get spicy π
π sign-off π
this lil page lives in ./drivers/gpu/drm (yes, the source folder, that tracks), dated October 2026. that's the version and the date, mentioned cutely, as one does. bye bestie, go map something πβ¨π
π¦ 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