drm_prime_pages_to_sg(9)
π drm_prime_pages_to_sg β Kernel API Manual tea time π«Ά
okay so bestie, we're diving into drm_prime_pages_to_sg today β it's a lil helper from the Kernel API Manual and honestly it's giving "quietly does the most" energy. let's get into it β¨
β¨ NAME β¨
drm_prime_pages_to_sg β converts a page array into an sg list πΈ
bestie that's literally it. pages go in, sg list comes out. slay.
π¦ SYNOPSIS π¦
struct sg_table * drm_prime_pages_to_sg (struct drm_device *dev , struct
page **pages , unsigned int nr_pages );
π ARGUMENTS π
devβ the DRM device π» like, the whole vibe-check context for this operationpagesβ pointer to the array of page pointers you're converting ποΈ yes, pointer-to-array-of-pointers, it's that kind of partynr_pagesβ length of the page vector π how many pages we're working with, no cap
π₯ DESCRIPTION π₯
so this helper creates an sg table object from a set of pages π¦β¨ and heads up: the driver is responsible for mapping those pages into the importer's address space for use with dma_buf itself. like, that part is on you, bestie. the helper makes the sg table, the mapping responsibility is yours π
it's useful for implementing drm_gem_object_funcs.get_sg_table β iykyk, if you know you know π
π SEE ALSO π
the whole friend group, fr fr π«Ά:
- 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_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)
mwah π that's the whole page! this lil icon lives in ./drivers/gpu/drm and the version stamp is dated October 2026 β so yeah, mark your calendars bestie, future vibes only π¦βπ
π¦ 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