/* wtf, someone is waiting on a fence in flush_notify handler? */
assert(fence->state != NOUVEAU_FENCE_STATE_EMITTING);
- if (fence->state < NOUVEAU_FENCE_STATE_EMITTED)
+ if (fence->state < NOUVEAU_FENCE_STATE_EMITTED) {
+ PUSH_SPACE(screen->pushbuf, 8);
nouveau_fence_emit(fence);
+ }
if (fence->state < NOUVEAU_FENCE_STATE_FLUSHED)
if (nouveau_pushbuf_kick(screen->pushbuf, screen->pushbuf->channel))
void
nouveau_fence_next(struct nouveau_screen *screen)
{
- if (screen->fence.current->state < NOUVEAU_FENCE_STATE_EMITTING)
- nouveau_fence_emit(screen->fence.current);
+ if (screen->fence.current->state < NOUVEAU_FENCE_STATE_EMITTING) {
+ if (screen->fence.current->ref > 1)
+ nouveau_fence_emit(screen->fence.current);
+ else
+ return;
+ }
nouveau_fence_ref(NULL, &screen->fence.current);