diff options
author | Scott D Phillips <[email protected]> | 2018-04-09 12:46:51 -0700 |
---|---|---|
committer | Lionel Landwerlin <[email protected]> | 2018-07-05 11:57:45 +0100 |
commit | c262ec19d0705d93903b28ed8f79cb85abeb5a1a (patch) | |
tree | 597b9c7bbf433d1fc0b0e5eb297bfe3bf464d12f | |
parent | 3ebee627cb8744d6c9087255ddb0341772ca1483 (diff) |
intel/batch-decoder: handle non-contiguous binding table / surface state
Reviewed-by: Lionel Landwerlin <[email protected]>
-rw-r--r-- | src/intel/common/gen_batch_decoder.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/intel/common/gen_batch_decoder.c b/src/intel/common/gen_batch_decoder.c index 3852f32de36..2b6978da92d 100644 --- a/src/intel/common/gen_batch_decoder.c +++ b/src/intel/common/gen_batch_decoder.c @@ -236,20 +236,30 @@ dump_binding_table(struct gen_batch_decode_ctx *ctx, uint32_t offset, int count) return; } + struct gen_batch_decode_bo bo = ctx->surface_base; const uint32_t *pointers = ctx->surface_base.map + offset; for (int i = 0; i < count; i++) { if (pointers[i] == 0) continue; - if (pointers[i] % 32 != 0 || - (pointers[i] + strct->dw_length * 4) >= ctx->surface_base.size) { + if (pointers[i] % 32 != 0) { + fprintf(ctx->fp, "pointer %u: %08x <not valid>\n", i, pointers[i]); + continue; + } + + uint64_t addr = ctx->surface_base.addr + pointers[i]; + uint32_t size = strct->dw_length * 4; + + if (addr < bo.addr || addr + size >= bo.addr + bo.size) + bo = ctx->get_bo(ctx->user_data, addr); + + if (addr < bo.addr || addr + size >= bo.addr + bo.size) { fprintf(ctx->fp, "pointer %u: %08x <not valid>\n", i, pointers[i]); continue; } fprintf(ctx->fp, "pointer %u: %08x\n", i, pointers[i]); - ctx_print_group(ctx, strct, ctx->surface_base.addr + pointers[i], - ctx->surface_base.map + pointers[i]); + ctx_print_group(ctx, strct, addr, bo.map + (addr - bo.addr)); } } |