From: Brian Date: Sun, 27 Jan 2008 01:27:37 +0000 (-0700) Subject: Cell: added cell_batch_free_space() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8dc597290813f58e2f2b7ddcb4ad762ea379c1f7;p=mesa.git Cell: added cell_batch_free_space() --- diff --git a/src/mesa/pipe/cell/ppu/cell_batch.c b/src/mesa/pipe/cell/ppu/cell_batch.c index 5a25f1b2668..c894ef86089 100644 --- a/src/mesa/pipe/cell/ppu/cell_batch.c +++ b/src/mesa/pipe/cell/ppu/cell_batch.c @@ -96,6 +96,15 @@ cell_batch_flush(struct cell_context *cell) } +uint +cell_batch_free_space(const struct cell_context *cell) +{ + uint free = CELL_BATCH_BUFFER_SIZE + - cell->batch_buffer_size[cell->cur_batch]; + return free; +} + + /** * \param cmd command to append * \param length command size in bytes @@ -129,6 +138,8 @@ cell_batch_alloc(struct cell_context *cell, uint bytes) void *pos; uint size; + ASSERT(bytes % 4 == 0); + assert(cell->cur_batch >= 0); size = cell->batch_buffer_size[cell->cur_batch]; diff --git a/src/mesa/pipe/cell/ppu/cell_batch.h b/src/mesa/pipe/cell/ppu/cell_batch.h index 47e3287626b..c4ba7feb3da 100644 --- a/src/mesa/pipe/cell/ppu/cell_batch.h +++ b/src/mesa/pipe/cell/ppu/cell_batch.h @@ -38,6 +38,9 @@ struct cell_context; extern void cell_batch_flush(struct cell_context *cell); +extern uint +cell_batch_free_space(const struct cell_context *cell); + extern void cell_batch_append(struct cell_context *cell, const void *cmd, uint length);