Lines Matching defs:deps

36 static void i915_deps_reset_fences(struct i915_deps *deps)
38 if (deps->fences != &deps->single)
39 kfree(deps->fences);
40 deps->num_deps = 0;
41 deps->fences_size = 1;
42 deps->fences = &deps->single;
47 * @deps: Pointer to the i915_deps structure to initialize.
50 void i915_deps_init(struct i915_deps *deps, gfp_t gfp)
52 deps->fences = NULL;
53 deps->gfp = gfp;
54 i915_deps_reset_fences(deps);
59 * @deps: Pointer to the i915_deps structure to finalize.
64 void i915_deps_fini(struct i915_deps *deps)
68 for (i = 0; i < deps->num_deps; ++i)
69 dma_fence_put(deps->fences[i]);
71 if (deps->fences != &deps->single)
72 kfree(deps->fences);
75 static int i915_deps_grow(struct i915_deps *deps, struct dma_fence *fence,
80 if (deps->num_deps >= deps->fences_size) {
81 unsigned int new_size = 2 * deps->fences_size;
85 new_fences = kmalloc_array(new_size, sizeof(*new_fences), deps->gfp);
89 memcpy(new_fences, deps->fences,
90 deps->fences_size * sizeof(*new_fences));
91 swap(new_fences, deps->fences);
92 if (new_fences != &deps->single)
94 deps->fences_size = new_size;
96 deps->fences[deps->num_deps++] = dma_fence_get(fence);
116 i915_deps_fini(deps);
122 * @deps: Pointer to the i915_deps structure the fences of which to wait for.
132 int i915_deps_sync(const struct i915_deps *deps, const struct ttm_operation_ctx *ctx)
134 struct dma_fence **fences = deps->fences;
138 for (i = 0; i < deps->num_deps; ++i, ++fences) {
156 * @deps: Pointer to the i915_deps structure a fence is to be added to.
176 int i915_deps_add_dependency(struct i915_deps *deps,
189 i915_deps_fini(deps);
193 for (i = 0; i < deps->num_deps; ++i) {
194 struct dma_fence *entry = deps->fences[i];
201 deps->fences[i] = dma_fence_get(fence);
207 return i915_deps_grow(deps, fence, ctx);
213 * @deps: Pointer to the i915_deps structure a fence is to be added to.
222 int i915_deps_add_resv(struct i915_deps *deps, struct dma_resv *resv,
230 int ret = i915_deps_add_dependency(deps, fence, ctx);