From 38a087c4ce2a398f33ab583f048d87bd6ac8178f Mon Sep 17 00:00:00 2001 From: Paulo Zanoni Date: Fri, 20 Jan 2023 17:38:11 -0800 Subject: [PATCH] anv: there's no need to set exec_obj offsets twice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The anv_execbuf_add_bo() function already sets the offsets for the exec_objects. Since we're always using softpin and never using relocations all these objects should have non-changing offsets, all set during anv_bo creation and never changed. Not only we should not change these offsets, we definitely don't change them between anv_execbuf_add_bo() and this loop we're removing. Previously, we'd have the offset set as -1 for BOs that had never been submitted when we were not using softpin. Notice that with games we can have several hundreds of BOs in this array. This loop was added by: c5f7e1f5b4a1 ("anv: Delete relocation support from batch submission") Reviewed-by: José Roberto de Souza Signed-off-by: Paulo Zanoni Part-of: --- src/intel/vulkan/i915/anv_batch_chain.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/intel/vulkan/i915/anv_batch_chain.c b/src/intel/vulkan/i915/anv_batch_chain.c index 43fa371b698..eb14d5a481b 100644 --- a/src/intel/vulkan/i915/anv_batch_chain.c +++ b/src/intel/vulkan/i915/anv_batch_chain.c @@ -378,9 +378,6 @@ setup_execbuf_for_cmd_buffers(struct anv_execbuf *execbuf, return result; } - for (uint32_t i = 0; i < execbuf->bo_count; i++) - execbuf->objects[i].offset = execbuf->bos[i]->offset; - struct anv_batch_bo *first_batch_bo = list_first_entry(&cmd_buffers[0]->batch_bos, struct anv_batch_bo, link);