Mesa (master): anv: Fix the target_bo assertion in anv_reloc_list_add

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Sep 17 13:11:33 UTC 2020


Module: Mesa
Branch: master
Commit: a163cba1e3a20536377d9b0f9617f8433d580114
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a163cba1e3a20536377d9b0f9617f8433d580114

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Thu Sep 17 07:21:52 2020 -0500

anv: Fix the target_bo assertion in anv_reloc_list_add

Fixes: b75a92e2010e "anv: assert that the target bo is valid..."
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3528
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6759>

---

 src/intel/vulkan/anv_batch_chain.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c
index e5d0e140cdf..1258af7088f 100644
--- a/src/intel/vulkan/anv_batch_chain.c
+++ b/src/intel/vulkan/anv_batch_chain.c
@@ -188,6 +188,9 @@ anv_reloc_list_add(struct anv_reloc_list *list,
    if (address_u64_out)
       *address_u64_out = target_bo_offset + delta;
 
+   assert(unwrapped_target_bo->gem_handle > 0);
+   assert(unwrapped_target_bo->refcount > 0);
+
    if (unwrapped_target_bo->flags & EXEC_OBJECT_PINNED) {
       assert(!target_bo->is_wrapper);
       uint32_t idx = unwrapped_target_bo->gem_handle;
@@ -200,8 +203,6 @@ anv_reloc_list_add(struct anv_reloc_list *list,
    if (result != VK_SUCCESS)
       return result;
 
-   assert(target_bo->gem_handle > 0 && target_bo->refcount > 0);
-
    /* XXX: Can we use I915_EXEC_HANDLE_LUT? */
    index = list->num_relocs++;
    list->reloc_bos[index] = target_bo;



More information about the mesa-commit mailing list