turnip: Sanity check that we're adding valid BOs to the list.
authorEric Anholt <eric@anholt.net>
Wed, 4 Dec 2019 20:21:50 +0000 (12:21 -0800)
committerEric Anholt <eric@anholt.net>
Thu, 5 Dec 2019 04:32:15 +0000 (20:32 -0800)
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@marek.ca>
src/freedreno/vulkan/tu_cmd_buffer.c

index 47f95e4b00a225b0aecad667662fc5c722301b18..bb9d18604b8500dfb86a98e1e8cc7536d32bc067 100644 (file)
@@ -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);