drm_gem_dmabuf_export(9)
π drm_gem_dmabuf_export(9) β like, the Kernel API Manual page, bestie
okay so this is drm_gem_dmabuf_export, straight out of the Kernel API Manual, and it's lowkey the glue that makes GEM buffers escape into dmabuf land β¨
β¨ NAME β¨
drm_gem_dmabuf_export β the &dma_buf export implementation for GEM, no cap π
π¦ SYNOPSIS π¦
struct dma_buf * drm_gem_dmabuf_export (struct drm_device *dev , struct
dma_buf_export_info *exp_info );
like, that's the whole signature. she's short, she's iconic, she does exactly one thing π
πΈ ARGUMENTS πΈ
devβ the parent device for the exported dmabuf π«Ά like, the actual grown-up device this thing belongs to.exp_infoβ the export information used bydma_buf_exportπ everything else she needs to know lives in here.
π₯ DESCRIPTION π₯
okay so picture this: this function wraps dma_buf_export for generic GEM drivers that are using drm_gem_dmabuf_release. it's giving "convenience wrapper, but make it safe" π
and it's not just calling dma_buf_export and dipping β nope, not her. in addition to calling dma_buf_export, we take a reference to the drm_device and to the exported drm_gem_object (which is stored in dma_buf_export_info.priv). those refs get released by drm_gem_dmabuf_release later, so the lifetime rules actually hold together. main character energy for real β¨
and the return value? returns the new dmabuf. slay π
π SEE ALSO π
bestie go read these, i'm literally begging:
- the Kernel file
./drivers/gpu/drm/drm_prime.coverview and lifetime rules(9) β start here fr fr 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_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)
okay that's the page!! π it lives under ./drivers/gpu/drm, it's dated October 2026, and it is absolutely still drm_gem_dmabuf_export(9) β mwah, go export some buffers 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