summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/cell/ppu/cell_flush.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2008-03-26 09:36:40 +0000
committerMichel Dänzer <michel@tungstengraphics.com>2008-03-26 09:36:40 +0000
commit4abe1eb980ed76d2b2d3383eaab520d0aa2ae6f4 (patch)
tree82ef00b79a812d6380b023e1da1a24c34437d66e /src/gallium/drivers/cell/ppu/cell_flush.c
parente55dccd0bfc41dbcf306f864c01758f8e28fc660 (diff)
gallium: Change pipe->flush() interface to optionally return a fence.
The cell driver still uses an internal CELL_FLUSH_WAIT flag, in the long run proper fencing should be implemented for it.
Diffstat (limited to 'src/gallium/drivers/cell/ppu/cell_flush.c')
-rw-r--r--src/gallium/drivers/cell/ppu/cell_flush.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/gallium/drivers/cell/ppu/cell_flush.c b/src/gallium/drivers/cell/ppu/cell_flush.c
index 66a5627d84..3aaf3de668 100644
--- a/src/gallium/drivers/cell/ppu/cell_flush.c
+++ b/src/gallium/drivers/cell/ppu/cell_flush.c
@@ -35,12 +35,19 @@
void
-cell_flush(struct pipe_context *pipe, unsigned flags)
+cell_flush(struct pipe_context *pipe, unsigned flags,
+ struct pipe_fence_handle **fence)
{
struct cell_context *cell = cell_context(pipe);
+ if (fence) {
+ *fence = NULL;
+ /* XXX: Implement real fencing */
+ flags |= CELL_FLUSH_WAIT;
+ }
+
if (flags & PIPE_FLUSH_SWAPBUFFERS)
- flags |= PIPE_FLUSH_WAIT;
+ flags |= CELL_FLUSH_WAIT;
draw_flush( cell->draw );
cell_flush_int(pipe, flags);
@@ -58,7 +65,7 @@ cell_flush_int(struct pipe_context *pipe, unsigned flags)
ASSERT(!flushing);
flushing = TRUE;
- if (flags & PIPE_FLUSH_WAIT) {
+ if (flags & CELL_FLUSH_WAIT) {
uint64_t *cmd = (uint64_t *) cell_batch_alloc(cell, sizeof(uint64_t));
*cmd = CELL_CMD_FINISH;
}
@@ -72,7 +79,7 @@ cell_flush_int(struct pipe_context *pipe, unsigned flags)
}
#endif
- if (flags & PIPE_FLUSH_WAIT) {
+ if (flags & CELL_FLUSH_WAIT) {
/* Wait for ack */
for (i = 0; i < cell->num_spus; i++) {
uint k = wait_mbox_message(cell_global.spe_contexts[i]);