From 432790bacd113f4c0b0aaa3076f5ea170106b50f Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Sun, 17 Jun 2018 22:22:03 -0700 Subject: [PATCH] iris: print binder utilization in INTEL_DEBUG=submit --- src/gallium/drivers/iris/iris_batch.c | 6 ++++-- src/gallium/drivers/iris/iris_binder.c | 9 +++------ src/gallium/drivers/iris/iris_binder.h | 2 ++ src/gallium/drivers/iris/iris_draw.c | 1 + 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/gallium/drivers/iris/iris_batch.c b/src/gallium/drivers/iris/iris_batch.c index d552579782f..17d32bd9d12 100644 --- a/src/gallium/drivers/iris/iris_batch.c +++ b/src/gallium/drivers/iris/iris_batch.c @@ -431,12 +431,14 @@ _iris_batch_flush_fence(struct iris_batch *batch, if (unlikely(INTEL_DEBUG & (DEBUG_BATCH | DEBUG_SUBMIT))) { int bytes_for_commands = batch_bytes_used(batch); + int bytes_for_binder = batch->binder.insert_point; if (batch->bo != batch->exec_bos[0]) bytes_for_commands += batch->primary_batch_size; - fprintf(stderr, "%19s:%-3d: Batchbuffer flush with %5db (%0.1f%%), " - "%4d BOs (%0.1fMb aperture)\n", + fprintf(stderr, "%19s:%-3d: Batchbuffer flush with %5db (%0.1f%%) " + "(cmds), %5db (%0.1f%%) (binder), %4d BOs (%0.1fMb aperture)\n", file, line, bytes_for_commands, 100.0f * bytes_for_commands / BATCH_SZ, + bytes_for_binder, 100.0f * bytes_for_binder / IRIS_BINDER_SIZE, batch->exec_count, (float) batch->aperture_space / (1024 * 1024)); dump_validation_list(batch); diff --git a/src/gallium/drivers/iris/iris_binder.c b/src/gallium/drivers/iris/iris_binder.c index 02b0fab50d0..2f5318ed7fd 100644 --- a/src/gallium/drivers/iris/iris_binder.c +++ b/src/gallium/drivers/iris/iris_binder.c @@ -27,9 +27,6 @@ #include "iris_bufmgr.h" #include "iris_context.h" -/* 64kb */ -#define BINDER_SIZE (64 * 1024) - /** * Reserve a block of space in the binder. */ @@ -44,13 +41,13 @@ iris_binder_reserve(struct iris_batch *batch, unsigned size) /* If we can't fit all stages in the binder, flush the batch which * will cause us to gain a new empty binder. */ - if (binder->insert_point + size > BINDER_SIZE) + if (binder->insert_point + size > IRIS_BINDER_SIZE) iris_batch_flush(batch); uint32_t offset = binder->insert_point; /* It had better fit now. */ - assert(offset + size <= BINDER_SIZE); + assert(offset + size <= IRIS_BINDER_SIZE); binder->insert_point = align(binder->insert_point + size, 64); @@ -97,7 +94,7 @@ void iris_init_binder(struct iris_binder *binder, struct iris_bufmgr *bufmgr) { binder->bo = - iris_bo_alloc(bufmgr, "binder", BINDER_SIZE, IRIS_MEMZONE_BINDER); + iris_bo_alloc(bufmgr, "binder", IRIS_BINDER_SIZE, IRIS_MEMZONE_BINDER); binder->map = iris_bo_map(NULL, binder->bo, MAP_WRITE); binder->insert_point = INIT_INSERT_POINT; } diff --git a/src/gallium/drivers/iris/iris_binder.h b/src/gallium/drivers/iris/iris_binder.h index dbb010693f5..bae548b9d73 100644 --- a/src/gallium/drivers/iris/iris_binder.h +++ b/src/gallium/drivers/iris/iris_binder.h @@ -33,6 +33,8 @@ struct iris_batch; struct iris_bufmgr; struct iris_compiled_shader; +#define IRIS_BINDER_SIZE (64 * 1024) + struct iris_binder { struct iris_bo *bo; diff --git a/src/gallium/drivers/iris/iris_draw.c b/src/gallium/drivers/iris/iris_draw.c index 8fc080b013c..218a3076699 100644 --- a/src/gallium/drivers/iris/iris_draw.c +++ b/src/gallium/drivers/iris/iris_draw.c @@ -63,6 +63,7 @@ iris_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info) IRIS_DIRTY_BINDINGS_FS; } + // XXX: don't do this unless things are dirty... iris_binder_reserve_3d(batch, ice->shaders.prog); ice->vtbl.upload_render_state(ice, batch, info); -- 2.30.2