From 4388817a678431146744a030bc7c0b8c01da9f72 Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Sun, 13 Mar 2011 13:07:54 +0100 Subject: nv50,nvc0: clean up flushes --- src/gallium/drivers/nouveau/nouveau_fence.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/gallium/drivers/nouveau') diff --git a/src/gallium/drivers/nouveau/nouveau_fence.c b/src/gallium/drivers/nouveau/nouveau_fence.c index 18bdb18ad41..d8f59dce9ed 100644 --- a/src/gallium/drivers/nouveau/nouveau_fence.c +++ b/src/gallium/drivers/nouveau/nouveau_fence.c @@ -90,6 +90,9 @@ nouveau_fence_emit(struct nouveau_fence *fence) assert(fence->state == NOUVEAU_FENCE_STATE_AVAILABLE); + /* set this now, so that if fence.emit triggers a flush we don't recurse */ + fence->state = NOUVEAU_FENCE_STATE_EMITTED; + screen->fence.emit(&screen->base, fence->sequence); ++fence->ref; @@ -100,8 +103,6 @@ nouveau_fence_emit(struct nouveau_fence *fence) screen->fence.head = fence; screen->fence.tail = fence; - - fence->state = NOUVEAU_FENCE_STATE_EMITTED; } void @@ -215,6 +216,8 @@ nouveau_fence_wait(struct nouveau_fence *fence) void nouveau_fence_next(struct nouveau_screen *screen) { - nouveau_fence_emit(screen->fence.current); + if (screen->fence.current->state < NOUVEAU_FENCE_STATE_EMITTED) + nouveau_fence_emit(screen->fence.current); + nouveau_fence_new(screen, &screen->fence.current, FALSE); } -- cgit v1.2.3