1 /* SPDX-License-Identifier: MIT */
3 * Copyright © 2021 Intel Corporation
9 #include <linux/types.h>
11 struct ttm_operation_ctx;
16 * struct i915_deps - Collect dependencies into a single dma-fence
17 * @single: Storage for pointer if the collection is a single fence.
18 * @fences: Allocated array of fence pointers if more than a single fence;
19 * otherwise points to the address of @single.
20 * @num_deps: Current number of dependency fences.
21 * @fences_size: Size of the @fences array in number of pointers.
22 * @gfp: Allocation mode.
25 struct dma_fence *single;
26 struct dma_fence **fences;
27 unsigned int num_deps;
28 unsigned int fences_size;
32 void i915_deps_init(struct i915_deps *deps, gfp_t gfp);
34 void i915_deps_fini(struct i915_deps *deps);
36 int i915_deps_add_dependency(struct i915_deps *deps,
37 struct dma_fence *fence,
38 const struct ttm_operation_ctx *ctx);
40 int i915_deps_add_resv(struct i915_deps *deps, struct dma_resv *resv,
41 const struct ttm_operation_ctx *ctx);
43 int i915_deps_sync(const struct i915_deps *deps,
44 const struct ttm_operation_ctx *ctx);