summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau/nouveau_fence.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/nouveau/nouveau_fence.h')
-rw-r--r--src/gallium/drivers/nouveau/nouveau_fence.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/drivers/nouveau/nouveau_fence.h b/src/gallium/drivers/nouveau/nouveau_fence.h
index 785fc8d2a0a..680c75e99f9 100644
--- a/src/gallium/drivers/nouveau/nouveau_fence.h
+++ b/src/gallium/drivers/nouveau/nouveau_fence.h
@@ -39,12 +39,13 @@ boolean nouveau_fence_signalled(struct nouveau_fence *);
static INLINE void
nouveau_fence_ref(struct nouveau_fence *fence, struct nouveau_fence **ref)
{
+ if (fence)
+ ++fence->ref;
+
if (*ref) {
if (--(*ref)->ref == 0)
nouveau_fence_del(*ref);
}
- if (fence)
- ++fence->ref;
*ref = fence;
}