Lines Matching full:tl
17 static bool retire_requests(struct intel_timeline *tl) in retire_requests() argument
21 list_for_each_entry_safe(rq, rn, &tl->requests, link) in retire_requests()
26 return !i915_active_fence_isset(&tl->last_request); in retire_requests()
64 struct intel_timeline *tl = xchg(&engine->retire, NULL); in engine_retire() local
67 struct intel_timeline *next = xchg(&tl->retire, NULL); in engine_retire()
77 if (mutex_trylock(&tl->mutex)) { in engine_retire()
78 retire_requests(tl); in engine_retire()
79 mutex_unlock(&tl->mutex); in engine_retire()
81 intel_timeline_put(tl); in engine_retire()
84 tl = ptr_mask_bits(next, 1); in engine_retire()
85 } while (tl); in engine_retire()
89 struct intel_timeline *tl) in add_retire() argument
100 if (cmpxchg(&tl->retire, NULL, STUB)) /* already queued */ in add_retire()
103 intel_timeline_get(tl); in add_retire()
106 tl->retire = ptr_pack_bits(first, 1, 1); in add_retire()
107 while (!try_cmpxchg(&engine->retire, &first, tl)); in add_retire()
113 struct intel_timeline *tl) in intel_engine_add_retire() argument
118 if (add_retire(engine, tl)) in intel_engine_add_retire()
137 struct intel_timeline *tl, *tn; in intel_gt_retire_requests_timeout() local
143 list_for_each_entry_safe(tl, tn, &timelines->active_list, link) { in intel_gt_retire_requests_timeout()
144 if (!mutex_trylock(&tl->mutex)) { in intel_gt_retire_requests_timeout()
149 intel_timeline_get(tl); in intel_gt_retire_requests_timeout()
150 GEM_BUG_ON(!atomic_read(&tl->active_count)); in intel_gt_retire_requests_timeout()
151 atomic_inc(&tl->active_count); /* pin the list element */ in intel_gt_retire_requests_timeout()
157 fence = i915_active_fence_get(&tl->last_request); in intel_gt_retire_requests_timeout()
159 mutex_unlock(&tl->mutex); in intel_gt_retire_requests_timeout()
167 if (!mutex_trylock(&tl->mutex)) { in intel_gt_retire_requests_timeout()
174 if (!retire_requests(tl)) in intel_gt_retire_requests_timeout()
176 mutex_unlock(&tl->mutex); in intel_gt_retire_requests_timeout()
181 list_safe_reset_next(tl, tn, link); in intel_gt_retire_requests_timeout()
182 if (atomic_dec_and_test(&tl->active_count)) in intel_gt_retire_requests_timeout()
183 list_del(&tl->link); in intel_gt_retire_requests_timeout()
186 if (refcount_dec_and_test(&tl->kref.refcount)) { in intel_gt_retire_requests_timeout()
187 GEM_BUG_ON(atomic_read(&tl->active_count)); in intel_gt_retire_requests_timeout()
188 list_add(&tl->link, &free); in intel_gt_retire_requests_timeout()
193 list_for_each_entry_safe(tl, tn, &free, link) in intel_gt_retire_requests_timeout()
194 __intel_timeline_free(&tl->kref); in intel_gt_retire_requests_timeout()