Module: Mesa
Branch: staging/22.0
Commit: 17836a6d64fc90230f71947d8cadc4fb45b66f97
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=17836a6d64fc90230f71947d8cadc4fb45b66f97

Author: Jason Ekstrand <[email protected]>
Date:   Wed Mar  9 20:14:44 2022 -0600

lavapipe: Reset the free_cmd_buffers list in TrimCommandPool

We delete all the command buffers but they're still in the list so
future allocations may try to re-use them post-free and another trim
will re-delete them.

Fixes: b38879f8c5f5 ("vallium: initial import of the vulkan frontend")
Reviewed-by: Boris Brezillon <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15311>
(cherry picked from commit 66cb64c8ad339848e7538faa24800755dc6221f8)

---

 .pick_status.json                               | 2 +-
 src/gallium/frontends/lavapipe/lvp_cmd_buffer.c | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index 61ab653891f..6912cbabdea 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -940,7 +940,7 @@
         "description": "lavapipe: Reset the free_cmd_buffers list in 
TrimCommandPool",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "b38879f8c5f57b7f1802e433e33181bdf5e72aef"
     },
diff --git a/src/gallium/frontends/lavapipe/lvp_cmd_buffer.c 
b/src/gallium/frontends/lavapipe/lvp_cmd_buffer.c
index 35a85a72e75..fc261326c26 100644
--- a/src/gallium/frontends/lavapipe/lvp_cmd_buffer.c
+++ b/src/gallium/frontends/lavapipe/lvp_cmd_buffer.c
@@ -265,6 +265,7 @@ VKAPI_ATTR void VKAPI_CALL lvp_TrimCommandPool(
                             &pool->free_cmd_buffers, pool_link) {
       lvp_cmd_buffer_destroy(cmd_buffer);
    }
+   list_inithead(&pool->free_cmd_buffers);
 }
 
 VKAPI_ATTR void VKAPI_CALL lvp_CmdDrawMultiEXT(

Reply via email to