iris: Dump frame markers with INTEL_DEBUG=submit

Now you can see which batches go with which frames.

Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3830>
This commit is contained in:
Kenneth Graunke 2020-02-11 11:21:47 -08:00 committed by Marge Bot
parent e395ce03e9
commit 96f247d1b3
2 changed files with 18 additions and 0 deletions

View File

@ -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];

View File

@ -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]);