drm_gpuvm_bo_put(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… drm_gpuvm_bo_put(9) β€” from the Kernel API Manual, bestie πŸŽ€

okay so picture this: it's a Kernel API Manual kind of day, you've got a struct drm_gpuvm_bo in your hands, and you need to let go of one of its references. That's literally this function. No cap. ✨


🌸 NAME 🌸

drm_gpuvm_bo_put β€” drop a struct drm_gpuvm_bo reference. yes it's that simple and yes it still matters πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

bool drm_gpuvm_bo_put (struct drm_gpuvm_bo *vm_bo );

πŸŽ€ ARGUMENTS πŸŽ€

  • vm_bo β€” the drm_gpuvm_bo you're releasing the reference of. give it a little goodbye wave πŸ‘‹

✨ DESCRIPTION ✨

So this releases a reference to vm_bo. That's the whole bit. 🫢

But here's where it gets real: if the reference count drops to zero, the gpuvm_bo is destroyed, and that includes removing it from the GEM's gpuva list. So β€” if a call to this function can potentially let the reference count drop to zero, the caller must hold the lock that the GEM uses for its gpuva list. Which one? Either the GEM's dma-resv or gpuva.lock mutex. The GEM's dma-resv or the gpuva.lock mutex. Pick one, hold it, keep it. πŸ’…

⚠️ also, this function may only be called from non-atomic context. not atomic. do not pass go. not me making that mistake ever again 😭

πŸ’œ RETURN πŸ’œ

  • true if vm_bo was destroyed
  • false otherwise

that's it. that's the return. iconic honestly πŸ‘‘


πŸ”₯ SEE ALSO πŸ”₯

the whole friend group, fr fr β€” starting with the kernel file ./drivers/gpu/drm/drm_gpuvm.c:


and that's the tea β˜• this page lives in ./drivers/gpu/drm, stamped October 2026, and it goes by drm_gpuvm_bo_put(9). mwah πŸ’‹πŸ’–

πŸ“¦ where this page comes from