From: Kenneth Graunke Date: Fri, 12 Jul 2019 20:52:35 +0000 (-0700) Subject: iris: Better handle decoder base addresses X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5e76c9992317f20f89fafe3aab03026ca550766e;p=mesa.git 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 --- 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);