Lines Matching refs:fence
50 struct i915_sw_fence *fence; member
57 static const char *i915_fence_get_driver_name(struct dma_fence *fence) in i915_fence_get_driver_name() argument
59 return dev_name(to_request(fence)->engine->i915->drm.dev); in i915_fence_get_driver_name()
62 static const char *i915_fence_get_timeline_name(struct dma_fence *fence) in i915_fence_get_timeline_name() argument
75 if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) in i915_fence_get_timeline_name()
78 ctx = i915_request_gem_context(to_request(fence)); in i915_fence_get_timeline_name()
85 static bool i915_fence_signaled(struct dma_fence *fence) in i915_fence_signaled() argument
87 return i915_request_completed(to_request(fence)); in i915_fence_signaled()
90 static bool i915_fence_enable_signaling(struct dma_fence *fence) in i915_fence_enable_signaling() argument
92 return i915_request_enable_breadcrumb(to_request(fence)); in i915_fence_enable_signaling()
95 static signed long i915_fence_wait(struct dma_fence *fence, in i915_fence_wait() argument
99 return i915_request_wait(to_request(fence), in i915_fence_wait()
109 static void i915_fence_release(struct dma_fence *fence) in i915_fence_release() argument
111 struct i915_request *rq = to_request(fence); in i915_fence_release()
155 i915_sw_fence_complete(cb->fence); in irq_execute_cb()
337 dma_fence_signal_locked(&rq->fence); in i915_request_retire()
341 if (test_and_set_bit(I915_FENCE_FLAG_BOOST, &rq->fence.flags)) in i915_request_retire()
441 inflight = i915_seqno_passed(rq->fence.seqno, in __request_in_flight()
442 signal->fence.seqno); in __request_in_flight()
465 cb->fence = &rq->submit; in __await_execution()
466 i915_sw_fence_await(cb->fence); in __await_execution()
505 GEM_BUG_ON(!fatal_error(rq->fence.error)); in __i915_request_skip()
510 RQ_TRACE(rq, "error: %d\n", rq->fence.error); in __i915_request_skip()
530 old = READ_ONCE(rq->fence.error); in i915_request_set_error_once()
534 } while (!try_cmpxchg(&rq->fence.error, &old, error)); in i915_request_set_error_once()
589 if (unlikely(fatal_error(request->fence.error))) in __i915_request_submit()
623 GEM_BUG_ON(test_bit(I915_FENCE_FLAG_ACTIVE, &request->fence.flags)); in __i915_request_submit()
626 clear_bit(I915_FENCE_FLAG_PQUEUE, &request->fence.flags); in __i915_request_submit()
627 set_bit(I915_FENCE_FLAG_ACTIVE, &request->fence.flags); in __i915_request_submit()
642 if (test_bit(DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT, &request->fence.flags)) in __i915_request_submit()
681 GEM_BUG_ON(!test_bit(I915_FENCE_FLAG_ACTIVE, &request->fence.flags)); in __i915_request_unsubmit()
682 clear_bit_unlock(I915_FENCE_FLAG_ACTIVE, &request->fence.flags); in __i915_request_unsubmit()
683 if (test_bit(DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT, &request->fence.flags)) in __i915_request_unsubmit()
717 set_bit(I915_FENCE_FLAG_SENTINEL, &rq->fence.flags); in i915_request_cancel()
723 submit_notify(struct i915_sw_fence *fence, enum i915_sw_fence_notify state) in submit_notify() argument
726 container_of(fence, typeof(*request), submit); in submit_notify()
732 if (unlikely(fence->error)) in submit_notify()
733 i915_request_set_error_once(request, fence->error); in submit_notify()
759 semaphore_notify(struct i915_sw_fence *fence, enum i915_sw_fence_notify state) in semaphore_notify() argument
761 struct i915_request *rq = container_of(fence, typeof(*rq), semaphore); in semaphore_notify()
910 dma_fence_init(&rq->fence, &i915_fence_ops, &rq->lock, in __i915_request_create()
1016 struct dma_fence *fence; in i915_request_await_start() local
1033 fence = NULL; in i915_request_await_start()
1063 fence = &prev->fence; in i915_request_await_start()
1066 if (!fence) in i915_request_await_start()
1070 if (!intel_timeline_sync_is_later(i915_request_timeline(rq), fence)) in i915_request_await_start()
1072 fence, 0, in i915_request_await_start()
1074 dma_fence_put(fence); in i915_request_await_start()
1182 if (__emit_semaphore_wait(to, from, from->fence.seqno)) in emit_semaphore_wait()
1190 &from->fence, 0, in emit_semaphore_wait()
1195 struct dma_fence *fence) in intel_timeline_sync_has_start() argument
1198 fence->context, in intel_timeline_sync_has_start()
1199 fence->seqno - 1); in intel_timeline_sync_has_start()
1203 const struct dma_fence *fence) in intel_timeline_sync_set_start() argument
1205 return __intel_timeline_sync_set(tl, fence->context, fence->seqno - 1); in intel_timeline_sync_set_start()
1223 &from->fence)) in __i915_request_await_execution()
1261 err = __emit_semaphore_wait(to, from, from->fence.seqno - 1); in __i915_request_await_execution()
1276 &from->fence); in __i915_request_await_execution()
1293 __i915_request_await_external(struct i915_request *rq, struct dma_fence *fence) in __i915_request_await_external() argument
1296 return i915_sw_fence_await_dma_fence(&rq->submit, fence, in __i915_request_await_external()
1298 fence->context), in __i915_request_await_external()
1303 i915_request_await_external(struct i915_request *rq, struct dma_fence *fence) in i915_request_await_external() argument
1308 if (!to_dma_fence_chain(fence)) in i915_request_await_external()
1309 return __i915_request_await_external(rq, fence); in i915_request_await_external()
1311 dma_fence_chain_for_each(iter, fence) { in i915_request_await_external()
1314 if (!dma_fence_is_i915(chain->fence)) { in i915_request_await_external()
1319 err = i915_request_await_dma_fence(rq, chain->fence); in i915_request_await_external()
1330 struct dma_fence *fence) in i915_request_await_execution() argument
1332 struct dma_fence **child = &fence; in i915_request_await_execution()
1336 if (dma_fence_is_array(fence)) { in i915_request_await_execution()
1337 struct dma_fence_array *array = to_dma_fence_array(fence); in i915_request_await_execution()
1347 fence = *child++; in i915_request_await_execution()
1348 if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) in i915_request_await_execution()
1351 if (fence->context == rq->fence.context) in i915_request_await_execution()
1359 if (dma_fence_is_i915(fence)) in i915_request_await_execution()
1361 to_request(fence)); in i915_request_await_execution()
1363 ret = i915_request_await_external(rq, fence); in i915_request_await_execution()
1399 i915_sw_fence_set_error_once(&to->submit, from->fence.error); in i915_request_await_request()
1423 i915_request_await_dma_fence(struct i915_request *rq, struct dma_fence *fence) in i915_request_await_dma_fence() argument
1425 struct dma_fence **child = &fence; in i915_request_await_dma_fence()
1437 if (dma_fence_is_array(fence)) { in i915_request_await_dma_fence()
1438 struct dma_fence_array *array = to_dma_fence_array(fence); in i915_request_await_dma_fence()
1446 fence = *child++; in i915_request_await_dma_fence()
1447 if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) in i915_request_await_dma_fence()
1455 if (fence->context == rq->fence.context) in i915_request_await_dma_fence()
1459 if (fence->context && in i915_request_await_dma_fence()
1461 fence)) in i915_request_await_dma_fence()
1464 if (dma_fence_is_i915(fence)) in i915_request_await_dma_fence()
1465 ret = i915_request_await_request(rq, to_request(fence)); in i915_request_await_dma_fence()
1467 ret = i915_request_await_external(rq, fence); in i915_request_await_dma_fence()
1472 if (fence->context) in i915_request_await_dma_fence()
1474 fence); in i915_request_await_dma_fence()
1569 &rq->fence)); in __i915_request_add_to_timeline()
1580 i915_seqno_passed(prev->fence.seqno, in __i915_request_add_to_timeline()
1581 rq->fence.seqno)); in __i915_request_add_to_timeline()
1591 &prev->fence, in __i915_request_add_to_timeline()
1607 GEM_BUG_ON(timeline->seqno != rq->fence.seqno); in __i915_request_add_to_timeline()
1765 if (dma_fence_is_signaled(&rq->fence)) in __i915_spin_request()
1785 static void request_wait_wake(struct dma_fence *fence, struct dma_fence_cb *cb) in request_wait_wake() argument
1818 if (dma_fence_is_signaled(&rq->fence)) in i915_request_wait()
1877 if (dma_fence_add_callback(&rq->fence, &wait.cb, request_wait_wake)) in i915_request_wait()
1901 if (dma_fence_is_signaled(&rq->fence)) in i915_request_wait()
1919 dma_fence_remove_callback(&rq->fence, &wait.cb); in i915_request_wait()
1967 if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &rq->fence.flags)) in fence_status()
1970 if (test_bit(DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT, &rq->fence.flags)) in fence_status()
1981 const char *name = rq->fence.ops->get_timeline_name((struct dma_fence *)&rq->fence); in i915_request_show()
2020 rq->fence.context, rq->fence.seqno, in i915_request_show()