/* SPDX-License-Identifier: MIT */ /* * Copyright © 2019 Intel Corporation */ #ifndef I915_SW_FENCE_WORK_H #define I915_SW_FENCE_WORK_H #include <linux/dma-fence.h> #include <linux/spinlock.h> #include <linux/workqueue.h> #include "i915_sw_fence.h" struct dma_fence_work; struct dma_fence_work_ops { … }; struct dma_fence_work { … }; enum { … }; void dma_fence_work_init(struct dma_fence_work *f, const struct dma_fence_work_ops *ops); int dma_fence_work_chain(struct dma_fence_work *f, struct dma_fence *signal); static inline void dma_fence_work_commit(struct dma_fence_work *f) { … } /** * dma_fence_work_commit_imm: Commit the fence, and if possible execute locally. * @f: the fenced worker * * Instead of always scheduling a worker to execute the callback (see * dma_fence_work_commit()), we try to execute the callback immediately in * the local context. It is required that the fence be committed before it * is published, and that no other threads try to tamper with the number * of asynchronous waits on the fence (or else the callback will be * executed in the wrong context, i.e. not the callers). */ static inline void dma_fence_work_commit_imm(struct dma_fence_work *f) { … } #endif /* I915_SW_FENCE_WORK_H */