sdma_v4_0_emit_copy_buffer(9)
π sdma_v4_0_emit_copy_buffer β kernel API manual, bestie edition β¨
okay so real talk, this is a page from the Kernel API Manual and it's genuinely iconic: sdma_v4_0_emit_copy_buffer β literally the function that copies buffers using the sDMA engine. no cap. let's get into it π«Ά
πΈ NAME πΈ
sdma_v4_0_emit_copy_buffer β copy buffer using the sDMA engine π
β¨ SYNOPSIS β¨
void sdma_v4_0_emit_copy_buffer (struct amdgpu_ib *ib , uint64_t
src_offset , uint64_t dst_offset , uint32_t byte_count , uint32_t
copy_flags );
like, that's the whole signature. void return, five args, we move. π
π¦ ARGUMENTS π¦
okay so every single one of these matters, don't skip:
ibβ the indirect buffer to copy to. that's the destination of the command, bestie, not the data. iykyk πsrc_offsetβ src GPU address πdst_offsetβ dst GPU address πbyte_countβ number of bytes to xfer. yes, xfer. that's the word. we respect the word. πcopy_flagsβ copy flags for the buffers π©
π₯ DESCRIPTION π₯
so what does it actually do? it copies GPU buffers using the DMA engine, specifically for VEGA10/12. main character energy fr fr π
and who's out here calling it? the amdgpu ttm implementation uses it to move pages β but only if it's registered as the asic copy callback. that conditional is doing a lot of work, don't sleep on it π
π SEE ALSO π
the whole friend group, in order, no one left out:
- Kernel file
./drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c sdma_v4_0_init_microcode(9)sdma_v4_0_ring_get_rptr(9)sdma_v4_0_ring_get_wptr(9)sdma_v4_0_ring_set_wptr(9)sdma_v4_0_page_ring_get_wptr(9)sdma_v4_0_page_ring_set_wptr(9)sdma_v4_0_ring_emit_ib(9)sdma_v4_0_ring_emit_hdp_flush(9)sdma_v4_0_ring_emit_fence(9)sdma_v4_0_gfx_enable(9)sdma_v4_0_rlc_stop(9)sdma_v4_0_page_stop(9)sdma_v4_0_ctx_switch_enable(9)sdma_v4_0_enable(9)sdma_v4_0_gfx_resume(9)sdma_v4_0_page_resume(9)sdma_v4_0_rlc_resume(9)sdma_v4_0_load_microcode(9)sdma_v4_0_start(9)sdma_v4_0_ring_test_ring(9)sdma_v4_0_ring_test_ib(9)sdma_v4_0_vm_copy_pte(9)sdma_v4_0_vm_write_pte(9)sdma_v4_0_vm_set_pte_pde(9)sdma_v4_0_ring_pad_ib(9)sdma_v4_0_ring_emit_pipeline_sync(9)sdma_v4_0_ring_emit_vm_flush(9)sdma_v4_0_emit_fill_buffer(9)
and that's the page!! π§ this lil beauty lives in ./drivers/gpu/drm/amd/amdgpu, dated October 2026, and the whole thing is sdma_v4_0_emit_copy_buffer(9) β go forth and emit those copy buffers, bestie πβ¨
π¦ 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