Mesa (master): turnip: Sanity check that we're adding valid BOs to the list.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Dec 5 04:51:02 UTC 2019


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

Author: Eric Anholt <eric at anholt.net>
Date:   Wed Dec  4 12:21:50 2019 -0800

turnip: Sanity check that we're adding valid BOs to the list.

I tripped over this during CS enabling when my program BO wasn't set up.
Easier to debug this way than the kernel telling us a 0 handle is invalid.

Reviewed-by: Jonathan Marek <jonathan at marek.ca>

---

 src/freedreno/vulkan/tu_cmd_buffer.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/freedreno/vulkan/tu_cmd_buffer.c b/src/freedreno/vulkan/tu_cmd_buffer.c
index 47f95e4b00a..bb9d18604b8 100644
--- a/src/freedreno/vulkan/tu_cmd_buffer.c
+++ b/src/freedreno/vulkan/tu_cmd_buffer.c
@@ -62,6 +62,8 @@ static uint32_t
 tu_bo_list_add_info(struct tu_bo_list *list,
                     const struct drm_msm_gem_submit_bo *bo_info)
 {
+   assert(bo_info->handle != 0);
+
    for (uint32_t i = 0; i < list->count; ++i) {
       if (list->bo_infos[i].handle == bo_info->handle) {
          assert(list->bo_infos[i].presumed == bo_info->presumed);




More information about the mesa-commit mailing list