drm_gem_shmem_get_pages_sgt(9)
β¨ drm_gem_shmem_get_pages_sgt β the kernel API manual, but make it make sense β¨
okay so bestie, welcome to drm_gem_shmem_get_pages_sgt(9) π β the one where we pin pages, dma map them, and hand you back a scatter/gather table for a shmem GEM object. yes that's a lot of words, stay with me π
πΈ SYNOPSIS πΈ
struct sg_table * drm_gem_shmem_get_pages_sgt (struct
drm_gem_shmem_object *shmem );
like, literally that's the whole call. go off king π
π¦ ARGUMENTS π¦
shmemβ your shmem GEM object. that's it, that's the whole argument. she's low maintenance π
π DESCRIPTION π
okay so here's the tea β β this function returns a scatter/gather table suitable for driver usage. like a little gift, wrapped, ready to go π
and if that sg table doesn't already exist? no worries bestie, it gets made: the pages are pinned, dma-mapped, and a sg table is created. brand new, fresh out the packaging β¨
this is the main function for drivers to get at backing storage, and it hides the difference between dma-buf imported and natively allocated objects. so you don't gotta check which one you're holding β she does it for you π«Ά
π¨ and listen, bestie, important: drm_gem_shmem_get_sg_table should not be directly called by drivers. like do not. the audacity would be unmatched π this function is the one you go through. periodt.
π₯ RETURN π₯
a pointer to the scatter/gather table of pinned pages β or an errno on failure π so like, vibe check your return value, always π
β SEE ALSO β
go read these too, i'm obsessed with all of them tbh π
- Kernel file
./drivers/gpu/drm/drm_gem_shmem_helper.c overview(9)drm_gem_shmem_init(9)drm_gem_shmem_create(9)drm_gem_shmem_release(9)drm_gem_shmem_free(9)drm_gem_shmem_pin(9)drm_gem_shmem_unpin(9)drm_gem_shmem_create_with_handle(9)drm_gem_shmem_dumb_create(9)drm_gem_shmem_mmap(9)drm_gem_shmem_print_info(9)drm_gem_shmem_get_sg_table(9)drm_gem_shmem_prime_import_sg_table(9)drm_gem_shmem_prime_import_no_map(9)
and that's a wrap bestie π this lil gem lives down in ./drivers/gpu/drm, dated October 2026 β go forth, pin those pages, slay π
β¨π¦π
π¦ 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