amdgpu_gem_prime_import(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… amdgpu_gem_prime_import(9) ✨

okay so bestie, you found it β€” the amdgpu_gem_prime_import(9) page from the Kernel API Manual πŸŽ€. It's short, it's sweet, it's giving "tiny function, big responsibilities", and we're gonna go through it together, no cap.


🌸 NAME 🌸

amdgpu_gem_prime_import β€” literally the &drm_driver.gem_prime_import implementation. that's it, that's the whole name. it's the import half of the PRIME story, and yes, the export half is also in this family, keep scrolling 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

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

it returns a struct drm_gem_object *, takes two args, and tbh the signature is longer than the description. iconic behavior honestly 😭


πŸ’– ARGUMENTS πŸ’–

  • dev β€” the DRM device. your GPU's little home address, basically 🏠
  • dma_buf β€” the shared DMA buffer. the thing being imported, the guest of honor πŸ‘‘

✨ DESCRIPTION ✨

so what does it do? it imports a dma_buf into the driver, and β€” key detail, don't skip it β€” it potentially creates a new GEM object. "potentially" is doing a lot of work in that sentence and we respect it πŸ’…

bestie note: the description says potentially, so don't go assuming a fresh GEM object is guaranteed every single time. that's just what the page says, and we're not out here inventing facts πŸ”₯

⭐ RETURN ⭐

it hands you back the GEM BO that represents the shared DMA buffer for the given device. that's the whole vibe check result 🌈


πŸ‘‘ SEE ALSO πŸ‘‘

the kernel file is ./drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c β€” go read it if you're feeling main character energy. and here's the full friend group, no one left out:

like, the whole squad is here. attach, detach, pin, unpin, map, unmap, cpu access, export, create_obj, move_notify, xgmi accessibility β€” we love a complete cast 🌸


and that's the page, bestie! written out of ./drivers/gpu/drm/amd/amdgpu in October 2026, and yeah, the manual name up top is amdgpu_gem_prime_import(9) β€” go forth and import those buffers fr fr πŸ’œπŸŽ€βœ¨

πŸ“¦ where this page comes from