From 184fc71aa171ae920eb8bd8309704f535fa5cd84 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Thu, 21 Dec 2023 12:33:34 -0500 Subject: [PATCH] iris: Only initialize batch decoder if necessary This avoids a lot of overhead in context creation if some other `INTEL_DEBUG` flag is set. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10333 Part-of: --- src/gallium/drivers/iris/iris_batch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/iris/iris_batch.c b/src/gallium/drivers/iris/iris_batch.c index d1f75a5981d..bae7f82fe14 100644 --- a/src/gallium/drivers/iris/iris_batch.c +++ b/src/gallium/drivers/iris/iris_batch.c @@ -228,7 +228,7 @@ iris_init_batch(struct iris_context *ice, batch->other_batches[batch->num_other_batches++] = other_batch; } - if (INTEL_DEBUG(DEBUG_ANY)) { + if (INTEL_DEBUG(DEBUG_BATCH | DEBUG_BATCH_STATS)) { const unsigned decode_flags = INTEL_BATCH_DECODE_DEFAULT_FLAGS | (INTEL_DEBUG(DEBUG_COLOR) ? INTEL_BATCH_DECODE_IN_COLOR : 0); @@ -533,7 +533,7 @@ iris_batch_free(const struct iris_context *ice, struct iris_batch *batch) _mesa_hash_table_destroy(batch->bo_aux_modes, NULL); - if (INTEL_DEBUG(DEBUG_ANY)) + if (INTEL_DEBUG(DEBUG_BATCH | DEBUG_BATCH_STATS)) intel_batch_decode_ctx_finish(&batch->decoder); }