Mesa (staging/21.1): anv: Handle OOM in the pinned path in anv_reloc_list_add

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 10 11:32:25 UTC 2021


Module: Mesa
Branch: staging/21.1
Commit: 3c7b57988f5b8de3156d336b09012410289e7155
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3c7b57988f5b8de3156d336b09012410289e7155

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>
(cherry picked from commit 7e8c28383ce062a85f72c051faee8df1e92ae789)

---

 .pick_status.json                  | 2 +-
 src/intel/vulkan/anv_batch_chain.c | 6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 2a82579f19f..cc28051a311 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -841,7 +841,7 @@
         "description": "anv: Handle OOM in the pinned path in anv_reloc_list_add",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "b3c0b1b21880987d90bd5738736f2bd920f76b18"
     },
diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c
index 9add43fe947..c519e4c834e 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