diff options
author | Eric Anholt <[email protected]> | 2017-01-04 11:57:30 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2017-01-05 16:23:32 -0800 |
commit | 7b8c67b3cc60066ea55d8178a70ae035dac3dd81 (patch) | |
tree | 012528d408f3e6d9829afa537543bea935957f0a /src | |
parent | ebf33e577aee00cf888c79e11a3b62c181b46510 (diff) |
vc4: Reuse a list function to simplify bufmgr code.
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_bufmgr.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/gallium/drivers/vc4/vc4_bufmgr.c b/src/gallium/drivers/vc4/vc4_bufmgr.c index 9cff4e68f42..c0ff531e6ab 100644 --- a/src/gallium/drivers/vc4/vc4_bufmgr.c +++ b/src/gallium/drivers/vc4/vc4_bufmgr.c @@ -289,17 +289,8 @@ vc4_bo_last_unreference_locked_timed(struct vc4_bo *bo, time_t time) /* Move old list contents over (since the array has moved, and * therefore the pointers to the list heads have to change). */ - for (int i = 0; i < cache->size_list_size; i++) { - struct list_head *old_head = &cache->size_list[i]; - if (list_empty(old_head)) - list_inithead(&new_list[i]); - else { - new_list[i].next = old_head->next; - new_list[i].prev = old_head->prev; - new_list[i].next->prev = &new_list[i]; - new_list[i].prev->next = &new_list[i]; - } - } + for (int i = 0; i < cache->size_list_size; i++) + list_replace(&cache->size_list[i], &new_list[i]); for (int i = cache->size_list_size; i < page_index + 1; i++) list_inithead(&new_list[i]); |