fence_init — Initialize a custom fence.
void fence_init ( | struct fence * fence, |
const struct fence_ops * ops, | |
spinlock_t * lock, | |
unsigned context, | |
unsigned seqno) ; |
fence
[in] the fence to initialize
ops
[in] the fence_ops for operations on this fence
lock
[in] the irqsafe spinlock to use for locking this fence
context
[in] the execution context this fence is run on
seqno
[in] a linear increasing sequence number for this context
Initializes an allocated fence, the caller doesn't have to keep its refcount after committing with this fence, but it will need to hold a refcount again if fence_ops.enable_signaling gets called. This can be used for other implementing other types of fence.
context and seqno are used for easy comparison between fences, allowing to check which fence is later by simply using fence_later.