diff options
author | Sagar Ghuge <sagar.ghuge@intel.com> | 2023-03-30 10:18:21 -0700 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2023-03-31 01:01:53 +0000 |
commit | a064e8ff292230d78dc197356643fdb214eed0cf (patch) | |
tree | 9c7bf9f5998b9d3b0ceb9e5959c36f71e4bc7967 /src | |
parent | 4d2c8bf85991a12e1b1ef5838b17c2bf60a142b7 (diff) |
Let's bump the binding table value guess to 32 instead of 8 and also stop
decoding the binding table entries as soon as we hit the zero
initialized value in the map.
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22221>
Diffstat (limited to 'src')
-rw-r--r-- | src/intel/common/intel_batch_decoder.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/intel/common/intel_batch_decoder.c b/src/intel/common/intel_batch_decoder.c index 30ce06eea8f..8a2b67c577b 100644 --- a/src/intel/common/intel_batch_decoder.c +++ b/src/intel/common/intel_batch_decoder.c @@ -314,7 +314,7 @@ dump_binding_table(struct intel_batch_decode_ctx *ctx, if (count < 0) { count = update_count(ctx, bt_pool_base + offset, - bt_pool_base, 1, 8); + bt_pool_base, 1, 32); } if (offset % btp_alignment != 0 || offset >= (1u << btp_pointer_bits)) { @@ -332,8 +332,9 @@ dump_binding_table(struct intel_batch_decode_ctx *ctx, const uint32_t *pointers = bind_bo.map; for (int i = 0; i < count; i++) { - if (pointers[i] == 0) - continue; + if (((uintptr_t)&pointers[i] >= ((uintptr_t)bind_bo.map + bind_bo.size)) || + pointers[i] == 0) + break; uint64_t addr = ctx->surface_base + pointers[i]; struct intel_batch_decode_bo bo = ctx_get_bo(ctx, true, addr); |