Switch from cElementTree to ElementTree.
[mesa.git] / src / intel / vulkan / tests / state_pool_free_list_only.c
index 2f4eb47fe45e2234e9ae64a6d99c65b26080351c..fd471a77845ab855237ffb69ff9f7bd0575de19e 100644 (file)
@@ -24,6 +24,7 @@
 #include <pthread.h>
 
 #include "anv_private.h"
+#include "test_common.h"
 
 #define NUM_THREADS 8
 #define STATES_PER_THREAD_LOG2 12
 
 #include "state_pool_test_helper.h"
 
-int main(int argc, char **argv)
+int main(void)
 {
-   struct anv_device device;
-   struct anv_block_pool block_pool;
+   struct anv_physical_device physical_device = { };
+   struct anv_device device = {
+      .physical = &physical_device,
+   };
    struct anv_state_pool state_pool;
 
    pthread_mutex_init(&device.mutex, NULL);
-   anv_block_pool_init(&block_pool, &device, 4096);
-   anv_state_pool_init(&state_pool, &block_pool);
+   anv_bo_cache_init(&device.bo_cache);
+   anv_state_pool_init(&state_pool, &device, 4096, 0, 4096);
 
    /* Grab one so a zero offset is impossible */
    anv_state_pool_alloc(&state_pool, 16, 16);
@@ -51,7 +54,7 @@ int main(int argc, char **argv)
       struct anv_state states[NUM_THREADS * STATES_PER_THREAD];
       for (unsigned i = 0; i < NUM_THREADS * STATES_PER_THREAD; i++) {
          states[i] = anv_state_pool_alloc(&state_pool, 16, 16);
-         assert(states[i].offset != 0);
+         ASSERT(states[i].offset != 0);
       }
 
       for (unsigned i = 0; i < NUM_THREADS * STATES_PER_THREAD; i++)
@@ -61,6 +64,5 @@ int main(int argc, char **argv)
    run_state_pool_test(&state_pool);
 
    anv_state_pool_finish(&state_pool);
-   anv_block_pool_finish(&block_pool);
    pthread_mutex_destroy(&device.mutex);
 }