From 38917a6055fb09ddf8eac1da370fe7ed2566637d Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Sun, 8 Aug 2021 01:48:27 -0700 Subject: [PATCH] iris: Change the validation list debug code to print the BO list instead This code assumed that batch->exec_bos[i] matched validation_list[i], which won't be true once we start suballocating BOs. This patch changes it to print the full exec_bos[i] list instead of the validation list, as that has the logical list of objects, names, addresses, placement, whether they are suballocated, and so on. It may be useful to look at the actual validation list as well; I'm not sure how common that is. We may want to add additional debug prints in the future. Reviewed-by: Paulo Zanoni Part-of: --- src/gallium/drivers/iris/iris_batch.c | 29 +++++++++++++++------------ 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/gallium/drivers/iris/iris_batch.c b/src/gallium/drivers/iris/iris_batch.c index e0c0aec8aa2..020db7eebc5 100644 --- a/src/gallium/drivers/iris/iris_batch.c +++ b/src/gallium/drivers/iris/iris_batch.c @@ -97,22 +97,25 @@ dump_fence_list(struct iris_batch *batch) * Debugging code to dump the validation list, used by INTEL_DEBUG=submit. */ static void -dump_validation_list(struct iris_batch *batch, - struct drm_i915_gem_exec_object2 *validation_list) +dump_bo_list(struct iris_batch *batch) { - fprintf(stderr, "Validation list (length %d):\n", batch->exec_count); + fprintf(stderr, "BO list (length %d):\n", batch->exec_count); for (int i = 0; i < batch->exec_count; i++) { - uint64_t flags = validation_list[i].flags; - assert(validation_list[i].handle == batch->exec_bos[i]->gem_handle); - fprintf(stderr, "[%2d]: %2d %-14s @ 0x%"PRIx64" (%"PRIu64"B)\t %2d refs %s\n", + struct iris_bo *bo = batch->exec_bos[i]; + struct iris_bo *backing = iris_get_backing_bo(bo); + bool written = BITSET_TEST(batch->bos_written, i); + + fprintf(stderr, "[%2d]: %3d (%3d) %-14s @ 0x%016"PRIx64" (%-6s %8"PRIu64"B) %2d refs %s\n", i, - validation_list[i].handle, - batch->exec_bos[i]->name, - (uint64_t)validation_list[i].offset, - batch->exec_bos[i]->size, - batch->exec_bos[i]->refcount, - (flags & EXEC_OBJECT_WRITE) ? " (write)" : ""); + bo->gem_handle, + backing->gem_handle, + bo->name, + bo->address, + backing->real.local ? "local" : "system", + bo->size, + bo->refcount, + written ? "(write)" : ""); } } @@ -783,7 +786,7 @@ submit_batch(struct iris_batch *batch) if (INTEL_DEBUG & (DEBUG_BATCH | DEBUG_SUBMIT)) { dump_fence_list(batch); - dump_validation_list(batch, validation_list); + dump_bo_list(batch); } if (INTEL_DEBUG & DEBUG_BATCH) {