From e937c4b716f9e60b80368766fa3db0dee2cdc27e Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Thu, 5 Jan 2023 13:32:04 -0800 Subject: [PATCH] anv: Add an aperture space summary to INTEL_DEBUG=submit. Same as on iris, this is nice for tracking at a high level how much memory is being used. Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/vulkan/anv_batch_chain.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c index bd66a24b9a2..decc3740368 100644 --- a/src/intel/vulkan/anv_batch_chain.c +++ b/src/intel/vulkan/anv_batch_chain.c @@ -1829,8 +1829,15 @@ anv_queue_exec_locked(struct anv_queue *queue, perf_query_pool && perf_query_pass >= 0 && cmd_buffer_count; if (INTEL_DEBUG(DEBUG_SUBMIT)) { - fprintf(stderr, "Batch offset=0x%x len=0x%x on queue 0\n", - execbuf.execbuf.batch_start_offset, execbuf.execbuf.batch_len); + uint32_t total_size_kb = 0; + for (uint32_t i = 0; i < execbuf.bo_count; i++) { + const struct anv_bo *bo = execbuf.bos[i]; + total_size_kb += bo->size / 1024; + } + + fprintf(stderr, "Batch offset=0x%x len=0x%x on queue 0 (%.1fMb aperture)\n", + execbuf.execbuf.batch_start_offset, execbuf.execbuf.batch_len, + (float)total_size_kb / 1024.0f); for (uint32_t i = 0; i < execbuf.bo_count; i++) { const struct anv_bo *bo = execbuf.bos[i];