diff options
author | Jason Ekstrand <jason.ekstrand@intel.com> | 2021-02-24 00:28:17 -0600 |
---|---|---|
committer | Jason Ekstrand <jason.ekstrand@intel.com> | 2021-03-08 10:47:19 -0600 |
commit | c23f7f1154c9a7417512f84733008fee9842e478 (patch) | |
tree | 1aedd90af3979fa382a9688791a26472f29571ad | |
parent | 672192522026433e1de499fdcaa4df27e15dce2f (diff) |
intel/batch_decoder: Don't follow predicated MI_BATCH_BUFFER_START
The stuff after these may be executed so we want to decode it too.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9445>
-rw-r--r-- | src/intel/common/gen_batch_decoder.c | 49 |
1 files changed, 27 insertions, 22 deletions
diff --git a/src/intel/common/gen_batch_decoder.c b/src/intel/common/gen_batch_decoder.c index 8b78aa905a4..7719b7b61da 100644 --- a/src/intel/common/gen_batch_decoder.c +++ b/src/intel/common/gen_batch_decoder.c @@ -1151,6 +1151,7 @@ gen_print_batch(struct gen_batch_decode_ctx *ctx, uint64_t next_batch_addr = 0; bool ppgtt = false; bool second_level = false; + bool predicate = false; struct gen_field_iterator iter; gen_field_iterator_init(&iter, inst, p, 0, false); while (gen_field_iterator_next(&iter)) { @@ -1160,32 +1161,36 @@ gen_print_batch(struct gen_batch_decode_ctx *ctx, second_level = iter.raw_value; } else if (strcmp(iter.name, "Address Space Indicator") == 0) { ppgtt = iter.raw_value; + } else if (strcmp(iter.name, "Predication Enable") == 0) { + predicate = iter.raw_value; } } - struct gen_batch_decode_bo next_batch = ctx_get_bo(ctx, ppgtt, next_batch_addr); + if (!predicate) { + struct gen_batch_decode_bo next_batch = ctx_get_bo(ctx, ppgtt, next_batch_addr); - 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, false); - } - 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. - */ - continue; - } else if (!from_ring) { - /* 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; - */ - break; + 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, false); + } + 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. + */ + continue; + } else if (!from_ring) { + /* 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; + */ + break; + } } } else if (strcmp(inst_name, "MI_BATCH_BUFFER_END") == 0) { break; |