Mesa (master): iris: Dump frame markers with INTEL_DEBUG=submit

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Feb 15 01:17:13 UTC 2020


Module: Mesa
Branch: master
Commit: 96f247d1b33fafd42a02b58d3f5387f9b574badc
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=96f247d1b33fafd42a02b58d3f5387f9b574badc

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Tue Feb 11 11:21:47 2020 -0800

iris: Dump frame markers with INTEL_DEBUG=submit

Now you can see which batches go with which frames.

Acked-by: Jason Ekstrand <jason at jlekstrand.net>
Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3830>

---

 src/gallium/drivers/iris/iris_context.h |  3 +++
 src/gallium/drivers/iris/iris_fence.c   | 15 +++++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/src/gallium/drivers/iris/iris_context.h b/src/gallium/drivers/iris/iris_context.h
index 5eacc769f76..e76d3e79e81 100644
--- a/src/gallium/drivers/iris/iris_context.h
+++ b/src/gallium/drivers/iris/iris_context.h
@@ -687,6 +687,9 @@ struct iris_context {
 
    struct gen_perf_context *perf_ctx;
 
+   /** Frame number for debug prints */
+   uint32_t frame;
+
    struct {
       uint64_t dirty;
       uint64_t dirty_for_nos[IRIS_NOS_COUNT];
diff --git a/src/gallium/drivers/iris/iris_fence.c b/src/gallium/drivers/iris/iris_fence.c
index dbd2d826588..b163ef5a23b 100644
--- a/src/gallium/drivers/iris/iris_fence.c
+++ b/src/gallium/drivers/iris/iris_fence.c
@@ -156,6 +156,10 @@ iris_wait_syncpt(struct pipe_screen *p_screen,
    return gen_ioctl(screen->fd, DRM_IOCTL_SYNCOBJ_WAIT, &args);
 }
 
+#define CSI "\e["
+#define BLUE_HEADER  CSI "0;97;44m"
+#define NORMAL       CSI "0m"
+
 static void
 iris_fence_flush(struct pipe_context *ctx,
                  struct pipe_fence_handle **out_fence,
@@ -164,6 +168,17 @@ iris_fence_flush(struct pipe_context *ctx,
    struct iris_screen *screen = (void *) ctx->screen;
    struct iris_context *ice = (struct iris_context *)ctx;
 
+   if (flags & PIPE_FLUSH_END_OF_FRAME) {
+      ice->frame++;
+
+      if (INTEL_DEBUG & DEBUG_SUBMIT) {
+         fprintf(stderr, "%s ::: FRAME %-10u (ctx %p)%-35c%s\n",
+                 (INTEL_DEBUG & DEBUG_COLOR) ? BLUE_HEADER : "",
+                 ice->frame, ctx, ' ',
+                 (INTEL_DEBUG & DEBUG_COLOR) ? NORMAL : "");
+      }
+   }
+
    /* XXX PIPE_FLUSH_DEFERRED */
    for (unsigned i = 0; i < IRIS_BATCH_COUNT; i++)
       iris_batch_flush(&ice->batches[i]);



More information about the mesa-commit mailing list