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>
This commit is contained in:
Matt Turner 2023-12-21 12:33:34 -05:00 committed by Marge Bot
parent 68c53ec2c2
commit 184fc71aa1

View file

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