Lines Matching +full:signal +full:- +full:guard

2  * SPDX-License-Identifier: MIT
7 #include <linux/dma-fence-array.h>
8 #include <linux/dma-fence-chain.h>
24 if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) in i915_gem_object_wait_fence()
45 * dma-resv contains a sequence such as 1:1, 1:2 instead of a reduced in i915_gem_object_boost()
102 engine = rq->engine; in fence_set_priority()
104 rcu_read_lock(); /* RCU serialisation for set-wedged protection */ in fence_set_priority()
105 if (engine->sched_engine->schedule) in fence_set_priority()
106 engine->sched_engine->schedule(rq, attr); in fence_set_priority()
112 return fence->ops == &dma_fence_chain_ops; in __dma_fence_is_chain()
123 /* Recurse once into a fence-array */ in i915_gem_fence_wait_priority()
128 for (i = 0; i < array->num_fences; i++) in i915_gem_fence_wait_priority()
129 fence_set_priority(array->fences[i], attr); in i915_gem_fence_wait_priority()
135 fence_set_priority(to_dma_fence_chain(iter)->fence, in i915_gem_fence_wait_priority()
155 dma_resv_iter_begin(&cursor, obj->base.resv, in i915_gem_object_wait_priority()
164 * i915_gem_object_wait - Waits for rendering to the object to be completed
177 timeout = i915_gem_object_wait_reservation(obj->base.resv, in i915_gem_object_wait()
183 return !timeout ? -ETIME : 0; in i915_gem_object_wait()
188 /* nsecs_to_jiffies64() does not guard against overflow */ in nsecs_to_jiffies_timeout()
208 * i915_gem_wait_ioctl - implements DRM_IOCTL_I915_GEM_WAIT
215 * -ETIME: object is still busy after timeout
216 * -ERESTARTSYS: signal interrupted the wait
217 * -ENONENT: object doesn't exist
219 * -EAGAIN: incomplete, restart syscall
220 * -ENOMEM: damn
221 * -ENODEV: Internal IRQ fail
222 * -E?: The add request failed
225 * non-zero timeout parameter the wait ioctl will wait for the given number of
227 * without holding struct_mutex the object may become re-busied before this
239 if (args->flags != 0) in i915_gem_wait_ioctl()
240 return -EINVAL; in i915_gem_wait_ioctl()
242 obj = i915_gem_object_lookup(file, args->bo_handle); in i915_gem_wait_ioctl()
244 return -ENOENT; in i915_gem_wait_ioctl()
252 to_wait_timeout(args->timeout_ns)); in i915_gem_wait_ioctl()
254 if (args->timeout_ns > 0) { in i915_gem_wait_ioctl()
255 args->timeout_ns -= ktime_to_ns(ktime_sub(ktime_get(), start)); in i915_gem_wait_ioctl()
256 if (args->timeout_ns < 0) in i915_gem_wait_ioctl()
257 args->timeout_ns = 0; in i915_gem_wait_ioctl()
261 * bit of mismatch in the jiffies<->nsecs<->ktime loop. So patch in i915_gem_wait_ioctl()
264 * This is a regression from the timespec->ktime conversion. in i915_gem_wait_ioctl()
266 if (ret == -ETIME && !nsecs_to_jiffies(args->timeout_ns)) in i915_gem_wait_ioctl()
267 args->timeout_ns = 0; in i915_gem_wait_ioctl()
270 if (ret == -ETIME && args->timeout_ns) in i915_gem_wait_ioctl()
271 ret = -EAGAIN; in i915_gem_wait_ioctl()
279 * i915_gem_object_wait_migration - Sync an accelerated migration operation
287 * Return: 0 if successful, -ERESTARTSYS if a signal was hit during waiting.