anv/tests: Initialize the BO cache and device mutex
We're about to start depending on the BO cache in the state and block pools so we need them properly initialized for the tests to work. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
This commit is contained in:
@@ -43,6 +43,8 @@ int main(int argc, char **argv)
|
||||
const uint32_t block_size = 16 * 1024;
|
||||
const uint32_t initial_size = block_size / 2;
|
||||
|
||||
pthread_mutex_init(&device.mutex, NULL);
|
||||
anv_bo_cache_init(&device.bo_cache);
|
||||
anv_block_pool_init(&pool, &device, 4096, initial_size);
|
||||
assert(pool.size == initial_size);
|
||||
|
||||
|
||||
@@ -118,6 +118,7 @@ static void run_test()
|
||||
struct anv_block_pool pool;
|
||||
|
||||
pthread_mutex_init(&device.mutex, NULL);
|
||||
anv_bo_cache_init(&device.bo_cache);
|
||||
anv_block_pool_init(&pool, &device, 4096, 4096);
|
||||
|
||||
for (unsigned i = 0; i < NUM_THREADS; i++) {
|
||||
|
||||
@@ -43,6 +43,7 @@ int main(int argc, char **argv)
|
||||
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_state_pool_init(&state_pool, &device, 4096, 256);
|
||||
|
||||
@@ -42,6 +42,7 @@ int main(int argc, char **argv)
|
||||
struct anv_state_pool state_pool;
|
||||
|
||||
pthread_mutex_init(&device.mutex, NULL);
|
||||
anv_bo_cache_init(&device.bo_cache);
|
||||
anv_state_pool_init(&state_pool, &device, 4096, 4096);
|
||||
|
||||
/* Grab one so a zero offset is impossible */
|
||||
|
||||
@@ -63,6 +63,7 @@ static void run_test()
|
||||
struct anv_state_pool state_pool;
|
||||
|
||||
pthread_mutex_init(&device.mutex, NULL);
|
||||
anv_bo_cache_init(&device.bo_cache);
|
||||
anv_state_pool_init(&state_pool, &device, 4096, 64);
|
||||
|
||||
pthread_barrier_init(&barrier, NULL, NUM_THREADS);
|
||||
|
||||
@@ -37,6 +37,8 @@ int main(int argc, char **argv)
|
||||
};
|
||||
struct anv_state_pool state_pool;
|
||||
|
||||
pthread_mutex_init(&device.mutex, NULL);
|
||||
anv_bo_cache_init(&device.bo_cache);
|
||||
anv_state_pool_init(&state_pool, &device, 4096, 4096);
|
||||
|
||||
/* Get the size of the underlying block_pool */
|
||||
|
||||
Reference in New Issue
Block a user