r600g/compute: Quick exit if there's nothing to add to the pool
authorBruno Jiménez <brunojimen@gmail.com>
Wed, 16 Jul 2014 21:12:46 +0000 (23:12 +0200)
committerTom Stellard <thomas.stellard@amd.com>
Wed, 23 Jul 2014 14:29:17 +0000 (10:29 -0400)
This way we can avoid defragmenting the pool, even if it is needed
to defragment it, and looping again through the list of unallocated
items.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
src/gallium/drivers/r600/compute_memory_pool.c

index b158f5e36bee963cef2017c892278816c16b5c4c..75a8bd30dd750c0f944ef7162942e95540abd46a 100644 (file)
@@ -262,6 +262,10 @@ int compute_memory_finalize_pending(struct compute_memory_pool* pool,
                        unallocated += align(item->size_in_dw, ITEM_ALIGNMENT);
        }
 
+       if (unallocated == 0) {
+               return 0;
+       }
+
        if (pool->status & POOL_FRAGMENTED) {
                compute_memory_defrag(pool, pipe);
        }