#include <pthread.h>
#include "anv_private.h"
+#include "test_common.h"
#define NUM_THREADS 8
#define STATES_PER_THREAD_LOG2 10
#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_bo_cache_init(&device.bo_cache);
for (unsigned i = 0; i < NUM_RUNS; i++) {
- anv_block_pool_init(&block_pool, &device, 256);
- anv_state_pool_init(&state_pool, &block_pool);
+ anv_state_pool_init(&state_pool, &device, 4096, 0, 256);
/* Grab one so a zero offset is impossible */
anv_state_pool_alloc(&state_pool, 16, 16);
run_state_pool_test(&state_pool);
anv_state_pool_finish(&state_pool);
- anv_block_pool_finish(&block_pool);
}
pthread_mutex_destroy(&device.mutex);