From 856db7dee69083733a1d6e02a33bec4189387f60 Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 26 Jan 2008 14:14:56 -0700 Subject: Cell: fix a recursive flushing bug --- src/mesa/pipe/cell/ppu/cell_flush.c | 18 ++++++++++++++++++ src/mesa/pipe/cell/ppu/cell_flush.h | 3 +++ src/mesa/pipe/cell/ppu/cell_vbuf.c | 2 +- 3 files changed, 22 insertions(+), 1 deletion(-) (limited to 'src/mesa/pipe/cell/ppu') diff --git a/src/mesa/pipe/cell/ppu/cell_flush.c b/src/mesa/pipe/cell/ppu/cell_flush.c index d54eeb8524..b98bb566b1 100644 --- a/src/mesa/pipe/cell/ppu/cell_flush.c +++ b/src/mesa/pipe/cell/ppu/cell_flush.c @@ -31,14 +31,30 @@ #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; } diff --git a/src/mesa/pipe/cell/ppu/cell_flush.h b/src/mesa/pipe/cell/ppu/cell_flush.h index cf1a104f97..eda351b1cb 100644 --- a/src/mesa/pipe/cell/ppu/cell_flush.h +++ b/src/mesa/pipe/cell/ppu/cell_flush.h @@ -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 diff --git a/src/mesa/pipe/cell/ppu/cell_vbuf.c b/src/mesa/pipe/cell/ppu/cell_vbuf.c index 711d03b49f..00ff990eab 100644 --- a/src/mesa/pipe/cell/ppu/cell_vbuf.c +++ b/src/mesa/pipe/cell/ppu/cell_vbuf.c @@ -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 } -- cgit v1.2.3