From 8dd678208e4dcd90e07dc271d11d73d87465e0fd Mon Sep 17 00:00:00 2001 From: Brian Date: Fri, 11 Jan 2008 16:08:53 -0700 Subject: Cell: basic batch buffer working --- src/mesa/pipe/cell/ppu/cell_flush.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src/mesa/pipe/cell/ppu/cell_flush.c') diff --git a/src/mesa/pipe/cell/ppu/cell_flush.c b/src/mesa/pipe/cell/ppu/cell_flush.c index 977c50da32..33cbe2a085 100644 --- a/src/mesa/pipe/cell/ppu/cell_flush.c +++ b/src/mesa/pipe/cell/ppu/cell_flush.c @@ -38,16 +38,25 @@ cell_flush(struct pipe_context *pipe, unsigned flags) struct cell_context *cell = cell_context(pipe); uint i; - cell_flush_prim_buffer(cell); + if (flags & PIPE_FLUSH_WAIT) { + uint *cmd = (uint *) cell_batch_alloc(cell, sizeof(uint)); + *cmd = CELL_CMD_FINISH; + } + + cell_batch_flush(cell); +#if 0 /* Send CMD_FINISH to all SPUs */ for (i = 0; i < cell->num_spus; i++) { send_mbox_message(cell_global.spe_contexts[i], CELL_CMD_FINISH); } +#endif - /* Wait for ack */ - for (i = 0; i < cell->num_spus; i++) { - uint k = wait_mbox_message(cell_global.spe_contexts[i]); - assert(k == CELL_CMD_FINISH); + if (flags & PIPE_FLUSH_WAIT) { + /* Wait for ack */ + for (i = 0; i < cell->num_spus; i++) { + uint k = wait_mbox_message(cell_global.spe_contexts[i]); + assert(k == CELL_CMD_FINISH); + } } } -- cgit v1.2.3