drm_gem_dma...ort_sg_table(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ drm_gem_dma_prime_import_sg_table β€” a whole little manual page from the Kernel API Manual ✨

okay bestie, gather round, because this one is genuinely such a neat little function and i need you to understand it πŸ’–

🌸 NAME 🌸

drm_gem_dma_prime_import_sg_table β€” the function that produces a DMA GEM object out of another driver's scatter/gather table of pinned pages. it's giving "borrowed your notes but made them my whole personality" energy 🫢


✨ SYNOPSIS ✨

struct drm_gem_object * drm_gem_dma_prime_import_sg_table (struct drm_device *dev , struct dma_buf_attachment *attach , struct sg_table *sgt );

like, that's the whole vibe right there. three args in, one pointer out 🌈


πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” the device you're importing into. your home base πŸ’…
  • attach β€” the DMA-BUF attachment. yes, that one πŸ¦‹
  • sgt β€” the scatter/gather table of pinned pages. the whole reason we're here ⭐

πŸ’œ DESCRIPTION πŸ’œ

okay so real talk: this function imports a scatter/gather table that some other driver exported via DMA-BUF. very "collab era" of it 🀝

but here's the caveat bestie, and it's a big one β€” imported buffers must be physically contiguous in memory. and no, that's not a soft suggestion, it's literally spelled out: the scatter/gather table must contain a single entry. one. uno. that's it. 😭

and if you're a driver that uses the DMA helpers? you should set this function as your drm_driver.gem_prime_import_sg_table callback. that's the assignment. periodt πŸ‘‘


πŸ”₯ RETURN πŸ”₯

on success you get a pointer to a newly created GEM object ✨ β€” and on failure you get an ERR_PTR-encoded negative error code. so like, check it properly, don't just vibe-check the pointer and move on, i'm begging πŸ™ˆ


πŸ‘‘ SEE ALSO πŸ‘‘


heads up babe: that single-entry requirement is not decorative. physically contiguous or bust πŸ’€

and that's the page!! sourced from ./drivers/gpu/drm, dated October 2026 β€” so go forth, import those sg tables responsibly, and remember: single entry only, no cap πŸ’–πŸ¦‹πŸŽ€βœ¨

πŸ“¦ where this page comes from