drm_prime_sg...a_addr_array(9)
π drm_prime_sg_to_dma_addr_array π
okay bestie, welcome to the Kernel API Manual β¨ this one's a kernel function page, and it's lowkey a little workhorse β it takes your scatter-gather table and turns it into a dma addr array. no cap, that's the whole vibe. let's get into it π«Ά
πΈ NAME πΈ
drm_prime_sg_to_dma_addr_array β convert an sg table into a dma addr array
like... it literally does what it says on the tin π
β¨ SYNOPSIS β¨
int drm_prime_sg_to_dma_addr_array (struct sg_table *sgt , dma_addr_t
*addrs , int max_entries );
that's the whole signature, keep it exactly like that, no editing bestie π
π ARGUMENTS π
sgtβ the scatter-gather table we're converting. this is the thing you're pulling pages/addresses out of π¦addrsβ the array where the dma bus address of each page gets stored. it's the destination, the main character of storage here πmax_entriesβ the size of both the passed-in arrays. yes, both. it's doing double duty, iconic π
π DESCRIPTION π
So here's the tea: this function exports an sg table into an array of addresses. that's it, that's the job π
And drivers should use this in their drm_driver.gem_prime_import_sg_table implementation. fr fr, that's the intended spot for it β don't just sprinkle it around like glitter, put it where it belongs β¨
π¦ SEE ALSO π¦
- 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_gem_prime_import(9)drm_prime_sg_to_page_array(9)drm_prime_gem_destroy(9)
like, that's the whole friend group right there β go read them too, iykyk π
ok and that's a wrap on this one π every single cross-reference survived the vibe check, so go be a main character in drm_prime.c π§
sign-off time, bestie: this page lives under ./drivers/gpu/drm, and it's dated October 2026 π 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