summaryrefslogtreecommitdiffstats
path: root/src/intel
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-05-01 16:48:12 -0700
committerJason Ekstrand <[email protected]>2017-05-01 17:06:40 -0700
commit6ef1bd4fa57b36efc7919773fd26c36fd43d2ea9 (patch)
tree9c37ef5837ccea75fc78e05425b0c38cb7654352 /src/intel
parent6681ab1f975b1a23e00a4b011bc1783e6e33d07b (diff)
anv/tests: Create a dummy instance as well as device
This fixes crashes caused by 35e626bd0e59e7ce9fd97ccef66b2468c09206a4 which made us start referencing the instance in the allocators. With this commit, the tests now happily pass again. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100877 Tested-by: Vinson Lee <[email protected]>
Diffstat (limited to 'src/intel')
-rw-r--r--src/intel/vulkan/tests/block_pool_no_free.c5
-rw-r--r--src/intel/vulkan/tests/state_pool.c5
-rw-r--r--src/intel/vulkan/tests/state_pool_free_list_only.c5
-rw-r--r--src/intel/vulkan/tests/state_pool_no_free.c5
4 files changed, 16 insertions, 4 deletions
diff --git a/src/intel/vulkan/tests/block_pool_no_free.c b/src/intel/vulkan/tests/block_pool_no_free.c
index 86d1a76151f..0a61818e42c 100644
--- a/src/intel/vulkan/tests/block_pool_no_free.c
+++ b/src/intel/vulkan/tests/block_pool_no_free.c
@@ -107,7 +107,10 @@ static void validate_monotonic(uint32_t **blocks)
static void run_test()
{
- struct anv_device device;
+ struct anv_instance instance;
+ struct anv_device device = {
+ .instance = &instance,
+ };
struct anv_block_pool pool;
pthread_mutex_init(&device.mutex, NULL);
diff --git a/src/intel/vulkan/tests/state_pool.c b/src/intel/vulkan/tests/state_pool.c
index 878ec19a595..90c9bdea514 100644
--- a/src/intel/vulkan/tests/state_pool.c
+++ b/src/intel/vulkan/tests/state_pool.c
@@ -34,7 +34,10 @@
int main(int argc, char **argv)
{
- struct anv_device device;
+ struct anv_instance instance;
+ struct anv_device device = {
+ .instance = &instance,
+ };
struct anv_block_pool block_pool;
struct anv_state_pool state_pool;
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 2f4eb47fe45..868815cf933 100644
--- a/src/intel/vulkan/tests/state_pool_free_list_only.c
+++ b/src/intel/vulkan/tests/state_pool_free_list_only.c
@@ -33,7 +33,10 @@
int main(int argc, char **argv)
{
- struct anv_device device;
+ struct anv_instance instance;
+ struct anv_device device = {
+ .instance = &instance,
+ };
struct anv_block_pool block_pool;
struct anv_state_pool state_pool;
diff --git a/src/intel/vulkan/tests/state_pool_no_free.c b/src/intel/vulkan/tests/state_pool_no_free.c
index 4b248c2ee66..6e012e46834 100644
--- a/src/intel/vulkan/tests/state_pool_no_free.c
+++ b/src/intel/vulkan/tests/state_pool_no_free.c
@@ -54,7 +54,10 @@ static void *alloc_states(void *_job)
static void run_test()
{
- struct anv_device device;
+ struct anv_instance instance;
+ struct anv_device device = {
+ .instance = &instance,
+ };
struct anv_block_pool block_pool;
struct anv_state_pool state_pool;