drm_gem_dma_...g_table_vmap(9)
π drm_gem_dma_...g_table_vmap π
okay bestie, so this is a page straight out of the Kernel API Manual (section 9, kernel space, we're fancy like that) β the function is literally called drm_gem_dma_...g_table_vmap and yes the name got cut off mid-vibe, that's just how the title renders, don't come for me. π«Ά
β¨ NAME β¨
drm_gem_dma_prime_import_sg_table_vmap β PRIME import another driver's scatter/gather table and get the virtual address of the buffer. two things at once, main character multitasking energy. π
πΈ SYNOPSIS πΈ
struct drm_gem_object * drm_gem_dma_prime_import_sg_table_vmap (struct
drm_device *dev , struct dma_buf_attachment *attach , struct sg_table
*sgt );
π ARGUMENTS π
devβ the DRM device. the whole ecosystem, basically. πattachβ the DMA-BUF attachment. the situationship between the buffer and the device, iykyk. π¦sgtβ scatter/gather table of pinned pages. little bits of memory, all gathered up, slay. β¨
π DESCRIPTION π
so the way this works: it imports a scatter/gather table using drm_gem_dma_prime_import_sg_table, and then it hits dma_buf_vmap to get the kernel virtual address. basically it makes absolutely sure a DMA GEM object always has its virtual address set β no object left behind, no cap. π₯ and that address? released automatically when the object is freed. built-in cleanup, we love to see it. π§
it can be used as the drm_driver.gem_prime_import_sg_table callback. and if you're feeling efficient (you are, you're iconic), the DRM_GEM_DMA_DRIVER_OPS_VMAP macro is the shortcut that sets up all the necessary DRM driver operations for you. one macro, zero stress. β
π RETURN π
a pointer to a newly created GEM object β adorable, fresh out the box π β or an ERR_PTR-encoded negative error code if it fails π. so like, always check. always. fr fr.
π¦ SEE ALSO π¦
kernel file ./drivers/gpu/drm/drm_gem_dma_helper.c β the home base π β plus the whole friend group:
dma helpers(9)__drm_gem_dma_create(9)drm_gem_dma_create(9)drm_gem_dma_create_with_handle(9)drm_gem_dma_free(9)drm_gem_dma_dumb_create_internal(9)drm_gem_dma_dumb_create(9)drm_gem_dma_get_unmapped_area(9)drm_gem_dma_print_info(9)drm_gem_dma_get_sg_table(9)drm_gem_dma_prime_import_sg_table(9)drm_gem_dma_vmap(9)drm_gem_dma_mmap(9)
ok that's the whole page, go read the source if you want more lore π
sign-off time, besties π«Ά this one lives in ./drivers/gpu/drm, and it's stamped October 2026 β the version vibes are immaculate, drm_gem_dma_...g_table_vmap(9) forever πβ¨ no cap, periodt.
π¦ 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