drm_gem_prime_import(9)
π drm_gem_prime_import(9) π
okay so bestie, welcome to the Kernel API Manual β this is the page for drm_gem_prime_import(9), and honestly it's giving "small function, big responsibilities" energy. let's get into it π
β¨ NAME β¨
drm_gem_prime_import β the helper-library implementation of the import callback. that's it, that's the vibe π¦
πΈ SYNOPSIS πΈ
struct drm_gem_object * drm_gem_prime_import (struct drm_device *dev ,
struct dma_buf *dma_buf );
π ARGUMENTS π
devβ thedrm_deviceyou're importing into. like, where's it going. πdma_bufβ the dma-buf object you're importing. the actual thing being brought in. π¦
π§ DESCRIPTION π§
so this is the actual implementation of the gem_prime_import functions for GEM drivers that are using the PRIME helpers. drivers can literally just use this as their drm_driver.gem_prime_import implementation β no cap, it's plug-and-play like that. π
it's also used as the default implementation in drm_gem_prime_fd_to_handle, which is why you keep seeing it everywhere. main character energy fr fr π
β οΈ okay important, do not skip this: drivers must arrange to calldrm_prime_gem_destroyfrom theirdrm_gem_object_funcs.freehook when using this function. like, this is not optional, this is the whole cleanup situation and skipping it is a vibe check you will fail π
π₯ SEE ALSO π₯
so there's a lot of related reading here, and yes you should probably look at all of it:
- 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_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_prime_sg_to_page_array(9)drm_prime_sg_to_dma_addr_array(9)drm_prime_gem_destroy(9)
like I said. a whole reading list. but it's fine, you got this π«Ά
anyway that's the page!! hope this helped bestie, go import some dma-bufs responsibly π
signing off from ./drivers/gpu/drm β October 2026 β this was drm_gem_prime_import(9), and she ate π
β¨
π¦ 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