freedreno: spiff up some debug traces
authorRob Clark <robdclark@gmail.com>
Tue, 28 Jun 2016 11:53:34 +0000 (07:53 -0400)
committerRob Clark <robdclark@gmail.com>
Sat, 30 Jul 2016 13:23:42 +0000 (09:23 -0400)
Make it easier to track batches, to ensure things happen properly when
they are reordered.

Signed-off-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/freedreno_context.c
src/gallium/drivers/freedreno/freedreno_draw.c
src/gallium/drivers/freedreno/freedreno_gmem.c
src/gallium/drivers/freedreno/freedreno_resource.c
src/gallium/drivers/freedreno/freedreno_screen.c
src/gallium/drivers/freedreno/freedreno_util.h

index e81d31175f0a931dc9da17305446b9972025328a..13a17e2a78e46e99c779ef24e38a211e9c248d0d 100644 (file)
@@ -126,6 +126,12 @@ fd_context_destroy(struct pipe_context *pctx)
 
        fd_device_del(ctx->dev);
 
+       if (fd_mesa_debug & (FD_DBG_BSTAT | FD_DBG_MSGS)) {
+               printf("batch_total=%u, batch_sysmem=%u, batch_gmem=%u, batch_restore=%u\n",
+                       (uint32_t)ctx->stats.batch_total, (uint32_t)ctx->stats.batch_sysmem,
+                       (uint32_t)ctx->stats.batch_gmem, (uint32_t)ctx->stats.batch_restore);
+       }
+
        FREE(ctx);
 }
 
index f067715e5358d7a2a315d3d14be569a85a47b109..b8ba4545b942badb720dad9d5dd10df93395e926 100644 (file)
@@ -170,7 +170,8 @@ fd_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
        /* and any buffers used, need to be resolved: */
        batch->resolve |= buffers;
 
-       DBG("%x num_draws=%u (%s/%s)", buffers, batch->num_draws,
+       DBG("%p: %x %ux%u num_draws=%u (%s/%s)", batch, buffers,
+               pfb->width, pfb->height, batch->num_draws,
                util_format_short_name(pipe_surface_format(pfb->cbufs[0])),
                util_format_short_name(pipe_surface_format(pfb->zsbuf)));
 
@@ -242,7 +243,8 @@ fd_clear(struct pipe_context *pctx, unsigned buffers,
                batch->gmem_reason |= FD_GMEM_CLEARS_DEPTH_STENCIL;
        }
 
-       DBG("%x depth=%f, stencil=%u (%s/%s)", buffers, depth, stencil,
+       DBG("%p: %x %ux%u depth=%f, stencil=%u (%s/%s)", batch, buffers,
+               pfb->width, pfb->height, depth, stencil,
                util_format_short_name(pipe_surface_format(pfb->cbufs[0])),
                util_format_short_name(pipe_surface_format(pfb->zsbuf)));
 
index 9ca7f5f93ffb5cea67d49ddd5f2651f1a91ba09e..a075a8b5c95e0d84f06b2d781452513783870658 100644 (file)
@@ -383,7 +383,8 @@ fd_gmem_render_tiles(struct fd_batch *batch)
        ctx->stats.batch_total++;
 
        if (sysmem) {
-               DBG("rendering sysmem (%s/%s)",
+               DBG("%p: rendering sysmem %ux%u (%s/%s)",
+                       batch, pfb->width, pfb->height,
                        util_format_short_name(pipe_surface_format(pfb->cbufs[0])),
                        util_format_short_name(pipe_surface_format(pfb->zsbuf)));
                fd_hw_query_prepare(ctx, 1);
@@ -392,7 +393,8 @@ fd_gmem_render_tiles(struct fd_batch *batch)
        } else {
                struct fd_gmem_stateobj *gmem = &ctx->gmem;
                calculate_tiles(batch);
-               DBG("rendering %dx%d tiles (%s/%s)", gmem->nbins_x, gmem->nbins_y,
+               DBG("%p: rendering %dx%d tiles %ux%u (%s/%s)",
+                       batch, pfb->width, pfb->height, gmem->nbins_x, gmem->nbins_y,
                        util_format_short_name(pipe_surface_format(pfb->cbufs[0])),
                        util_format_short_name(pipe_surface_format(pfb->zsbuf)));
                fd_hw_query_prepare(ctx, gmem->nbins_x * gmem->nbins_y);
index ae8061cba28f365cd14d3435e4cea4b4b11465ca..5bcf11da85bef67b3e8b329521125d4bcd87497f 100644 (file)
@@ -575,8 +575,8 @@ fd_resource_create(struct pipe_screen *pscreen,
        enum pipe_format format = tmpl->format;
        uint32_t size, alignment;
 
-       DBG("target=%d, format=%s, %ux%ux%u, array_size=%u, last_level=%u, "
-                       "nr_samples=%u, usage=%u, bind=%x, flags=%x",
+       DBG("%p: target=%d, format=%s, %ux%ux%u, array_size=%u, last_level=%u, "
+                       "nr_samples=%u, usage=%u, bind=%x, flags=%x", prsc,
                        tmpl->target, util_format_name(format),
                        tmpl->width0, tmpl->height0, tmpl->depth0,
                        tmpl->array_size, tmpl->last_level, tmpl->nr_samples,
index 31f2cb2147aadf97962a3c6a545541948662cf5c..1a59a883b6db7e83146abdaaf845810d0f6737b3 100644 (file)
@@ -76,6 +76,7 @@ static const struct debug_named_value debug_options[] = {
                {"deqp",      FD_DBG_DEQP,   "Enable dEQP hacks"},
                {"nir",       FD_DBG_NIR,    "Prefer NIR as native IR"},
                {"reorder",   FD_DBG_REORDER,"Enable reordering for draws/blits"},
+               {"bstat",     FD_DBG_BSTAT,  "Print batch stats at context destroy"},
                DEBUG_NAMED_VALUE_END
 };
 
index 5cb958e65ab043b0e246b6032597a85cf4e1fcf1..ea08e31c4650c558e6964cf23af713859f7fd18c 100644 (file)
@@ -76,6 +76,7 @@ enum adreno_stencil_op fd_stencil_op(unsigned op);
 #define FD_DBG_DEQP     0x2000
 #define FD_DBG_NIR      0x4000
 #define FD_DBG_REORDER  0x8000
+#define FD_DBG_BSTAT   0x10000
 
 extern int fd_mesa_debug;
 extern bool fd_binning_enabled;