amdgpu_dma_...n_cpu_access(9)
π amdgpu_dma_...n_cpu_access(9) β like, the Kernel API Manual era π
okay so bestie, welcome to the Kernel API Manual, and today's main character is amdgpu_dma_...n_cpu_access(9). yes the title is abbreviated with ellipsis, no that's not a typo, that's just how the man page do. let's get into it β¨
πΈ NAME πΈ
amdgpu_dma_buf_begin_cpu_access β literally the implementation of &dma_buf_ops.begin_cpu_access. that's it, that's the vibe. it's giving "I'm the callback behind the callback" energy π
π¦ SYNOPSIS π¦
int amdgpu_dma_buf_begin_cpu_access (struct dma_buf *dma_buf , enum
dma_data_direction direction );
like, that's the whole signature. int in, int out, two args, slay. π₯
π ARGUMENTS π
dma_bufβ a shared DMA buffer. the buffer in question. the shared one. you know the one π«Άdirectionβ the direction of the DMA transfer. which way is the data going, bestie? this tells you π§
β¨ DESCRIPTION β¨
so this one gets called before CPU access to the shared DMA buffer's memory β like a little heads-up text before you show up π
and here's the cute part: if it's a read access, the buffer gets moved to the GTT domain if possible, because that's for optimal CPU read performance π lowkey a glow-up for your read speeds, ngl.
note: it's if possible β the man page says so, so we say so. no cap.
π RETURN π
0on success π- a negative error code on failure π
π SEE ALSO π
kernel file: ./drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
and the whole friend group, in order, because we don't skip anyone in this house:
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_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)
like, the entire squad. obsessed. π
mwah π that's the page! brought to you by the fine folks at ./drivers/gpu/drm/amd/amdgpu, stamped October 2026, and yeah we're still on amdgpu_dma_...n_cpu_access(9) β the ellipsis is forever iconic, 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