drm_gem_prime_import_dev(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… drm_gem_prime_import_dev β€” core implementation of the import callback πŸ‘‘

okay so real talk, we're in the Kernel API Manual, bestie. This is the DRM/graphics part of the kernel and honestly? it's giving main character energy ✨


πŸŽ€ NAME πŸŽ€

drm_gem_prime_import_dev β€” literally the core implementation of the import callback. that's it, that's the vibe πŸ’–


✨ SYNOPSIS ✨

struct drm_gem_object * drm_gem_prime_import_dev (struct drm_device *dev
, struct dma_buf *dma_buf , struct device *attach_dev );

like, three args, one struct drm_gem_object * coming back at you. no cap 🫢


🌸 ARGUMENTS 🌸

  • dev β€” the drm_device you're importing into 🏠
  • dma_buf β€” the dma-buf object being imported, the whole reason we're here πŸ¦‹
  • attach_dev β€” the struct device that gets dma_buf attach duty πŸ’…

πŸ’œ DESCRIPTION πŸ’œ

So. This is the actual core of drm_gem_prime_import, highkey the moment everyone's been waiting for. It's designed to be called by drivers who want to use a different device structure than drm_device.dev for attaching via dma_buf. iykyk β€” you want a custom attach device, this is your girl 🌈

Under the hood it calls drm_driver.gem_prime_import_sg_table internally. Like, that's not optional, that's just what happens ⭐

🚨 listen up bestie, this is the important part 🚨 Drivers must arrange to call drm_prime_gem_destroy from their drm_gem_object_funcs.free hook when using this function. Not "should", not "maybe", must. don't fumble this one fr fr 😭

πŸ¦‹ SEE ALSO πŸ¦‹

the whole friend group, ok:


k bye ily, go call drm_prime_gem_destroy from your drm_gem_object_funcs.free hook πŸ’œ

this page came straight outta ./drivers/gpu/drm, dated October 2026, and yes it's still called drm_gem_prime_import_dev(9) β€” slay πŸŽ€βœ¨

πŸ“¦ where this page comes from