summaryrefslogtreecommitdiff
path: root/src/intel_list.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-08-11 10:48:48 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2015-08-11 10:48:48 +0100
commit5a9a3e73a9252cffbaf5f361e98c096095725a64 (patch)
treeddc525e55e214292e978f32a51e737a3aabb0592 /src/intel_list.h
parent4cea8037984c3d5e171be22710384f66660ca4c6 (diff)
sna/dri2: Keep the most-recent back buffer cache when reaping on idle
When the client misses a swap, we consider it idle and unlikely to swap again for a while. We try to take advantage of that and remove the old back buffers. But it is likely to swap again and so having some of that cache around would be advantageous. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/intel_list.h')
-rw-r--r--src/intel_list.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/intel_list.h b/src/intel_list.h
index d0408bed..df912a83 100644
--- a/src/intel_list.h
+++ b/src/intel_list.h
@@ -347,6 +347,11 @@ list_is_empty(const struct list *head)
&pos->member != (head); \
pos = tmp, tmp = __container_of(pos->member.next, tmp, member))
+#define list_for_each_entry_safe_from(pos, tmp, head, member) \
+ for (tmp = __container_of(pos->member.next, pos, member); \
+ &pos->member != (head); \
+ pos = tmp, tmp = __container_of(pos->member.next, tmp, member))
+
#else
#include <list.h>
@@ -396,6 +401,11 @@ static inline void list_move_tail(struct list *list, struct list *head)
&pos->member != (head); \
pos = __container_of(pos->member.prev, pos, member))
+#define list_for_each_entry_safe_from(pos, tmp, head, member) \
+ for (tmp = __container_of(pos->member.next, pos, member) \
+ &pos->member != (head); \
+ pos = tmp)
+
#endif
#undef container_of