From: Jason Ekstrand Date: Mon, 28 Dec 2015 21:26:49 +0000 (-0800) Subject: anv/device: Set device->info sooner in CreateDevice X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9c84b6cce007e6ad7877c4787346b3a45ab1b0c7;p=mesa.git 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. --- 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);