[Mesa-dev] [PATCH 10/12] anv: Force use of reloc address

Chris Wilson chris at chris-wilson.co.uk
Sun May 14 23:38:54 UTC 2017


Now that all callers request and use the relocation target address, we
can unconditionally pass it back and so enforce that the caller does
supply it (and we hope uses it!).

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 src/intel/vulkan/anv_batch_chain.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c
index fe27038cd3..10a0466767 100644
--- a/src/intel/vulkan/anv_batch_chain.c
+++ b/src/intel/vulkan/anv_batch_chain.c
@@ -219,8 +219,7 @@ anv_reloc_list_add(struct anv_reloc_list *list,
    int index;
 
    /* The address written into the batch must always match presumed_offset. */
-   if (address)
-      *address = gen8_canonical_address(presumed_offset + delta);
+   *address = gen8_canonical_address(presumed_offset + delta);
 
    /* The array of unique bo should be reasonably small */
    for (index = 0; index < list->num_bos; index++)
@@ -229,7 +228,7 @@ anv_reloc_list_add(struct anv_reloc_list *list,
 
    if (index == list->num_bos) {
       result = anv_reloc_list_grow_bos(list, alloc, 1);
-      if (result != VK_SUCCESS)
+      if (unlikely(result != VK_SUCCESS))
          return result;
 
       index = list->num_bos++;
@@ -240,7 +239,7 @@ anv_reloc_list_add(struct anv_reloc_list *list,
       (target_bo->flags & EXEC_OBJECT_WRITE) ? I915_GEM_DOMAIN_RENDER : 0;
 
    result = anv_reloc_list_grow_relocs(list, alloc, 1);
-   if (result != VK_SUCCESS)
+   if (unlikely(result != VK_SUCCESS))
       return result;
 
    struct drm_i915_gem_relocation_entry *entry;
-- 
2.11.0



More information about the mesa-dev mailing list