From ba3b1c2d12055d4a83499b23a2c469c76cce41b8 Mon Sep 17 00:00:00 2001 From: Paulo Zanoni Date: Wed, 10 Apr 2024 17:12:16 -0700 Subject: [PATCH] anv/sparse: adjust sparse_bind_image_memory debug messages Since we moved the dump_anv_vm_bind() call to anv_sparse_bind(), that BEGIN/END block stopped making sense, so just keep the first set of messages. Also wrap everything around a single INTEL_DEBUG() check so we'll only run this check once when debug is disabled (we don't care about running the check multiple times if it's enabled). Reviewed-by: Lionel Landwerlin Signed-off-by: Paulo Zanoni Part-of: --- src/intel/vulkan/anv_sparse.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/intel/vulkan/anv_sparse.c b/src/intel/vulkan/anv_sparse.c index 1eb8de56e31..e6bff9a182e 100644 --- a/src/intel/vulkan/anv_sparse.c +++ b/src/intel/vulkan/anv_sparse.c @@ -1024,15 +1024,18 @@ anv_sparse_bind_image_memory(struct anv_queue *queue, const struct isl_format_layout *layout = isl_format_get_layout(surf->format); - sparse_debug("\n=== [%s:%d] [%s] BEGIN\n", __FILE__, __LINE__, __func__); - sparse_debug("--> mip_level:%d array_layer:%d\n", - mip_level, array_layer); - sparse_debug("aspect:0x%x plane:%d\n", aspect, plane); - sparse_debug("binding offset: [%d, %d, %d] extent: [%d, %d, %d]\n", - bind->offset.x, bind->offset.y, bind->offset.z, - bind->extent.width, bind->extent.height, bind->extent.depth); - dump_anv_image(image); - dump_isl_surf(surf); + if (INTEL_DEBUG(DEBUG_SPARSE)) { + sparse_debug("%s:", __func__); + sparse_debug("mip_level:%d array_layer:%d\n", mip_level, array_layer); + sparse_debug("aspect:0x%x plane:%d\n", aspect, plane); + sparse_debug("binding offset: [%d, %d, %d] extent: [%d, %d, %d]\n", + bind->offset.x, bind->offset.y, bind->offset.z, + bind->extent.width, bind->extent.height, + bind->extent.depth); + dump_anv_image(image); + dump_isl_surf(surf); + sparse_debug("\n"); + } VkExtent3D block_shape_px = anv_sparse_calc_block_shape(device->physical, surf); @@ -1119,7 +1122,6 @@ anv_sparse_bind_image_memory(struct anv_queue *queue, } } - sparse_debug("\n=== [%s:%d] [%s] END\n", __FILE__, __LINE__, __func__); return VK_SUCCESS; }