drm_gem_shm...get_sg_table(9)
πΈ drm_gem_shmem_object_get_sg_table β the Kernel API Manual, bestie edition πΈ
okay so real talk, this is a page straight out of the Kernel API Manual and it's about one very specific little helper. ngl the name is a whole mouthful (the header literally abbreviates it to drm_gem_shm...get_sg_table(9) because even the manpage was like "girl I'm not typing all that"), so let's get into it π
β¨ NAME β¨
drm_gem_shmem_object_get_sg_table β the GEM object function that exists purely to serve drm_gem_shmem_get_sg_table(). it's giving "middle management but make it kernel" π
β¨ SYNOPSIS β¨
struct sg_table * drm_gem_shmem_object_get_sg_table (struct drm_gem_object *obj );
β¨ ARGUMENTS β¨
objβ the GEM object. that's it, that's the whole argument. one (1) object, no notes π¦
β¨ DESCRIPTION β¨
so what does it actually do? this function wraps drm_gem_shmem_get_sg_table. iconic behaviour, no cap.
here's the tea though π β if a driver is using the shmem helpers, it should totally use this function as its drm_gem_object_funcs.get_sg_table handler. like, that's literally its whole purpose in life. main character energy fr fr.
β¨ RETURN β¨
it hands you back a pointer to the scatter/gather table of pinned pages π β or, if something goes sideways, an error pointer on failure. so like, vibe check your return value before you dereference it, okay? π
β¨ SEE ALSO β¨
- the kernel file
./include/drm/drm_gem_shmem_helper.h - struct
drm_gem_shmem_object(9) drm_gem_shmem_object_free(9)drm_gem_shmem_object_print_info(9)drm_gem_shmem_object_pin(9)drm_gem_shmem_object_unpin(9)drm_gem_shmem_object_mmap(9)DRM_GEM_SHMEM_DRIVER_OPS(9)
go read those too, they're all in the same friend group π«Ά
lowkey reminder: this page lives under ./include/drm, and it's dated October 2026. yes, the future. we're ahead of schedule β¨π
anyway bestie that's the whole page, you ate that reading session up, 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