aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Clark2016-06-22 09:41:24 -0500
committerRob Clark2016-07-20 18:42:21 -0500
commitd93d697deb4a808890bc9c64ec453b2d2f2ebb7f (patch)
tree9face45f0395881f8d3999e8e207adc70fe0240e /freedreno
parent1d1e01b2350e40711fcf19e200e46e2edfd887b2 (diff)
downloadexternal-libdrm-d93d697deb4a808890bc9c64ec453b2d2f2ebb7f.tar.gz
external-libdrm-d93d697deb4a808890bc9c64ec453b2d2f2ebb7f.tar.xz
external-libdrm-d93d697deb4a808890bc9c64ec453b2d2f2ebb7f.zip
freedreno/msm: split out dump_submit() helper
Signed-off-by: Rob Clark <robclark@freedesktop.org>
Diffstat (limited to 'freedreno')
-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)
295 msm_ring->nr_bos = 0; 295 msm_ring->nr_bos = 0;
296} 296}
297 297
298static void dump_submit(struct msm_ringbuffer *msm_ring)
299{
300 uint32_t i, j;
301
302 for (i = 0; i < msm_ring->submit.nr_bos; i++) {
303 struct drm_msm_gem_submit_bo *bo = &msm_ring->submit.bos[i];
304 ERROR_MSG(" bos[%d]: handle=%u, flags=%x", i, bo->handle, bo->flags);
305 }
306 for (i = 0; i < msm_ring->submit.nr_cmds; i++) {
307 struct drm_msm_gem_submit_cmd *cmd = &msm_ring->submit.cmds[i];
308 struct drm_msm_gem_submit_reloc *relocs = U642VOID(cmd->relocs);
309 ERROR_MSG(" cmd[%d]: type=%u, submit_idx=%u, submit_offset=%u, size=%u",
310 i, cmd->type, cmd->submit_idx, cmd->submit_offset, cmd->size);
311 for (j = 0; j < cmd->nr_relocs; j++) {
312 struct drm_msm_gem_submit_reloc *r = &relocs[j];
313 ERROR_MSG(" reloc[%d]: submit_offset=%u, or=%08x, shift=%d, reloc_idx=%u"
314 ", reloc_offset=%"PRIu64, j, r->submit_offset, r->or, r->shift,
315 r->reloc_idx, r->reloc_offset);
316 }
317 }
318}
319
298static int msm_ringbuffer_flush(struct fd_ringbuffer *ring, uint32_t *last_start) 320static int msm_ringbuffer_flush(struct fd_ringbuffer *ring, uint32_t *last_start)
299{ 321{
300 struct msm_ringbuffer *msm_ring = to_msm_ringbuffer(ring); 322 struct msm_ringbuffer *msm_ring = to_msm_ringbuffer(ring);
301 struct drm_msm_gem_submit req = { 323 struct drm_msm_gem_submit req = {
302 .pipe = to_msm_pipe(ring->pipe)->pipe, 324 .pipe = to_msm_pipe(ring->pipe)->pipe,
303 }; 325 };
304 uint32_t i, j, submit_offset, size; 326 uint32_t i, submit_offset, size;
305 int ret; 327 int ret;
306 328
307 submit_offset = offset_bytes(last_start, ring->start); 329 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
331 &req, sizeof(req)); 353 &req, sizeof(req));
332 if (ret) { 354 if (ret) {
333 ERROR_MSG("submit failed: %d (%s)", ret, strerror(errno)); 355 ERROR_MSG("submit failed: %d (%s)", ret, strerror(errno));
334 ERROR_MSG(" pipe: %u", req.pipe); 356 dump_submit(msm_ring);
335 for (i = 0; i < msm_ring->submit.nr_bos; i++) {
336 struct drm_msm_gem_submit_bo *bo = &msm_ring->submit.bos[i];
337 ERROR_MSG(" bos[%d]: handle=%u, flags=%x", i, bo->handle, bo->flags);
338 }
339 for (i = 0; i < msm_ring->submit.nr_cmds; i++) {
340 struct drm_msm_gem_submit_cmd *cmd = &msm_ring->submit.cmds[i];
341 struct drm_msm_gem_submit_reloc *relocs = U642VOID(cmd->relocs);
342 ERROR_MSG(" cmd[%d]: type=%u, submit_idx=%u, submit_offset=%u, size=%u",
343 i, cmd->type, cmd->submit_idx, cmd->submit_offset, cmd->size);
344 for (j = 0; j < cmd->nr_relocs; j++) {
345 struct drm_msm_gem_submit_reloc *r = &relocs[j];
346 ERROR_MSG(" reloc[%d]: submit_offset=%u, or=%08x, shift=%d, reloc_idx=%u"
347 ", reloc_offset=%"PRIu64, j, r->submit_offset, r->or, r->shift,
348 r->reloc_idx, r->reloc_offset);
349 }
350 }
351 } else if (!ret) { 357 } else if (!ret) {
352 /* update timestamp on all rings associated with submit: */ 358 /* update timestamp on all rings associated with submit: */
353 for (i = 0; i < msm_ring->submit.nr_cmds; i++) { 359 for (i = 0; i < msm_ring->submit.nr_cmds; i++) {