aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2019-10-30 11:44:12 -0500
committerJason Ekstrand <[email protected]>2019-10-31 13:46:09 +0000
commitcc972d72c7ad3fb8f518b8cf8163e253735b51bb (patch)
tree01d7aef89524e515afb75e0a720f003100249c52
parent9076e9f3751341063679eb227116060070549a37 (diff)
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 <[email protected]>
-rw-r--r--src/intel/vulkan/tests/block_pool_grow_first.c2
-rw-r--r--src/intel/vulkan/tests/block_pool_no_free.c1
-rw-r--r--src/intel/vulkan/tests/state_pool.c1
-rw-r--r--src/intel/vulkan/tests/state_pool_free_list_only.c1
-rw-r--r--src/intel/vulkan/tests/state_pool_no_free.c1
-rw-r--r--src/intel/vulkan/tests/state_pool_padding.c2
6 files changed, 8 insertions, 0 deletions
diff --git a/src/intel/vulkan/tests/block_pool_grow_first.c b/src/intel/vulkan/tests/block_pool_grow_first.c
index 0738f648034..42b5f5aa808 100644
--- a/src/intel/vulkan/tests/block_pool_grow_first.c
+++ b/src/intel/vulkan/tests/block_pool_grow_first.c
@@ -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);
diff --git a/src/intel/vulkan/tests/block_pool_no_free.c b/src/intel/vulkan/tests/block_pool_no_free.c
index 361336a8e8e..a9a11d88d33 100644
--- a/src/intel/vulkan/tests/block_pool_no_free.c
+++ b/src/intel/vulkan/tests/block_pool_no_free.c
@@ -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++) {
diff --git a/src/intel/vulkan/tests/state_pool.c b/src/intel/vulkan/tests/state_pool.c
index 0f28afe9f5f..bbeaaf0e75f 100644
--- a/src/intel/vulkan/tests/state_pool.c
+++ b/src/intel/vulkan/tests/state_pool.c
@@ -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);
diff --git a/src/intel/vulkan/tests/state_pool_free_list_only.c b/src/intel/vulkan/tests/state_pool_free_list_only.c
index 744ccae350c..b9f37cb778a 100644
--- a/src/intel/vulkan/tests/state_pool_free_list_only.c
+++ b/src/intel/vulkan/tests/state_pool_free_list_only.c
@@ -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 */
diff --git a/src/intel/vulkan/tests/state_pool_no_free.c b/src/intel/vulkan/tests/state_pool_no_free.c
index 687e52606c1..a3d781ada1a 100644
--- a/src/intel/vulkan/tests/state_pool_no_free.c
+++ b/src/intel/vulkan/tests/state_pool_no_free.c
@@ -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);
diff --git a/src/intel/vulkan/tests/state_pool_padding.c b/src/intel/vulkan/tests/state_pool_padding.c
index e1cec608678..02fabb28a22 100644
--- a/src/intel/vulkan/tests/state_pool_padding.c
+++ b/src/intel/vulkan/tests/state_pool_padding.c
@@ -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 */