All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH 1/5] drm/i915: Add list_for_each_entry_safe_continue_reverse
@ 2020-06-05  9:58 Chris Wilson
  2020-06-05  9:58 ` [Intel-gfx] [PATCH 2/5] drm/i915/gem: Separate reloc validation into an earlier step Chris Wilson
                   ` (9 more replies)
  0 siblings, 10 replies; 14+ messages in thread
From: Chris Wilson @ 2020-06-05  9:58 UTC (permalink / raw)
  To: intel-gfx; +Cc: Chris Wilson

One more list iterator variant, for when we want to unwind from inside
one list iterator with the intention of restarting from the current
entry as the new head of the list.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_utils.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_utils.h b/drivers/gpu/drm/i915/i915_utils.h
index 03a73d2bd50d..6ebccdd12d4c 100644
--- a/drivers/gpu/drm/i915/i915_utils.h
+++ b/drivers/gpu/drm/i915/i915_utils.h
@@ -266,6 +266,12 @@ static inline int list_is_last_rcu(const struct list_head *list,
 	return READ_ONCE(list->next) == head;
 }
 
+#define list_for_each_entry_safe_continue_reverse(pos, n, head, member)	\
+	for (pos = list_prev_entry(pos, member),			\
+	     n = list_prev_entry(pos, member);				\
+	     &pos->member != (head);					\
+	     pos = n, n = list_prev_entry(n, member))
+
 /*
  * Wait until the work is finally complete, even if it tries to postpone
  * by requeueing itself. Note, that if the worker never cancels itself,
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2020-06-05 16:58 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-05  9:58 [Intel-gfx] [PATCH 1/5] drm/i915: Add list_for_each_entry_safe_continue_reverse Chris Wilson
2020-06-05  9:58 ` [Intel-gfx] [PATCH 2/5] drm/i915/gem: Separate reloc validation into an earlier step Chris Wilson
2020-06-05 15:27   ` Tvrtko Ursulin
2020-06-05 15:38     ` Chris Wilson
2020-06-05 16:07   ` [Intel-gfx] [PATCH v2] " Chris Wilson
2020-06-05  9:58 ` [Intel-gfx] [PATCH 3/5] drm/i915/gem: Lift GPU relocation allocation Chris Wilson
2020-06-05  9:58 ` [Intel-gfx] [PATCH 4/5] drm/i915/gem: Build the reloc request first Chris Wilson
2020-06-05  9:58 ` [Intel-gfx] [PATCH 5/5] drm/i915/gem: Add all GPU reloc awaits/signals en masse Chris Wilson
2020-06-05 10:30 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/5] drm/i915: Add list_for_each_entry_safe_continue_reverse Patchwork
2020-06-05 10:31 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2020-06-05 10:52 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-06-05 12:10 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2020-06-05 14:50 ` [Intel-gfx] [PATCH 1/5] " Tvrtko Ursulin
2020-06-05 16:58 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for series starting with [1/5] drm/i915: Add list_for_each_entry_safe_continue_reverse (rev2) Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.