From dbbf2ff12e0b3d57b3a3523d5beb19c2c1d8fa9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Wed, 10 Aug 2022 10:15:54 -0700 Subject: [PATCH] anv: Nuke anv_execbuf_init() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We can do designated initialization to initialize needed values and set the rest to zero. Reviewed-by: Lionel Landwerlin Signed-off-by: José Roberto de Souza Part-of: --- src/intel/vulkan/anv_batch_chain.c | 32 ++++++++++++------------------ 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c index c65c0f33fa7..292db55085f 100644 --- a/src/intel/vulkan/anv_batch_chain.c +++ b/src/intel/vulkan/anv_batch_chain.c @@ -1217,12 +1217,6 @@ struct anv_execbuf { int perf_query_pass; }; -static void -anv_execbuf_init(struct anv_execbuf *exec) -{ - memset(exec, 0, sizeof(*exec)); -} - static void anv_execbuf_finish(struct anv_execbuf *exec) { @@ -2024,10 +2018,10 @@ anv_queue_exec_utrace_locked(struct anv_queue *queue, assert(flush->batch_bo); struct anv_device *device = queue->device; - struct anv_execbuf execbuf; - anv_execbuf_init(&execbuf); - execbuf.alloc = &device->vk.alloc; - execbuf.alloc_scope = VK_SYSTEM_ALLOCATION_SCOPE_DEVICE; + struct anv_execbuf execbuf = { + .alloc = &device->vk.alloc, + .alloc_scope = VK_SYSTEM_ALLOCATION_SCOPE_DEVICE, + }; VkResult result = setup_utrace_execbuf(&execbuf, queue, flush); if (result != VK_SUCCESS) @@ -2088,11 +2082,11 @@ anv_queue_exec_locked(struct anv_queue *queue, { struct anv_device *device = queue->device; struct anv_utrace_flush_copy *utrace_flush_data = NULL; - struct anv_execbuf execbuf; - anv_execbuf_init(&execbuf); - execbuf.alloc = &queue->device->vk.alloc; - execbuf.alloc_scope = VK_SYSTEM_ALLOCATION_SCOPE_DEVICE; - execbuf.perf_query_pass = perf_query_pass; + struct anv_execbuf execbuf = { + .alloc = &queue->device->vk.alloc, + .alloc_scope = VK_SYSTEM_ALLOCATION_SCOPE_DEVICE, + .perf_query_pass = perf_query_pass, + }; /* Flush the trace points first, they need to be moved */ VkResult result = @@ -2437,10 +2431,10 @@ anv_queue_submit_simple_batch(struct anv_queue *queue, if (device->physical->memory.need_clflush) intel_flush_range(batch_bo->map, batch_size); - struct anv_execbuf execbuf; - anv_execbuf_init(&execbuf); - execbuf.alloc = &queue->device->vk.alloc; - execbuf.alloc_scope = VK_SYSTEM_ALLOCATION_SCOPE_DEVICE; + struct anv_execbuf execbuf = { + .alloc = &queue->device->vk.alloc, + .alloc_scope = VK_SYSTEM_ALLOCATION_SCOPE_DEVICE, + }; result = anv_execbuf_add_bo(device, &execbuf, batch_bo, NULL, 0); if (result != VK_SUCCESS)