amdgpu_ttm_map_buffer(9)
π amdgpu_ttm_map_buffer(9) β the kernel API manual, but make it cute
okay so bestie, welcome to the amdgpu_ttm_map_buffer page from the Kernel API Manual β¨ this one's a little function with a big job and honestly? she ate.
πΈ NAME πΈ
amdgpu_ttm_map_buffer β literally just: map memory into the GART windows π«Ά
π SYNOPSIS π
int amdgpu_ttm_map_buffer (struct amdgpu_ttm_buffer_entity *entity ,
struct ttm_buffer_object *bo , struct ttm_resource *mem , struct
amdgpu_res_cursor *mm_cur , unsigned int window , bool tmz , uint64_t
*size , uint64_t *addr , bool *vm_needs_flush );
like, nine whole arguments. she's high-maintenance but she delivers π
β¨ ARGUMENTS β¨
entityβ the entity that's gonna run the window setup job. she's the main character here, no cap πboβ the buffer object we're mapping. the what πmemβ the memory object we're mapping. also the what, but different π¦mm_curβ the range to map. just the slice we care about, periodt πΈwindowβ which GART window to use. you gotta pick one, bestie, no window-hopping πtmzβ whether we should set up a TMZ enabled mapping. yes/no situation fr frsizeβ in: number of bytes to map, out: number of bytes mapped. she's doing double duty and honestly? iconic π₯addrβ the resulting address inside the MC address space. where it ended up living β¨vm_needs_flushβ out param π« set totrueif a GART window was programmed (that means a VMID 0 flush is needed), orfalsefor a direct address. so like, a little note passed back to you π«Ά
π DESCRIPTION π
So what does she actually do? Setup one of the GART windows to access a specific piece of memory β or, alternatively, just return the physical address for local memory. two vibes, one function. we love a flexible queen π
π SEE ALSO π
Kernel file ./drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
and her whole friend group, because she does not go anywhere alone:
amdgpu_evict_flags(9)amdgpu_ttm_copy_mem_to_mem(9)amdgpu_res_cpu_visible(9)amdgpu_ttm_domain_start(9)amdgpu_ttm_mmio_remap_alloc_sgt(9)amdgpu_ttm_tt_create(9)amdgpu_ttm_tt_get_userptr(9)amdgpu_ttm_tt_set_userptr(9)amdgpu_ttm_tt_pde_flags(9)amdgpu_ttm_tt_pte_flags(9)amdgpu_ttm_access_memory(9)amdgpu_ttm_training_reserve_vram_fini(9)amdgpu_ttm_alloc_mmio_remap_bo(9)amdgpu_ttm_free_mmio_remap_bo(9)amdgpu_ttm_enable_buffer_funcs(9)amdgpu_ttm_disable_buffer_funcs(9)amdgpu_ttm_clear_buffer(9)amdgpu_ttm_evict_resources(9)
π reminder bestie:sizeandaddrare out params andvm_needs_flushis out β so don't come crying when your values change after the call, that's literally the whole point π
and that's the page! this one lives under ./drivers/gpu/drm/amd/amdgpu in the October 2026 edition of the Kernel API Manual, so if you're reading this in October 2026... hi, ily, go map some buffers π§π β
π¦ 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