diff options
author | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2017-02-19 10:00:25 +0100 |
---|---|---|
committer | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2017-07-13 13:27:35 +0200 |
commit | 7e02f443587ab0a59034835d35336a2bd68f29a2 (patch) | |
tree | a220908b40ab8aca87024946514b9cc11afc23e4 | |
parent | 20eddc2b092a4425229dec3dd6ed9727bf0c929f (diff) |
HACK dump bo list on submit error
-rw-r--r-- | src/gallium/winsys/amdgpu/drm/amdgpu_cs.c | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c index d266253886..f6ca46de05 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c @@ -32,6 +32,7 @@ #include "amdgpu_cs.h" #include "os/os_time.h" +#include <inttypes.h> #include <stdio.h> #include <amdgpu_drm.h> @@ -1131,6 +1132,24 @@ static bool amdgpu_add_sparse_backing_buffers(struct amdgpu_cs_context *cs) return true; } +static void dump_bo_list(struct amdgpu_cs *acs) +{ + struct amdgpu_cs_context *cs = acs->cst; + uint64_t total_size = 0; + + fprintf(stderr, "Real buffers: %u\n", cs->num_real_buffers); + + for (unsigned i = 0; i < cs->num_real_buffers; ++i) { + fprintf(stderr, " va=0x%"PRIx64" size=0x%"PRIx64" domain=%u handle=%p flags=%u\n", + cs->real_buffers[i].bo->va, cs->real_buffers[i].bo->base.size, + cs->real_buffers[i].bo->initial_domain, + cs->handles[i], cs->flags[i]); + total_size += cs->real_buffers[i].bo->base.size; + } + + fprintf(stderr, "Total size: %"PRIu64"\n", total_size); +} + void amdgpu_cs_submit_ib(void *job, int thread_index) { struct amdgpu_cs *acs = (struct amdgpu_cs*)job; @@ -1248,13 +1267,16 @@ bo_list_error: cs->error_code = r; if (r) { - if (r == -ENOMEM) + if (r == -ENOMEM) { fprintf(stderr, "amdgpu: Not enough memory for command submission.\n"); - else if (r == -ECANCELED) + dump_bo_list(acs); + } else if (r == -ECANCELED) fprintf(stderr, "amdgpu: The CS has been cancelled because the context is lost.\n"); - else + else { fprintf(stderr, "amdgpu: The CS has been rejected, " "see dmesg for more information (%i).\n", r); + dump_bo_list(acs); + } amdgpu_fence_signalled(cs->fence); |