amdgpu_dma_buf_map(9)
π amdgpu_dma_buf_map(9) β your fave kernel API manual, bestie
okay so this whole page lives in the Kernel API Manual, and the star of the show is amdgpu_dma_buf_map β literally the &dma_buf_ops.map_dma_buf implementation. no cap, that's the whole vibe. π¦
β¨ NAME β¨
amdgpu_dma_buf_map β bestie, this is the &dma_buf_ops.map_dma_buf implementation, that's it, that's the name π
πΈ SYNOPSIS πΈ
struct sg_table * amdgpu_dma_buf_map (struct dma_buf_attachment *attach
, enum dma_data_direction dir );
like, look at her. iconic signature. π
π§ ARGUMENTS π§
attachβ the DMA-buf attachment π like, the whole connection, the situationship between the buffer and the device.dirβ the DMA direction π which way the data's flowing, iykyk.
π DESCRIPTION π
so what does she do? she makes absolutely sure the shared DMA buffer can be accessed by the target device. that's the job. that's the assignment and she ate. π₯
for now? she simply pins it to the GTT domain β and that's the whole move, because that's where it should be accessible by all DMA devices. lowkey elegant, highkey necessary. π
β RETURN β
on a good day you get an sg_table filled with the DMA addresses to use β¨
and on a bad day? ERR_PRT with a negative error code ππ β that's the error vibe check failing, fr fr.
π«Ά SEE ALSO π«Ά
bestie, the whole friend group is here, like a group chat that never sleeps:
- kernel file
./drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c 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_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_gem_prime_import(9)amdgpu_dmabuf_is_xgmi_accessible(9)
ok that's the whole page, go read the source bestie, mwah π
and finally, the cute little sign-off: this lil masterpiece comes from ./drivers/gpu/drm/amd/amdgpu, dated October 2026, and it's amdgpu_dma_buf_map(9) β periodt. ππ
π¦ 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