Mesa (main): anv: Handle OOM in the pinned path in anv_reloc_list_add

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 8 23:09:30 UTC 2021


Module: Mesa
Branch: main
Commit: 7e8c28383ce062a85f72c051faee8df1e92ae789
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7e8c28383ce062a85f72c051faee8df1e92ae789

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Mon Jun  7 20:02:22 2021 -0500

anv: Handle OOM in the pinned path in anv_reloc_list_add

Fixes: b3c0b1b21880 "anv: Use a bitset for tracking residency"
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11236>

---

 src/intel/vulkan/anv_batch_chain.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c
index f69e178130e..35fb2182d42 100644
--- a/src/intel/vulkan/anv_batch_chain.c
+++ b/src/intel/vulkan/anv_batch_chain.c
@@ -195,7 +195,11 @@ anv_reloc_list_add(struct anv_reloc_list *list,
    if (unwrapped_target_bo->flags & EXEC_OBJECT_PINNED) {
       assert(!target_bo->is_wrapper);
       uint32_t idx = unwrapped_target_bo->gem_handle;
-      anv_reloc_list_grow_deps(list, alloc, (idx / BITSET_WORDBITS) + 1);
+      VkResult result = anv_reloc_list_grow_deps(list, alloc,
+                                                 (idx / BITSET_WORDBITS) + 1);
+      if (unlikely(result != VK_SUCCESS))
+         return result;
+
       BITSET_SET(list->deps, unwrapped_target_bo->gem_handle);
       return VK_SUCCESS;
    }



More information about the mesa-commit mailing list