[Mesa-dev] [PATCH] r600g/compute: Fix bug in compute memory pool
Aaron Watry
awatry at gmail.com
Wed Aug 28 12:07:44 PDT 2013
The changes look good to me... That seems to be a much more sane way
to add the item to the beginning of the linked list.
I've tested this on CEDAR (Radeon 5400) without any OpenCL
regressions, and the only piglit change was that the new piglit test
created for this bug now passes.
--Aaron
On Tue, Aug 27, 2013 at 10:17 AM, Tom Stellard <tom at stellard.net> wrote:
> From: Tom Stellard <thomas.stellard at amd.com>
>
> 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 | 9 ++-------
> 1 file changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/src/gallium/drivers/r600/compute_memory_pool.c b/src/gallium/drivers/r600/compute_memory_pool.c
> index 454af90..4846bfe 100644
> --- a/src/gallium/drivers/r600/compute_memory_pool.c
> +++ b/src/gallium/drivers/r600/compute_memory_pool.c
> @@ -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;
> }
> }
> --
> 1.7.11.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list