r600g/compute: Fix bug in compute memory pool
authorTom Stellard <thomas.stellard@amd.com>
Mon, 26 Aug 2013 20:06:53 +0000 (13:06 -0700)
committerTom Stellard <thomas.stellard@amd.com>
Fri, 6 Sep 2013 00:18:00 +0000 (17:18 -0700)
When adding a new buffer to the beginning of the memory pool, we were
accidentally deleting the buffer that was first in the buffer list.
This was caused by a bug in the memory pool's linked list
implementation.

src/gallium/drivers/r600/compute_memory_pool.c

index a02df844ff06293af98b2e41d5a686a35159d377..75696d2397ddbf7164f39dbd479d141ae3f17bbf 100644 (file)
@@ -337,14 +337,9 @@ void compute_memory_finalize_pending(struct compute_memory_pool* pool,
                                }
                        } else {
                                /* Add item to the front of the list */
-                               item->next = pool->item_list->next;
-                               if (pool->item_list->next) {
-                                       pool->item_list->next->prev = item;
-                               }
+                               item->next = pool->item_list;
                                item->prev = pool->item_list->prev;
-                               if (pool->item_list->prev) {
-                                       pool->item_list->prev->next = item;
-                               }
+                               pool->item_list->prev = item;
                                pool->item_list = item;
                        }
                }