diff --git a/src/gallium/drivers/iris/iris_batch.c b/src/gallium/drivers/iris/iris_batch.c index 177ba3a848f..324ae016ae3 100644 --- a/src/gallium/drivers/iris/iris_batch.c +++ b/src/gallium/drivers/iris/iris_batch.c @@ -167,19 +167,17 @@ decode_batch(struct iris_batch *batch) } void -iris_init_batch(struct iris_batch *batch, - struct iris_screen *screen, - struct pipe_debug_callback *dbg, - struct pipe_device_reset_callback *reset, - struct hash_table_u64 *state_sizes, - struct iris_batch *all_batches, +iris_init_batch(struct iris_context *ice, enum iris_batch_name name, int priority) { + struct iris_batch *batch = &ice->batches[name]; + struct iris_screen *screen = (void *) ice->ctx.screen; + batch->screen = screen; - batch->dbg = dbg; - batch->reset = reset; - batch->state_sizes = state_sizes; + batch->dbg = &ice->dbg; + batch->reset = &ice->reset; + batch->state_sizes = ice->state.sizes; batch->name = name; batch->hw_ctx_id = iris_create_hw_context(screen->bufmgr); @@ -205,8 +203,8 @@ iris_init_batch(struct iris_batch *batch, memset(batch->other_batches, 0, sizeof(batch->other_batches)); for (int i = 0, j = 0; i < IRIS_BATCH_COUNT; i++) { - if (&all_batches[i] != batch) - batch->other_batches[j++] = &all_batches[i]; + if (i != name) + batch->other_batches[j++] = &ice->batches[i]; } if (unlikely(INTEL_DEBUG)) { diff --git a/src/gallium/drivers/iris/iris_batch.h b/src/gallium/drivers/iris/iris_batch.h index e285f1d6cfc..0afab81c8b2 100644 --- a/src/gallium/drivers/iris/iris_batch.h +++ b/src/gallium/drivers/iris/iris_batch.h @@ -35,6 +35,8 @@ #include "iris_fence.h" +struct iris_context; + /* The kernel assumes batchbuffers are smaller than 256kB. */ #define MAX_BATCH_SIZE (256 * 1024) @@ -141,12 +143,7 @@ struct iris_batch { uint32_t last_aux_map_state; }; -void iris_init_batch(struct iris_batch *batch, - struct iris_screen *screen, - struct pipe_debug_callback *dbg, - struct pipe_device_reset_callback *reset, - struct hash_table_u64 *state_sizes, - struct iris_batch *all_batches, +void iris_init_batch(struct iris_context *ice, enum iris_batch_name name, int priority); void iris_chain_to_new_batch(struct iris_batch *batch); diff --git a/src/gallium/drivers/iris/iris_context.c b/src/gallium/drivers/iris/iris_context.c index 862105b8426..4d161ac3f41 100644 --- a/src/gallium/drivers/iris/iris_context.c +++ b/src/gallium/drivers/iris/iris_context.c @@ -304,9 +304,7 @@ iris_create_context(struct pipe_screen *pscreen, void *priv, unsigned flags) ice->state.sizes = _mesa_hash_table_u64_create(ice); for (int i = 0; i < IRIS_BATCH_COUNT; i++) { - iris_init_batch(&ice->batches[i], screen, &ice->dbg, - &ice->reset, ice->state.sizes, - ice->batches, (enum iris_batch_name) i, priority); + iris_init_batch(ice, (enum iris_batch_name) i, priority); } screen->vtbl.init_render_context(&ice->batches[IRIS_BATCH_RENDER]);