dma_resv_add_fence(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ dma_resv_add_fence β€” the Kernel API Manual, bestie edition ✨

Okay so picture this: you're in the Kernel API Manual, and this page is literally called dma_resv_add_fence. It's giving "add a fence to the dma_resv obj" and honestly? That's exactly what it does. No notes. πŸ’…


🌸 SYNOPSIS 🌸

void dma_resv_add_fence (struct dma_resv *obj , struct dma_fence *fence
, enum dma_resv_usage usage );

Like, that's it. That's the whole signature. Short king. πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

  • obj β€” the reservation object. The main character here, the one you're adding stuff to. 🫢
  • fence β€” the fence to add. Yes bestie, this is the thing going in. πŸ™ˆ
  • usage β€” how the fence is used, and it's literally see enum dma_resv_usage for the deets. iykyk. πŸ“–

πŸ’– DESCRIPTION πŸ’–

So here's the tea: this function adds a fence to a slot. That's the vibe. πŸ”₯

But not so fast β€” there are two conditions and you do not get to skip them. No cap.

  • obj must be locked with dma_resv_lock
  • and dma_resv_reserve_fences has been called
⚠️ fr fr, read those again. If you roll in here without the lock and without that reserve call, that's not a slay, that's a situation. 😭

Also, peep dma_resv.fence if you want the whole discussion of the semantics β€” that's where the lore lives. πŸ¦‹


πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./drivers/dma-buf/dma-resv.c, plus the whole friend group:


and that's the page, babe 🌈 This is dma_resv_add_fence(9) from the Kernel API Manual, living under ./drivers/dma-buf, dated October 2026. Go add your fence, lock your object first, and stay iconic πŸ‘‘πŸ’œπŸ“

πŸ“¦ where this page comes from