From 9c84b6cce007e6ad7877c4787346b3a45ab1b0c7 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Mon, 28 Dec 2015 13:26:49 -0800 Subject: [PATCH] anv/device: Set device->info sooner in CreateDevice anv_block_pool_init calls anv_block_pool_grow which checks device->info.has_llc to see if it needs to set caching parameters. If we don't set device->info early enough, this reads an undefined value which is probably 0 and not what we want on llc platforms. Found with valgrind. --- src/vulkan/anv_device.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vulkan/anv_device.c b/src/vulkan/anv_device.c index 0043bea5d13..90a0061dbf8 100644 --- a/src/vulkan/anv_device.c +++ b/src/vulkan/anv_device.c @@ -706,6 +706,9 @@ VkResult anv_CreateDevice( if (device->context_id == -1) goto fail_fd; + device->info = *physical_device->info; + device->isl_dev = physical_device->isl_dev; + pthread_mutex_init(&device->mutex, NULL); anv_bo_pool_init(&device->batch_bo_pool, device, ANV_CMD_BUFFER_BATCH_SIZE); @@ -725,9 +728,6 @@ VkResult anv_CreateDevice( anv_block_pool_init(&device->scratch_block_pool, device, 0x10000); - device->info = *physical_device->info; - device->isl_dev = physical_device->isl_dev; - anv_queue_init(device, &device->queue); anv_device_init_meta(device); -- 2.30.2