drm_prime_pages_to_sg(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 operation
  • pages β€” pointer to the array of page pointers you're converting πŸ—‚οΈ yes, pointer-to-array-of-pointers, it's that kind of party
  • nr_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 🫢:


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