summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Clark <robclark@freedesktop.org>2016-06-22 10:41:24 -0400
committerRob Clark <robclark@freedesktop.org>2016-07-20 19:42:21 -0400
commitd93d697deb4a808890bc9c64ec453b2d2f2ebb7f (patch)
tree9face45f0395881f8d3999e8e207adc70fe0240e
parent1d1e01b2350e40711fcf19e200e46e2edfd887b2 (diff)
freedreno/msm: split out dump_submit() helper
Signed-off-by: Rob Clark <robclark@freedesktop.org>
-rw-r--r--freedreno/msm/msm_ringbuffer.c42
1 files changed, 24 insertions, 18 deletions
diff --git a/freedreno/msm/msm_ringbuffer.c b/freedreno/msm/msm_ringbuffer.c
index 7eebac18..301ac66f 100644
--- a/freedreno/msm/msm_ringbuffer.c
+++ b/freedreno/msm/msm_ringbuffer.c
@@ -295,13 +295,35 @@ static void flush_reset(struct fd_ringbuffer *ring)
msm_ring->nr_bos = 0;
}
+static void dump_submit(struct msm_ringbuffer *msm_ring)
+{
+ uint32_t i, j;
+
+ 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",
+ 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);
+ }
+ }
+}
+
static int msm_ringbuffer_flush(struct fd_ringbuffer *ring, uint32_t *last_start)
{
struct msm_ringbuffer *msm_ring = to_msm_ringbuffer(ring);
struct drm_msm_gem_submit req = {
.pipe = to_msm_pipe(ring->pipe)->pipe,
};
- uint32_t i, j, submit_offset, size;
+ uint32_t i, submit_offset, size;
int ret;
submit_offset = offset_bytes(last_start, ring->start);
@@ -331,23 +353,7 @@ 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",
- 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);
- }
- }
+ dump_submit(msm_ring);
} else if (!ret) {
/* update timestamp on all rings associated with submit: */
for (i = 0; i < msm_ring->submit.nr_cmds; i++) {