Lines Matching full:fence
6 #include <linux/dma-fence.h>
18 * the migration fence with the unbind fences if these are coalesced
33 /* Min number of fence pointers in the array when an allocation occurs. */
61 * This function drops all fence references taken, conditionally frees and
75 static int i915_deps_grow(struct i915_deps *deps, struct dma_fence *fence, in i915_deps_grow() argument
96 deps->fences[deps->num_deps++] = dma_fence_get(fence); in i915_deps_grow()
100 if (ctx->no_wait_gpu && !dma_fence_is_signaled(fence)) { in i915_deps_grow()
105 ret = dma_fence_wait(fence, ctx->interruptible); in i915_deps_grow()
109 ret = fence->error; in i915_deps_grow()
127 * encounters an error during the wait or a fence error, the wait for
155 * i915_deps_add_dependency - Add a fence to the dependency collection
156 * @deps: Pointer to the i915_deps structure a fence is to be added to.
157 * @fence: The fence to add.
161 * Adds a fence to the dependency collection, and takes a reference on it.
162 * If the fence context is not zero and there was a later fence from the
163 * same fence context already added, then the fence is not added to the
164 * dependency collection. If the fence context is not zero and there was
165 * an earlier fence already added, then the fence will replace the older
166 * fence from the same context and the reference on the earlier fence will
168 * If there is a failure to allocate memory to accommodate the new fence to
169 * be added, the new fence will instead be waited for and an error may
170 * be returned; depending on the value of @ctx, or if there was a fence
172 * finalized and all fence reference dropped.
177 struct dma_fence *fence, in i915_deps_add_dependency() argument
183 if (!fence) in i915_deps_add_dependency()
186 if (dma_fence_is_signaled(fence)) { in i915_deps_add_dependency()
187 ret = fence->error; in i915_deps_add_dependency()
196 if (!entry->context || entry->context != fence->context) in i915_deps_add_dependency()
199 if (dma_fence_is_later(fence, entry)) { in i915_deps_add_dependency()
201 deps->fences[i] = dma_fence_get(fence); in i915_deps_add_dependency()
207 return i915_deps_grow(deps, fence, ctx); in i915_deps_add_dependency()
213 * @deps: Pointer to the i915_deps structure a fence is to be added to.
226 struct dma_fence *fence; in i915_deps_add_resv() local
229 dma_resv_for_each_fence(&iter, resv, dma_resv_usage_rw(true), fence) { in i915_deps_add_resv()
230 int ret = i915_deps_add_dependency(deps, fence, ctx); in i915_deps_add_resv()