summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2019-07-12 13:52:35 -0700
committerKenneth Graunke <[email protected]>2019-07-15 11:49:19 -0700
commit5e76c9992317f20f89fafe3aab03026ca550766e (patch)
treeecdf3a9a212ebf2db1f1aff77dca985ae1bcb8ec /src/gallium
parented12be1b8fb2fddafdbc9abb4614697a660d3d6c (diff)
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 <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/iris/iris_batch.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gallium/drivers/iris/iris_batch.c b/src/gallium/drivers/iris/iris_batch.c
index 5508256e5af..38405187772 100644
--- a/src/gallium/drivers/iris/iris_batch.c
+++ b/src/gallium/drivers/iris/iris_batch.c
@@ -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);