diff options
author | Rob Clark <robclark@freedesktop.org> | 2015-07-21 12:55:29 -0400 |
---|---|---|
committer | Rob Clark <robclark@freedesktop.org> | 2015-08-17 10:35:08 -0400 |
commit | 4413f191a051847c53a6150df199d35a106b6cf4 (patch) | |
tree | e4149fc985024fdeae876507eb5666d70726f4f9 /freedreno | |
parent | 9e34ee4f75ef559ff3a3c6d4b8f285453eea1f29 (diff) |
freedreno/msm: dump out submit info on error
User should only see these with LIBGL_DEBUG=verbose. But in case you
are hitting issues like "handle X at index Y already on submit list"
errors from the kernel, this gives some useful visibility for debug.
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Diffstat (limited to 'freedreno')
-rw-r--r-- | freedreno/msm/msm_ringbuffer.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/freedreno/msm/msm_ringbuffer.c b/freedreno/msm/msm_ringbuffer.c index 842574ec..5ddea574 100644 --- a/freedreno/msm/msm_ringbuffer.c +++ b/freedreno/msm/msm_ringbuffer.c @@ -31,6 +31,7 @@ #endif #include <assert.h> +#include <inttypes.h> #include "freedreno_ringbuffer.h" #include "msm_priv.h" @@ -228,7 +229,7 @@ static int msm_ringbuffer_flush(struct fd_ringbuffer *ring, uint32_t *last_start struct drm_msm_gem_submit req = { .pipe = to_msm_pipe(ring->pipe)->pipe, }; - uint32_t i, submit_offset, size; + uint32_t i, j, submit_offset, size; int ret; submit_offset = offset_bytes(last_start, ring->start); @@ -258,6 +259,23 @@ static int msm_ringbuffer_flush(struct fd_ringbuffer *ring, uint32_t *last_start &req, sizeof(req)); if (ret) { ERROR_MSG("submit failed: %d (%s)", ret, strerror(errno)); + ERROR_MSG(" pipe: %u", req.pipe); + for (i = 0; i < msm_ring->submit.nr_bos; i++) { + struct drm_msm_gem_submit_bo *bo = &msm_ring->submit.bos[i]; + ERROR_MSG(" bos[%d]: handle=%u, flags=%x", i, bo->handle, bo->flags); + } + for (i = 0; i < msm_ring->submit.nr_cmds; i++) { + struct drm_msm_gem_submit_cmd *cmd = &msm_ring->submit.cmds[i]; + struct drm_msm_gem_submit_reloc *relocs = U642VOID(cmd->relocs); + ERROR_MSG(" cmd[%d]: type=%u, submit_idx=%u, submit_offset=%u, size=%u\n", + i, cmd->type, cmd->submit_idx, cmd->submit_offset, cmd->size); + for (j = 0; j < cmd->nr_relocs; j++) { + struct drm_msm_gem_submit_reloc *r = &relocs[j]; + ERROR_MSG(" reloc[%d]: submit_offset=%u, or=%08x, shift=%d, reloc_idx=%u" + ", reloc_offset=%"PRIu64, j, r->submit_offset, r->or, r->shift, + r->reloc_idx, r->reloc_offset); + } + } } else { /* update timestamp on all rings associated with submit: */ for (i = 0; i < msm_ring->submit.nr_cmds; i++) { |