amdgpu_bo_pin(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 β€” the amdgpu_bo buffer 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:

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