iris: Better handle decoder base addresses

It can be useful to call the decoder on a single batch.  But, that batch
may not contain STATE_BASE_ADDRESS, at which point the decoder will have
no idea how to find any buffers.  We can initialize the two static bases
at the beginning of time, so it has them even if it never sees SBA.

Surface base address changes dynamically, possibly in the middle of a
batch.  So we update it at the start of each batch, making it always
start at the value we inherited from the previous one.  SBA commands
inside the batch can update it to a proper value.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
This commit is contained in:
Kenneth Graunke
2019-07-12 13:52:35 -07:00
parent ed12be1b8f
commit 5e76c99923
+3
View File
@@ -238,6 +238,8 @@ iris_init_batch(struct iris_batch *batch,
gen_batch_decode_ctx_init(&batch->decoder, &screen->devinfo,
stderr, decode_flags, NULL,
decode_get_bo, decode_get_state_size, batch);
batch->decoder.dynamic_base = IRIS_MEMZONE_DYNAMIC_START;
batch->decoder.instruction_base = IRIS_MEMZONE_SHADER_START;
batch->decoder.max_vbo_decoded_lines = 32;
}
@@ -374,6 +376,7 @@ iris_batch_reset(struct iris_batch *batch)
iris_bo_unreference(batch->bo);
batch->primary_batch_size = 0;
batch->contains_draw = false;
batch->decoder.surface_base = batch->last_surface_base_address;
create_batch(batch);
assert(batch->bo->index == 0);