summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/cell/ppu
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-12-10 17:32:08 -0700
committerBrian <brian.paul@tungstengraphics.com>2007-12-10 17:32:43 -0700
commit7d1894c6558c5cc7f503142cda11b8a12ea24e65 (patch)
tree0e6bdb0417a0f444f527d2559cc809cab4228703 /src/mesa/pipe/cell/ppu
parentaef25b1994cf93aaf64baf24a2ec4e29ee086a08 (diff)
Cell: first triangle.
This is a feeble first step, but it works. The cell_clear_surface() function has been hijacked to set up a "draw triangle" command and send it to all the SPUs. The Gallium softpipe triangle code was copied to the SPU module and modified. Only the progs/trivial/clear.c program runs.
Diffstat (limited to 'src/mesa/pipe/cell/ppu')
-rw-r--r--src/mesa/pipe/cell/ppu/cell_spu.c14
-rw-r--r--src/mesa/pipe/cell/ppu/cell_surface.c29
2 files changed, 21 insertions, 22 deletions
diff --git a/src/mesa/pipe/cell/ppu/cell_spu.c b/src/mesa/pipe/cell/ppu/cell_spu.c
index ed56250ff1..4f111cd219 100644
--- a/src/mesa/pipe/cell/ppu/cell_spu.c
+++ b/src/mesa/pipe/cell/ppu/cell_spu.c
@@ -171,20 +171,6 @@ test_spus(struct cell_context *cell)
}
for (i = 0; i < cell->num_spus; i++) {
- send_mbox_message(control_ps_area[i], CELL_CMD_INVERT_TILES);
- }
-
- finish_all(cell->num_spus);
-
- {
- uint *b = (uint*) surf->map;
- printf("PPU: Inverted 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(control_ps_area[i], CELL_CMD_EXIT);
}
}
diff --git a/src/mesa/pipe/cell/ppu/cell_surface.c b/src/mesa/pipe/cell/ppu/cell_surface.c
index 1692960244..66e4b5108b 100644
--- a/src/mesa/pipe/cell/ppu/cell_surface.c
+++ b/src/mesa/pipe/cell/ppu/cell_surface.c
@@ -70,14 +70,6 @@ cell_clear_surface(struct pipe_context *pipe, struct pipe_surface *ps,
struct cell_context *cell = cell_context(pipe);
uint i;
- printf("%s 0x%08x\n", __FUNCTION__, clearValue);
-
- {
- char s[100];
- pf_sprint_name(s, ps->format);
- printf("format = %s\n", s);
- }
-
if (!ps->map)
pipe_surface_map(ps);
@@ -90,9 +82,30 @@ cell_clear_surface(struct pipe_context *pipe, struct pipe_surface *ps,
}
for (i = 0; i < cell->num_spus; i++) {
+ /* XXX clear color varies per-SPU for debugging */
command[i].clear.value = clearValue | (i << 21);
send_mbox_message(control_ps_area[i], CELL_CMD_CLEAR_TILES);
}
+
+#if 1
+ /* XXX Draw a test triangle over the cleared surface */
+ for (i = 0; i < cell->num_spus; i++) {
+ /* Same triangle data for all SPUs, of course: */
+ command[i].tri.x0 = 20.0;
+ command[i].tri.y0 = ps->height - 20;
+
+ command[i].tri.x1 = ps->width - 20.0;
+ command[i].tri.y1 = ps->height - 20;
+
+ command[i].tri.x2 = ps->width / 2;
+ command[i].tri.y2 = 20.0;
+
+ /* XXX color varies per SPU */
+ command[i].tri.color = 0xffff00 | ((i*40)<<24); /* yellow */
+
+ send_mbox_message(control_ps_area[i], CELL_CMD_TRIANGLE);
+ }
+#endif
}