}
-/** wait for all SPUs to finish working */
-/** XXX temporary */
-void
-finish_all(uint num_spus)
-{
- uint i;
-
- for (i = 0; i < num_spus; i++) {
- send_mbox_message(cell_global.spe_contexts[i], CELL_CMD_FINISH);
- }
- for (i = 0; i < num_spus; i++) {
- /* wait for mbox message */
- unsigned k;
-
- while (spe_out_mbox_read(cell_global.spe_contexts[i], &k, 1) < 1)
- ;
-
- assert(k == CELL_CMD_FINISH);
- }
-}
-
-
-/**
- ** Send test commands (XXX temporary)
- **/
-void
-test_spus(struct cell_context *cell)
-{
- uint i;
- struct pipe_surface *csurf = cell->framebuffer.cbufs[0];
- struct pipe_surface *zsurf = cell->framebuffer.zsbuf;
-
- printf("PPU: sleep(2)\n\n\n");
- sleep(2);
-
- for (i = 0; i < cell->num_spus; i++) {
- cell_global.command[i].fb.color_start = cell->cbuf_map[0];
- cell_global.command[i].fb.depth_start = cell->zsbuf_map;
- cell_global.command[i].fb.width = csurf->width;
- cell_global.command[i].fb.height = csurf->height;
- cell_global.command[i].fb.color_format = PIPE_FORMAT_A8R8G8B8_UNORM;
- cell_global.command[i].fb.depth_format = PIPE_FORMAT_Z32_UNORM;
- send_mbox_message(cell_global.spe_contexts[i], CELL_CMD_FRAMEBUFFER);
- }
-
- for (i = 0; i < cell->num_spus; i++) {
- cell_global.command[i].clear.value = 0xff880044; /* XXX */
- cell_global.command[i].clear.surface = 0;
- send_mbox_message(cell_global.spe_contexts[i], CELL_CMD_CLEAR_SURFACE);
- }
-
- finish_all(cell->num_spus);
-
- {
- uint *b = (uint*) cell->cbuf_map[0];
- printf("PPU: Clear results: 0x%x 0x%x 0x%x 0x%x\n",
- b[0], b[1000], b[2000], b[3000]);
- }
-
- for (i = 0; i < cell->num_spus; i++) {
- send_mbox_message(cell_global.spe_contexts[i], CELL_CMD_EXIT);
- }
-}
-
-
/**
* Tell all the SPUs to stop/exit.
*/