From aaba438f8024b289f3cd6a7f822a00b23c770231 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Wed, 30 Oct 2019 11:43:53 -0500 Subject: [PATCH] anv/tests: Zero-initialize instances Some of the tests were actually relying on some of those uninitialized bits to be non-zero. In particular, a couple want use_softpin = true. Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Lionel Landwerlin (cherry picked from commit 9076e9f3751341063679eb227116060070549a37) --- src/intel/vulkan/tests/block_pool_grow_first.c | 6 +++++- src/intel/vulkan/tests/block_pool_no_free.c | 2 +- src/intel/vulkan/tests/state_pool.c | 2 +- src/intel/vulkan/tests/state_pool_free_list_only.c | 2 +- src/intel/vulkan/tests/state_pool_no_free.c | 2 +- src/intel/vulkan/tests/state_pool_padding.c | 6 +++++- 6 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/intel/vulkan/tests/block_pool_grow_first.c b/src/intel/vulkan/tests/block_pool_grow_first.c index aea12b29de8..48989f174ed 100644 --- a/src/intel/vulkan/tests/block_pool_grow_first.c +++ b/src/intel/vulkan/tests/block_pool_grow_first.c @@ -27,7 +27,11 @@ int main(int argc, char **argv) { - struct anv_instance instance; + struct anv_instance instance = { + .physicalDevice = { + .use_softpin = true, + }, + }; struct anv_device device = { .instance = &instance, }; diff --git a/src/intel/vulkan/tests/block_pool_no_free.c b/src/intel/vulkan/tests/block_pool_no_free.c index f6aa47688af..34b9e8c6a0d 100644 --- a/src/intel/vulkan/tests/block_pool_no_free.c +++ b/src/intel/vulkan/tests/block_pool_no_free.c @@ -111,7 +111,7 @@ static void validate_monotonic(int32_t **blocks) static void run_test() { - struct anv_instance instance; + struct anv_instance instance = { }; struct anv_device device = { .instance = &instance, }; diff --git a/src/intel/vulkan/tests/state_pool.c b/src/intel/vulkan/tests/state_pool.c index 34743c601c3..04ac809bf5d 100644 --- a/src/intel/vulkan/tests/state_pool.c +++ b/src/intel/vulkan/tests/state_pool.c @@ -36,7 +36,7 @@ int main(int argc, char **argv) { - struct anv_instance instance; + struct anv_instance instance = { }; struct anv_device device = { .instance = &instance, }; 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 9f1eb866e4e..d4bdbddef9b 100644 --- a/src/intel/vulkan/tests/state_pool_free_list_only.c +++ b/src/intel/vulkan/tests/state_pool_free_list_only.c @@ -35,7 +35,7 @@ int main(int argc, char **argv) { - struct anv_instance instance; + struct anv_instance instance = { }; struct anv_device device = { .instance = &instance, }; diff --git a/src/intel/vulkan/tests/state_pool_no_free.c b/src/intel/vulkan/tests/state_pool_no_free.c index cb6591266e8..af2c199bf6d 100644 --- a/src/intel/vulkan/tests/state_pool_no_free.c +++ b/src/intel/vulkan/tests/state_pool_no_free.c @@ -56,7 +56,7 @@ static void *alloc_states(void *_job) static void run_test() { - struct anv_instance instance; + struct anv_instance instance = { }; struct anv_device device = { .instance = &instance, }; diff --git a/src/intel/vulkan/tests/state_pool_padding.c b/src/intel/vulkan/tests/state_pool_padding.c index 44509cde07a..c37de4ff6cc 100644 --- a/src/intel/vulkan/tests/state_pool_padding.c +++ b/src/intel/vulkan/tests/state_pool_padding.c @@ -27,7 +27,11 @@ int main(int argc, char **argv) { - struct anv_instance instance; + struct anv_instance instance = { + .physicalDevice = { + .use_softpin = true, + }, + }; struct anv_device device = { .instance = &instance, };