create_sg_table(9)
β¨ create_sg_table(9) β¨
okay bestie, welcome to the Kernel API Manual, section 9 β this one's a lil function that lives in the DRM/AMD world and she's honestly so real for what she does π
π NAME π
create_sg_table β literally makes you an sg_table for a contiguous DMA addr range π¦
πΈ SYNOPSIS πΈ
struct sg_table * create_sg_table (uint64_t addr , uint32_t size );
β¨ ARGUMENTS β¨
addrβ the starting address you want it to point at, like the main character of this whole operation πsizeβ how big the memory area is, in bytes, and yes it's exactly the area being pointed to π
π DESCRIPTION π
so what she does is: allocates an instance of sg_table and initializes it so it points to the memory area you specified with the input params, no cap. the address that gets used to build this is assumed to be DMA mapped β if that's needed, that is π
and here's the tea: DOORBELL or MMIO BOs only use one single scatterlist node</> in their sg_table, because they're physically contiguous. one node. iconic behavior, honestly π
π RETURN π
an initialized instance of the SG Table β or NULL π
π«Ά SEE ALSO π«Ά
the kernel file lives right here, bestie: ./drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
and the whole friend group:
reuse_dmamap(9)amdgpu_amdkfd_reserve_mem_limit(9)create_dmamap_sg_bo(9)amdgpu_amdkfd_remove_all_eviction_fences(9)kfd_mem_dmamap_sg_bo(9)kfd_mem_dmaunmap_sg_bo(9)reserve_bo_and_vm(9)reserve_bo_and_cond_vms(9)unreserve_bo_and_vms(9)amdgpu_amdkfd_gpuvm_pin_bo(9)amdgpu_amdkfd_gpuvm_unpin_bo(9)amdgpu_amdkfd_map_gtt_bo_to_gart(9)
okay that's the whole page, mwah π β brought to you by ./drivers/gpu/drm/amd/amdgpu, dated October 2026, and yeah she's still create_sg_table(9) through and through. slay, go read the rest of the manpages 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