From 97fdadee6a79f9406a55c235ee46104814321152 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Thu, 5 Feb 2009 23:03:29 +1000 Subject: nouveau: fix some issues where buffer objects never get freed --- libdrm/nouveau/nouveau_bo.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'libdrm/nouveau/nouveau_bo.c') diff --git a/libdrm/nouveau/nouveau_bo.c b/libdrm/nouveau/nouveau_bo.c index 0ab426dc..6b9877fc 100644 --- a/libdrm/nouveau/nouveau_bo.c +++ b/libdrm/nouveau/nouveau_bo.c @@ -435,10 +435,18 @@ nouveau_bo_del(struct nouveau_bo **bo) } nouveau_bo_ufree(nvbo); - if (!nouveau_device(nvbo->base.device)->mm_enabled && nvbo->fence) - nouveau_fence_signal_cb(nvbo->fence, nouveau_bo_del_cb, nvbo); - else + + if (!nouveau_device(nvbo->base.device)->mm_enabled && nvbo->fence) { + nouveau_fence_flush(nvbo->fence->channel); + if (nouveau_fence(nvbo->fence)->signalled) { + nouveau_bo_del_cb(nvbo); + } else { + nouveau_fence_signal_cb(nvbo->fence, + nouveau_bo_del_cb, nvbo); + } + } else { nouveau_bo_del_cb(nvbo); + } } int @@ -786,7 +794,6 @@ nouveau_bo_busy(struct nouveau_bo *bo, uint32_t access) return 1; } -#include struct drm_nouveau_gem_pushbuf_bo * nouveau_bo_emit_buffer(struct nouveau_channel *chan, struct nouveau_bo *bo) { -- cgit v1.2.3