summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/winsys
diff options
context:
space:
mode:
authorBas Nieuwenhuizen <[email protected]>2017-03-17 01:04:03 +0100
committerBas Nieuwenhuizen <[email protected]>2017-08-29 23:05:55 +0200
commit43eb761cad8a7941788735d2d7a5f10a36a25148 (patch)
tree7abf46ac9315f4b1d542dc27b7f58186ae83f5db /src/amd/vulkan/winsys
parent9e07005e8709a51f9236e78e8d47d71ab3243e4d (diff)
radv/amdgpu: Enable dumping of all IBs with RADV_DEBUG=allbos.
Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/vulkan/winsys')
-rw-r--r--src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c
index ad4b0b3f9dc..adb855f97de 100644
--- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c
+++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c
@@ -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;
}