// SPDX-License-Identifier: GPL-2.0-only /* * fence-chain: chain fences together in a timeline * * Copyright (C) 2018 Advanced Micro Devices, Inc. * Authors: * Christian König <[email protected]> */ #include <linux/dma-fence-chain.h> static bool dma_fence_chain_enable_signaling(struct dma_fence *fence); /** * dma_fence_chain_get_prev - use RCU to get a reference to the previous fence * @chain: chain node to get the previous node from * * Use dma_fence_get_rcu_safe to get a reference to the previous fence of the * chain node. */ static struct dma_fence *dma_fence_chain_get_prev(struct dma_fence_chain *chain) { … } /** * dma_fence_chain_walk - chain walking function * @fence: current chain node * * Walk the chain to the next node. Returns the next fence or NULL if we are at * the end of the chain. Garbage collects chain nodes which are already * signaled. */ struct dma_fence *dma_fence_chain_walk(struct dma_fence *fence) { … } EXPORT_SYMBOL(…); /** * dma_fence_chain_find_seqno - find fence chain node by seqno * @pfence: pointer to the chain node where to start * @seqno: the sequence number to search for * * Advance the fence pointer to the chain node which will signal this sequence * number. If no sequence number is provided then this is a no-op. * * Returns EINVAL if the fence is not a chain node or the sequence number has * not yet advanced far enough. */ int dma_fence_chain_find_seqno(struct dma_fence **pfence, uint64_t seqno) { … } EXPORT_SYMBOL(…); static const char *dma_fence_chain_get_driver_name(struct dma_fence *fence) { … } static const char *dma_fence_chain_get_timeline_name(struct dma_fence *fence) { … } static void dma_fence_chain_irq_work(struct irq_work *work) { … } static void dma_fence_chain_cb(struct dma_fence *f, struct dma_fence_cb *cb) { … } static bool dma_fence_chain_enable_signaling(struct dma_fence *fence) { … } static bool dma_fence_chain_signaled(struct dma_fence *fence) { … } static void dma_fence_chain_release(struct dma_fence *fence) { … } static void dma_fence_chain_set_deadline(struct dma_fence *fence, ktime_t deadline) { … } const struct dma_fence_ops dma_fence_chain_ops = …; EXPORT_SYMBOL(…); /** * dma_fence_chain_init - initialize a fence chain * @chain: the chain node to initialize * @prev: the previous fence * @fence: the current fence * @seqno: the sequence number to use for the fence chain * * Initialize a new chain node and either start a new chain or add the node to * the existing chain of the previous fence. */ void dma_fence_chain_init(struct dma_fence_chain *chain, struct dma_fence *prev, struct dma_fence *fence, uint64_t seqno) { … } EXPORT_SYMBOL(…);