diff options
author | Jason Ekstrand <[email protected]> | 2018-07-09 15:58:33 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2018-07-09 16:40:54 -0700 |
commit | 5009e73bb1e0d38fc2accedcf59fae6f6ccdf95a (patch) | |
tree | 31ab8acc97134e5c30f8886a0945de68b81dae9f /src | |
parent | 45e25adfe8913ae554205e9ae8766fae4afcdc35 (diff) |
intel/batch_decoder: Recurse for all 2nd level batches
Our attempt to restart the loop with the second level batch worked at
one point but got broken at some point. It was too fragile anyway and
we're not likely to have enough secondaries to actually overflow the
stack so we may as well recurse in both cases.
Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/intel/common/gen_batch_decoder.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/intel/common/gen_batch_decoder.c b/src/intel/common/gen_batch_decoder.c index fc0ff95a476..fe7536da9ec 100644 --- a/src/intel/common/gen_batch_decoder.c +++ b/src/intel/common/gen_batch_decoder.c @@ -856,33 +856,24 @@ gen_print_batch(struct gen_batch_decode_ctx *ctx, if (next_batch.map == NULL) { fprintf(ctx->fp, "Secondary batch at 0x%08"PRIx64" unavailable\n", next_batch.addr); + } else { + gen_print_batch(ctx, next_batch.map, next_batch.size, + next_batch.addr); } - if (second_level) { /* MI_BATCH_BUFFER_START with "2nd Level Batch Buffer" set acts * like a subroutine call. Commands that come afterwards get * processed once the 2nd level batch buffer returns with * MI_BATCH_BUFFER_END. */ - if (next_batch.map) { - gen_print_batch(ctx, next_batch.map, next_batch.size, - next_batch.addr); - } + continue; } else { /* MI_BATCH_BUFFER_START with "2nd Level Batch Buffer" unset acts * like a goto. Nothing after it will ever get processed. In * order to prevent the recursion from growing, we just reset the * loop and continue; */ - if (next_batch.map) { - p = next_batch.map; - end = next_batch.map + next_batch.size; - length = 0; - continue; - } else { - /* Nothing we can do */ - break; - } + break; } } else if (strcmp(inst_name, "MI_BATCH_BUFFER_END") == 0) { break; |