iris: Give up on not passing ice to iris_init_batch

We're going to need it to create a uploader in the batch soon.  We still
avoid storing it, to maintain the charade of separation, and make people
think twice about fetching random fields from there and intertwining
things even worse.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3802>
This commit is contained in:
Kenneth Graunke 2020-05-01 10:17:15 -07:00 committed by Marge Bot
parent 4a1ed75b85
commit c94379c770
3 changed files with 13 additions and 20 deletions

View file

@ -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)) {

View file

@ -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);

View file

@ -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]);