Lines Matching refs:tl

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