diff options
Diffstat (limited to 'src/gallium/drivers/nouveau/nv50')
-rw-r--r-- | src/gallium/drivers/nouveau/nv50/nv50_screen.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_screen.c b/src/gallium/drivers/nouveau/nv50/nv50_screen.c index ab0d63ea5f3..e8c7fe3cc24 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_screen.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_screen.c @@ -294,8 +294,15 @@ nv50_screen_destroy(struct pipe_screen *pscreen) return; if (screen->base.fence.current) { - nouveau_fence_wait(screen->base.fence.current); - nouveau_fence_ref (NULL, &screen->base.fence.current); + struct nouveau_fence *current = NULL; + + /* nouveau_fence_wait will create a new current fence, so wait on the + * _current_ one, and remove both. + */ + nouveau_fence_ref(screen->base.fence.current, ¤t); + nouveau_fence_wait(current); + nouveau_fence_ref(NULL, ¤t); + nouveau_fence_ref(NULL, &screen->base.fence.current); } if (screen->base.pushbuf) screen->base.pushbuf->user_priv = NULL; |