diff options
author | Brian <[email protected]> | 2008-01-19 12:04:06 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2008-01-19 12:04:06 -0700 |
commit | a1f4a5e802ad62c88fca6834b9de1c83672230a6 (patch) | |
tree | 79f89f370a4d2b8197f313fe4ea7d081e386a916 /src/mesa/pipe/cell/ppu/cell_context.c | |
parent | 06b019d16bc20d772a8aed2a68d1c5d37a402a81 (diff) |
Cell: improve "finished copying batch buffer" signalling.
When the SPU is done copying a batch buffer to local store, use an mfc_put()
to write a "done" message back to the buffer status array in main memory.
We were previously using a mailbox message for synchronization.
Diffstat (limited to 'src/mesa/pipe/cell/ppu/cell_context.c')
-rw-r--r-- | src/mesa/pipe/cell/ppu/cell_context.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/mesa/pipe/cell/ppu/cell_context.c b/src/mesa/pipe/cell/ppu/cell_context.c index 6ba3b0d4138..897c187d654 100644 --- a/src/mesa/pipe/cell/ppu/cell_context.c +++ b/src/mesa/pipe/cell/ppu/cell_context.c @@ -160,7 +160,7 @@ struct pipe_context * cell_create_context(struct pipe_winsys *winsys, struct cell_winsys *cws) { struct cell_context *cell; - uint i; + uint spu, buf; /* some fields need to be 16-byte aligned, so align the whole object */ cell = (struct cell_context*) align_malloc(sizeof(struct cell_context), 16); @@ -248,13 +248,30 @@ cell_create_context(struct pipe_winsys *winsys, struct cell_winsys *cws) cell_start_spus(cell); - for (i = 0; i < CELL_NUM_BATCH_BUFFERS; i++) { - cell->batch_buffer_size[i] = 0; + for (buf = 0; buf < CELL_NUM_BATCH_BUFFERS; buf++) { + cell->batch_buffer_size[buf] = 0; + + /* init batch buffer status values, + * mark 0th buffer as used, rest as free. + */ + for (spu = 0; spu < cell->num_spus; spu++) { + if (buf == 0) + cell->buffer_status[spu][buf][0] = CELL_BUFFER_STATUS_USED; + else + cell->buffer_status[spu][buf][0] = CELL_BUFFER_STATUS_FREE; + } } + #if 0 test_spus(cell); #endif return &cell->pipe; } + + +#if 0 +/** [4] to ensure 16-byte alignment for each status word */ +uint buffer_status[CELL_MAX_SPUS][CELL_NUM_BATCH_BUFFERS][4] ALIGN16_ATTRIB; +#endif |