amdgpu_gem_prime_import(9)
π 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:
PRIME Buffer Sharing(9)dma_buf_attach_adev(9)amdgpu_dma_buf_attach(9)amdgpu_dma_buf_detach(9)amdgpu_dma_buf_pin(9)amdgpu_dma_buf_unpin(9)amdgpu_dma_buf_map(9)amdgpu_dma_buf_unmap(9)amdgpu_dma_buf_begin_cpu_access(9)amdgpu_gem_prime_export(9)amdgpu_dma_buf_create_obj(9)amdgpu_dma_buf_move_notify(9)amdgpu_dmabuf_is_xgmi_accessible(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms