diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-03-01 14:52:39 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-03-01 21:19:22 +0000 |
commit | 9c0c04cac245db046ef17ff24c32e6ab93535f48 (patch) | |
tree | 0b00d66a62e42a254a09cf1ef93595a5697afa62 /src/intel_list.h | |
parent | a438e4ac9ba162e870fb22bc54024d35daa2121e (diff) |
sna: Split storage of inactive partials
As we now attempt to keep retain partial buffers after execution, we can
end up will lots of inactive buffers sitting on the partial buffer list.
In any one batch, we wish to minimise the number of buffers used, so
keep all the inactive buffers on a seperate list and only pull from them
as required.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/intel_list.h')
-rw-r--r-- | src/intel_list.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/intel_list.h b/src/intel_list.h index 8e8c612e..366b9e87 100644 --- a/src/intel_list.h +++ b/src/intel_list.h @@ -214,6 +214,8 @@ __list_del(struct list *prev, struct list *next) static inline void _list_del(struct list *entry) { + assert(entry->prev->next == entry); + assert(entry->next->prev == entry); __list_del(entry->prev, entry->next); } @@ -327,6 +329,11 @@ list_is_empty(struct list *head) &pos->member != (head); \ pos = __container_of(pos->member.next, pos, member)) +#define list_for_each_entry_reverse(pos, head, member) \ + for (pos = __container_of((head)->prev, pos, member); \ + &pos->member != (head); \ + pos = __container_of(pos->member.prev, pos, member)) + /** * Loop through the list, keeping a backup pointer to the element. This * macro allows for the deletion of a list element while looping through the @@ -353,6 +360,8 @@ list_add_tail(struct list *entry, struct list *head) static inline void _list_del(struct list *entry) { + assert(entry->prev->next == entry); + assert(entry->next->prev == entry); __list_del(entry->prev, entry->next); } @@ -382,6 +391,11 @@ static inline void list_move_tail(struct list *list, struct list *head) #define list_last_entry(ptr, type, member) \ list_entry((ptr)->prev, type, member) +#define list_for_each_entry_reverse(pos, head, member) \ + for (pos = __container_of((head)->prev, pos, member); \ + &pos->member != (head); \ + pos = __container_of(pos->member.prev, pos, member)) + #endif #undef container_of |