summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/cell/ppu/cell_batch.c
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2008-01-14 16:39:26 -0700
committerBrian <brian.paul@tungstengraphics.com>2008-01-14 16:39:26 -0700
commitf20cb1d81b120c8de9b00e2fb523e2367b25e875 (patch)
tree9840a6e39c82fa066a2e021ca6f1d8c14fd794be /src/mesa/pipe/cell/ppu/cell_batch.c
parentc28b112ce37022aa6e00ac4557ad6fe5a57ae578 (diff)
Cell: after sending a batch, wait for a DMA completion signal.
This fixes sporadic rendering glitches. Using a mailbox msg for now, until spe_mfcio_tag_status_read() or similar is found to work.
Diffstat (limited to 'src/mesa/pipe/cell/ppu/cell_batch.c')
-rw-r--r--src/mesa/pipe/cell/ppu/cell_batch.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/mesa/pipe/cell/ppu/cell_batch.c b/src/mesa/pipe/cell/ppu/cell_batch.c
index 45d49d0465..45f62ac3ad 100644
--- a/src/mesa/pipe/cell/ppu/cell_batch.c
+++ b/src/mesa/pipe/cell/ppu/cell_batch.c
@@ -43,16 +43,27 @@ cell_batch_flush(struct cell_context *cell)
assert(batch < CELL_NUM_BATCH_BUFFERS);
- /*printf("cell_batch_dispatch: buf %u, size %u\n", batch, size);*/
-
+ /*
+ printf("cell_batch_dispatch: buf %u at %p, size %u\n",
+ batch, &cell->batch_buffer[batch][0], size);
+ */
+
cmd_word = CELL_CMD_BATCH | (batch << 8) | (size << 16);
for (i = 0; i < cell->num_spus; i++) {
send_mbox_message(cell_global.spe_contexts[i], cmd_word);
}
- /* XXX wait on DMA xfer of prev buffer to complete */
+ /* XXX wait for the DMX xfer to finish.
+ * Using mailboxes here is temporary.
+ * Ideally, we want to use a PPE-side DMA status check function...
+ */
+ for (i = 0; i < cell->num_spus; i++) {
+ uint k = wait_mbox_message(cell_global.spe_contexts[i]);
+ assert(k == CELL_BATCH_FINISHED);
+ }
+ /* next buffer */
cell->cur_batch = (batch + 1) % CELL_NUM_BATCH_BUFFERS;
cell->batch_buffer_size[cell->cur_batch] = 0; /* empty */