freedreno: don't overflow cmdstream buffer so much
authorRob Clark <robclark@freedesktop.org>
Mon, 8 Sep 2014 15:18:01 +0000 (11:18 -0400)
committerRob Clark <robclark@freedesktop.org>
Tue, 9 Sep 2014 23:42:18 +0000 (19:42 -0400)
commit4f338c9bbff090d606afdc22373cc7869b0d0c89
tree2e33a0c7940a9671ad98d6b6cea55ce00621fefa
parentfd4884e9291cd941c31e9ed7858a42bec2f1eca8
freedreno: don't overflow cmdstream buffer so much

We currently aren't too clever about dealing with running out of
cmdstream buffer space.  Since we use a single buffer for both drawing
and tiling commands, we need to ensure there is enough space at the tail
of the cmdstream buffer to fit the tiling commands.

Until we get more clever, the easy solution is a threshold to trigger
flushing rendering even if the application does not trigger flush (swap,
changing render target, etc).  This way we at least don't crash for apps
that do several thousand draw calls (like some piglit tests do).

Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/freedreno_draw.c