From eef54f31756b910dce1ae7dca8fcbd4e458bc75c Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Tue, 1 Aug 2023 23:16:43 +0300 Subject: [PATCH] intel/decoder: add options to decode surfaces/samplers MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Lionel Landwerlin Reviewed-by: Tapani Pälli Part-of: --- src/gallium/drivers/crocus/crocus_batch.c | 6 ++---- src/gallium/drivers/iris/iris_batch.c | 7 ++----- src/intel/common/intel_batch_decoder.c | 7 +++++-- src/intel/common/intel_decoder.h | 11 +++++++++++ src/intel/vulkan/anv_device.c | 6 +----- src/intel/vulkan_hasvk/anv_device.c | 6 +----- 6 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/gallium/drivers/crocus/crocus_batch.c b/src/gallium/drivers/crocus/crocus_batch.c index 8a1f4cb..f777683 100644 --- a/src/gallium/drivers/crocus/crocus_batch.c +++ b/src/gallium/drivers/crocus/crocus_batch.c @@ -249,10 +249,8 @@ crocus_init_batch(struct crocus_context *ice, if (INTEL_DEBUG(DEBUG_BATCH)) { batch->state_sizes = _mesa_hash_table_u64_create(NULL); - const unsigned decode_flags = - INTEL_BATCH_DECODE_FULL | - (INTEL_DEBUG(DEBUG_COLOR) ? INTEL_BATCH_DECODE_IN_COLOR : 0) | - INTEL_BATCH_DECODE_OFFSETS | INTEL_BATCH_DECODE_FLOATS; + const unsigned decode_flags = INTEL_BATCH_DECODE_DEFAULT_FLAGS | + (INTEL_DEBUG(DEBUG_COLOR) ? INTEL_BATCH_DECODE_IN_COLOR : 0); intel_batch_decode_ctx_init(&batch->decoder, &screen->compiler->isa, &screen->devinfo, stderr, diff --git a/src/gallium/drivers/iris/iris_batch.c b/src/gallium/drivers/iris/iris_batch.c index 9ca562f..cf388af 100644 --- a/src/gallium/drivers/iris/iris_batch.c +++ b/src/gallium/drivers/iris/iris_batch.c @@ -229,11 +229,8 @@ iris_init_batch(struct iris_context *ice, } if (INTEL_DEBUG(DEBUG_ANY)) { - const unsigned decode_flags = - INTEL_BATCH_DECODE_FULL | - (INTEL_DEBUG(DEBUG_COLOR) ? INTEL_BATCH_DECODE_IN_COLOR : 0) | - INTEL_BATCH_DECODE_OFFSETS | - INTEL_BATCH_DECODE_FLOATS; + const unsigned decode_flags = INTEL_BATCH_DECODE_DEFAULT_FLAGS | + (INTEL_DEBUG(DEBUG_COLOR) ? INTEL_BATCH_DECODE_IN_COLOR : 0); intel_batch_decode_ctx_init(&batch->decoder, &screen->compiler->isa, screen->devinfo, diff --git a/src/intel/common/intel_batch_decoder.c b/src/intel/common/intel_batch_decoder.c index 4f2a01e..afe0f39 100644 --- a/src/intel/common/intel_batch_decoder.c +++ b/src/intel/common/intel_batch_decoder.c @@ -34,6 +34,7 @@ static const struct debug_control debug_control[] = { { "full", INTEL_BATCH_DECODE_FULL }, { "offsets", INTEL_BATCH_DECODE_OFFSETS }, { "floats", INTEL_BATCH_DECODE_FLOATS }, + { "surfaces", INTEL_BATCH_DECODE_SURFACES }, { NULL, 0 } }; @@ -356,7 +357,8 @@ dump_binding_table(struct intel_batch_decode_ctx *ctx, } fprintf(ctx->fp, "pointer %u: 0x%08x\n", i, pointers[i]); - ctx_print_group(ctx, strct, addr, bo.map + (addr - bo.addr)); + if (ctx->flags & INTEL_BATCH_DECODE_SURFACES) + ctx_print_group(ctx, strct, addr, bo.map + (addr - bo.addr)); } } @@ -391,7 +393,8 @@ dump_samplers(struct intel_batch_decode_ctx *ctx, uint32_t offset, int count) for (int i = 0; i < count; i++) { fprintf(ctx->fp, "sampler state %d\n", i); - ctx_print_group(ctx, strct, state_addr, state_map); + if (ctx->flags & INTEL_BATCH_DECODE_SAMPLERS) + ctx_print_group(ctx, strct, state_addr, state_map); state_addr += sampler_state_size; state_map += sampler_state_size; } diff --git a/src/intel/common/intel_decoder.h b/src/intel/common/intel_decoder.h index 22ce09c..09c38a7 100644 --- a/src/intel/common/intel_decoder.h +++ b/src/intel/common/intel_decoder.h @@ -216,8 +216,19 @@ enum intel_batch_decode_flags { INTEL_BATCH_DECODE_OFFSETS = (1 << 2), /** Guess when a value is a float and print it as such */ INTEL_BATCH_DECODE_FLOATS = (1 << 3), + /** Print surface states */ + INTEL_BATCH_DECODE_SURFACES = (1 << 4), + /** Print sampler states */ + INTEL_BATCH_DECODE_SAMPLERS = (1 << 5), }; +#define INTEL_BATCH_DECODE_DEFAULT_FLAGS \ + (INTEL_BATCH_DECODE_FULL | \ + INTEL_BATCH_DECODE_OFFSETS | \ + INTEL_BATCH_DECODE_FLOATS | \ + INTEL_BATCH_DECODE_SURFACES | \ + INTEL_BATCH_DECODE_SAMPLERS) + struct intel_batch_decode_bo { uint64_t addr; uint32_t size; diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 9902228..47be975 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -3043,11 +3043,7 @@ VkResult anv_CreateDevice( for (unsigned i = 0; i < physical_device->queue.family_count; i++) { struct intel_batch_decode_ctx *decoder = &device->decoder[i]; - const unsigned decode_flags = - INTEL_BATCH_DECODE_FULL | - (INTEL_DEBUG(DEBUG_COLOR) ? INTEL_BATCH_DECODE_IN_COLOR : 0) | - INTEL_BATCH_DECODE_OFFSETS | - INTEL_BATCH_DECODE_FLOATS; + const unsigned decode_flags = INTEL_BATCH_DECODE_DEFAULT_FLAGS; intel_batch_decode_ctx_init(decoder, &physical_device->compiler->isa, diff --git a/src/intel/vulkan_hasvk/anv_device.c b/src/intel/vulkan_hasvk/anv_device.c index b49de49..5b4371a 100644 --- a/src/intel/vulkan_hasvk/anv_device.c +++ b/src/intel/vulkan_hasvk/anv_device.c @@ -2729,11 +2729,7 @@ VkResult anv_CreateDevice( goto fail_alloc; if (INTEL_DEBUG(DEBUG_BATCH)) { - const unsigned decode_flags = - INTEL_BATCH_DECODE_FULL | - (INTEL_DEBUG(DEBUG_COLOR) ? INTEL_BATCH_DECODE_IN_COLOR : 0) | - INTEL_BATCH_DECODE_OFFSETS | - INTEL_BATCH_DECODE_FLOATS; + const unsigned decode_flags = INTEL_BATCH_DECODE_DEFAULT_FLAGS; intel_batch_decode_ctx_init(&device->decoder_ctx, &physical_device->compiler->isa, -- 2.7.4