mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 16:08:04 +02:00
iris: kill iris_new_batch
reset and new are too similar, and this had exactly one caller
This commit is contained in:
parent
b701096ab9
commit
7bfc8f7d7d
1 changed files with 15 additions and 23 deletions
|
|
@ -116,7 +116,9 @@ iris_init_batch(struct iris_batch *batch,
|
|||
batch->screen = screen;
|
||||
batch->dbg = dbg;
|
||||
|
||||
/* ring should be one of I915_EXEC_RENDER, I915_EXEC_BLT, etc. */
|
||||
assert((ring & ~I915_EXEC_RING_MASK) == 0);
|
||||
assert(util_bitcount(ring) == 1);
|
||||
batch->ring = ring;
|
||||
|
||||
init_reloc_list(&batch->cmdbuf.relocs, 256);
|
||||
|
|
@ -427,28 +429,6 @@ iris_batch_emit(struct iris_batch *batch, const void *data, unsigned size)
|
|||
memcpy(batch->cmdbuf.map_next, data, size);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when starting a new batch buffer.
|
||||
*/
|
||||
static void
|
||||
iris_new_batch(struct iris_batch *batch)
|
||||
{
|
||||
/* Unreference any BOs held by the previous batch, and reset counts. */
|
||||
for (int i = 0; i < batch->exec_count; i++) {
|
||||
iris_bo_unreference(batch->exec_bos[i]);
|
||||
batch->exec_bos[i] = NULL;
|
||||
}
|
||||
batch->cmdbuf.relocs.reloc_count = 0;
|
||||
batch->statebuf.relocs.reloc_count = 0;
|
||||
batch->exec_count = 0;
|
||||
batch->aperture_space = 0;
|
||||
|
||||
iris_bo_unreference(batch->statebuf.bo);
|
||||
|
||||
/* Create a new batchbuffer and reset the associated state: */
|
||||
iris_batch_reset_and_clear_render_cache(batch);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called from iris_batch_flush before emitting MI_BATCHBUFFER_END and
|
||||
* sending it off.
|
||||
|
|
@ -609,8 +589,20 @@ _iris_batch_flush_fence(struct iris_batch *batch,
|
|||
iris_bo_wait_rendering(batch->cmdbuf.bo);
|
||||
}
|
||||
|
||||
/* Clean up after the batch we submitted and prepare for a new one. */
|
||||
for (int i = 0; i < batch->exec_count; i++) {
|
||||
iris_bo_unreference(batch->exec_bos[i]);
|
||||
batch->exec_bos[i] = NULL;
|
||||
}
|
||||
batch->cmdbuf.relocs.reloc_count = 0;
|
||||
batch->statebuf.relocs.reloc_count = 0;
|
||||
batch->exec_count = 0;
|
||||
batch->aperture_space = 0;
|
||||
|
||||
iris_bo_unreference(batch->statebuf.bo);
|
||||
|
||||
/* Start a new batch buffer. */
|
||||
iris_new_batch(batch);
|
||||
iris_batch_reset_and_clear_render_cache(batch);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue