drm_gem_prime_import(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… drm_gem_prime_import(9) πŸ’…

okay so bestie, welcome to the Kernel API Manual β€” this is the page for drm_gem_prime_import(9), and honestly it's giving "small function, big responsibilities" energy. let's get into it πŸŽ€


✨ NAME ✨

drm_gem_prime_import β€” the helper-library implementation of the import callback. that's it, that's the vibe πŸ¦‹


🌸 SYNOPSIS 🌸

struct drm_gem_object * drm_gem_prime_import (struct drm_device *dev ,
struct dma_buf *dma_buf );

πŸ’– ARGUMENTS πŸ’–

  • dev β€” the drm_device you're importing into. like, where's it going. 🏠
  • dma_buf β€” the dma-buf object you're importing. the actual thing being brought in. πŸ“¦

🧚 DESCRIPTION 🧚

so this is the actual implementation of the gem_prime_import functions for GEM drivers that are using the PRIME helpers. drivers can literally just use this as their drm_driver.gem_prime_import implementation β€” no cap, it's plug-and-play like that. πŸ’…

it's also used as the default implementation in drm_gem_prime_fd_to_handle, which is why you keep seeing it everywhere. main character energy fr fr πŸ‘‘

⚠️ okay important, do not skip this: drivers must arrange to call drm_prime_gem_destroy from their drm_gem_object_funcs.free hook when using this function. like, this is not optional, this is the whole cleanup situation and skipping it is a vibe check you will fail 😭

πŸ”₯ SEE ALSO πŸ”₯

so there's a lot of related reading here, and yes you should probably look at all of it:

like I said. a whole reading list. but it's fine, you got this 🫢


anyway that's the page!! hope this helped bestie, go import some dma-bufs responsibly 🌈

signing off from ./drivers/gpu/drm β€” October 2026 β€” this was drm_gem_prime_import(9), and she ate πŸ’…βœ¨

πŸ“¦ where this page comes from