amdgpu_bo_pin(9)
π amdgpu_bo_pin(9) β literally the "pin this buffer" page π
okay so bestie, welcome to the Kernel API Manual for amdgpu_bo_pin β this is a kernel-level manpage from the AMDGPU DRM crew, and I'm gonna walk you through it like we're texting at 2am π¦
β¨ NAME β¨
amdgpu_bo_pin β pin an &amdgpu_bo buffer object π
πΈ SYNOPSIS πΈ
int amdgpu_bo_pin (struct amdgpu_bo *bo , u32 domain );
that's the whole signature, no cap β returns an int, takes a struct amdgpu_bo * and a u32 domain β
π ARGUMENTS π
boβ theamdgpu_bobuffer object that's getting pinned, she's the main character here πdomainβ the domain you're pinning her to, like picking which neighborhood she lives in π‘
π«Ά DESCRIPTION π«Ά
So what does it actually do? It pins the buffer object according to the requested domain. Simple as that. β¨
And if the memory happens to be unbound gart memory, it binds the pages into the gart table β yes, it's doing that behind the scenes, love that for it. It also adjusts pin_count and pin_size accordingly, keeping the bookkeeping cute and accurate π
now the important part, because this is the whole point of pinning:
Pinning means to lock pages in memory along with keeping them at a fixed offset. It's required when a buffer can not be moved β for example, when a display buffer is being scanned out. π Like, imagine the display is reading that memory right now and you just... move it? no ma'am. That's why pinning exists, it's literally protection energy π‘οΈ
π₯ RETURN π₯
0 for success, or a negative error code on failure. That's it β classic zero-means-slay, negative-means-uh-oh π
π SEE ALSO π
okay this list is long but we're listing every single one because every single one matters, periodt π
Kernel file:
./drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
and the whole friend group:
amdgpu_object(9)amdgpu_bo_is_amdgpu_bo(9)amdgpu_bo_placement_from_domain(9)amdgpu_bo_create_reserved(9)amdgpu_bo_create_kernel(9)amdgpu_bo_create_isp_user(9)amdgpu_bo_create_kernel_at(9)amdgpu_bo_free_kernel(9)amdgpu_bo_free_isp_user(9)amdgpu_bo_create(9)amdgpu_bo_create_user(9)amdgpu_bo_create_vm(9)amdgpu_bo_kmap(9)amdgpu_bo_kptr(9)amdgpu_bo_kunmap(9)amdgpu_bo_ref(9)amdgpu_bo_unref(9)amdgpu_bo_unpin(9)amdgpu_bo_init(9)amdgpu_bo_fini(9)amdgpu_bo_set_tiling_flags(9)amdgpu_bo_get_tiling_flags(9)amdgpu_bo_set_metadata(9)amdgpu_bo_get_metadata(9)amdgpu_bo_move_notify(9)amdgpu_bo_release_notify(9)amdgpu_bo_fault_reserve_notify(9)amdgpu_bo_fence(9)amdgpu_bo_sync_wait_resv(9)amdgpu_bo_sync_wait(9)amdgpu_bo_gpu_offset(9)amdgpu_bo_fb_aper_addr(9)amdgpu_bo_gpu_offset_no_check(9)amdgpu_bo_mem_stats_placement(9)amdgpu_bo_get_preferred_domain(9)amdgpu_bo_print_info(9)
iykyk π
ngl bestie, the takeaway is: pin = lock the pages and fix the offset, and it's non-negotiable when the buffer can't be moved. Everything else is just the receipts π§
and that's the page!! brought to you by ./drivers/gpu/drm/amd/amdgpu, dated October 2026, filed under amdgpu_bo_pin(9) β stan a kernel API that knows exactly where its pages live πβ¨π
π¦ 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