From 69d7782b155b72707d95a2f6b0c0776afbb888e3 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 2 Oct 2019 15:09:33 -0400 Subject: intel/decoder: Make get_state_size take a full 64-bit address and a base i965 wants to use an offset from a base because everything is in a single buffer whose address may be relocated, and all base addresses are set to the start of that buffer. iris wants to use a full 64-bit address, because state lives in separate buffers which may be in the shader, surface, and dynamic memory zones, where addresses grow downward from the top of a 4GB zone, So it's very possible for a 32-bit offset to exist relative to multiple bases, leading to the wrong state size. --- src/mesa/drivers/dri/i965/intel_batchbuffer.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/mesa/drivers') diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.c b/src/mesa/drivers/dri/i965/intel_batchbuffer.c index af076f65f0b..d5676e9cb9f 100644 --- a/src/mesa/drivers/dri/i965/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.c @@ -104,12 +104,13 @@ decode_get_bo(void *v_brw, bool ppgtt, uint64_t address) } static unsigned -decode_get_state_size(void *v_brw, uint32_t offset_from_dsba) +decode_get_state_size(void *v_brw, uint64_t address, uint64_t base_address) { struct brw_context *brw = v_brw; struct intel_batchbuffer *batch = &brw->batch; - unsigned size = (uintptr_t) _mesa_hash_table_u64_search( - batch->state_batch_sizes, offset_from_dsba); + unsigned size = (uintptr_t) + _mesa_hash_table_u64_search(batch->state_batch_sizes, + address - base_address); return size; } -- cgit v1.2.3