Cell: fix a recursive flushing bug
authorBrian <brian.paul@tungstengraphics.com>
Sat, 26 Jan 2008 21:14:56 +0000 (14:14 -0700)
committerBrian <brian.paul@tungstengraphics.com>
Sat, 26 Jan 2008 21:15:53 +0000 (14:15 -0700)
src/mesa/pipe/cell/ppu/cell_flush.c
src/mesa/pipe/cell/ppu/cell_flush.h
src/mesa/pipe/cell/ppu/cell_vbuf.c

index d54eeb8524dae20700f3adcc0f6bfab1247fa061..b98bb566b12a7d5a66c3671a18971539444a9a49 100644 (file)
 #include "cell_flush.h"
 #include "cell_spu.h"
 #include "cell_render.h"
+#include "pipe/draw/draw_context.h"
 
 
 void
 cell_flush(struct pipe_context *pipe, unsigned flags)
 {
    struct cell_context *cell = cell_context(pipe);
+
+   draw_flush( cell->draw );
+   cell_flush_int(pipe, flags);
+}
+
+
+/** internal flush */
+void
+cell_flush_int(struct pipe_context *pipe, unsigned flags)
+{
+   static boolean flushing = FALSE;  /* recursion catcher */
+   struct cell_context *cell = cell_context(pipe);
    uint i;
 
+   ASSERT(!flushing);
+   flushing = TRUE;
+
    if (flags & PIPE_FLUSH_WAIT) {
       uint *cmd = (uint *) cell_batch_alloc(cell, sizeof(uint));
       *cmd = CELL_CMD_FINISH;
@@ -60,4 +76,6 @@ cell_flush(struct pipe_context *pipe, unsigned flags)
          assert(k == CELL_CMD_FINISH);
       }
    }
+
+   flushing = FALSE;
 }
index cf1a104f977526a7d0bcda97e9ffbe0e97c648a4..eda351b1cbc82ea0bf0a7738748b3cce87d561cb 100644 (file)
@@ -32,4 +32,7 @@
 extern void
 cell_flush(struct pipe_context *pipe, unsigned flags);
 
+extern void
+cell_flush_int(struct pipe_context *pipe, unsigned flags);
+
 #endif
index 711d03b49fcdf7ab8a682fe2868043858210230c..00ff990eab7e18dbf060743c5f176ea41f0e5670 100644 (file)
@@ -166,7 +166,7 @@ cell_vbuf_draw(struct vbuf_render *vbr,
 
 #if 01
    /* XXX this is temporary */
-   cell_flush(&cell->pipe, PIPE_FLUSH_WAIT);
+   cell_flush_int(&cell->pipe, PIPE_FLUSH_WAIT);
 #endif
 }