Module: Mesa
Branch: main
Commit: 184fc71aa171ae920eb8bd8309704f535fa5cd84
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=184fc71aa171ae920eb8bd8309704f535fa5cd84

Author: Matt Turner <[email protected]>
Date:   Thu Dec 21 12:33:34 2023 -0500

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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26790>

---

 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);
 }
 

Reply via email to