summaryrefslogtreecommitdiffstats
path: root/src/amd
diff options
context:
space:
mode:
authorGrazvydas Ignotas <[email protected]>2017-06-11 16:46:17 +0300
committerEmil Velikov <[email protected]>2017-06-14 12:47:58 +0100
commit3734a7de6c6daca154db448cad8723bd16e4943d (patch)
treed85c8deeb076e01f2be0f1ab1871eaddf96a6b53 /src/amd
parent423dab9d324e774c807403549c8e67d826af7bd4 (diff)
radv: fix trace dumping for !use_ib_bos
Fixes trace dumping crash for SI or when RADV_DEBUG=noibs is set. Fixes: 97dfff5410 "radv: Dump command buffer on hang." Signed-off-by: Grazvydas Ignotas <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> (cherry picked from commit fae3b139055f32c4d076c170726393995be96d1b)
Diffstat (limited to 'src/amd')
-rw-r--r--src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c
index 8430df4d0fe..ca7d647fdac 100644
--- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c
+++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c
@@ -931,6 +931,9 @@ static void *radv_amdgpu_winsys_get_cpu_addr(void *_cs, uint64_t addr)
{
struct radv_amdgpu_cs *cs = (struct radv_amdgpu_cs *)_cs;
void *ret = NULL;
+
+ if (!cs->ib_buffer)
+ return NULL;
for (unsigned i = 0; i <= cs->num_old_ib_buffers; ++i) {
struct radv_amdgpu_winsys_bo *bo;
@@ -949,10 +952,15 @@ static void radv_amdgpu_winsys_cs_dump(struct radeon_winsys_cs *_cs,
uint32_t trace_id)
{
struct radv_amdgpu_cs *cs = (struct radv_amdgpu_cs *)_cs;
+ void *ib = cs->base.buf;
+ int num_dw = cs->base.cdw;
- ac_parse_ib(file,
- radv_amdgpu_winsys_get_cpu_addr(cs, cs->ib.ib_mc_address),
- cs->ib.size, trace_id, "main IB", cs->ws->info.chip_class,
+ if (cs->ws->use_ib_bos) {
+ ib = radv_amdgpu_winsys_get_cpu_addr(cs, cs->ib.ib_mc_address);
+ num_dw = cs->ib.size;
+ }
+ assert(ib);
+ ac_parse_ib(file, ib, num_dw, trace_id, "main IB", cs->ws->info.chip_class,
radv_amdgpu_winsys_get_cpu_addr, cs);
}