radv/amdgpu: Enable dumping of all IBs with RADV_DEBUG=allbos.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Fri, 17 Mar 2017 00:04:03 +0000 (01:04 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 29 Aug 2017 21:05:55 +0000 (23:05 +0200)
Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c

index ad4b0b3f9dc28c8418ebcb17ab67859d1233d7f4..adb855f97de9afe37d2b5aa763d4a6fcfd6d388b 100644 (file)
@@ -969,6 +969,19 @@ static void *radv_amdgpu_winsys_get_cpu_addr(void *_cs, uint64_t addr)
                                return (char *)ret + (addr - bo->va);
                }
        }
+       if(cs->ws->debug_all_bos) {
+               pthread_mutex_lock(&cs->ws->global_bo_list_lock);
+               list_for_each_entry(struct radv_amdgpu_winsys_bo, bo,
+                                   &cs->ws->global_bo_list, global_list_item) {
+                       if (addr >= bo->va && addr - bo->va < bo->size) {
+                               if (amdgpu_bo_cpu_map(bo->bo, &ret) == 0) {
+                                       pthread_mutex_unlock(&cs->ws->global_bo_list_lock);
+                                       return (char *)ret + (addr - bo->va);
+                               }
+                       }
+               }
+               pthread_mutex_unlock(&cs->ws->global_bo_list_lock);
+       }
        return ret;
 }