diff options
author | Ilia Mirkin <[email protected]> | 2015-09-28 15:18:08 -0400 |
---|---|---|
committer | Ilia Mirkin <[email protected]> | 2015-09-28 17:28:54 -0400 |
commit | 1d8cba9b51b7a6e7dbf3f0d3f53b5c232fd0b5b2 (patch) | |
tree | 12d44ef37d86c115d1ceedb44052c405d5a74f3d /src/gallium | |
parent | 3a6b9a7830c3df14ffcfbbf57c82ea08bd59ef04 (diff) |
nouveau: wait to unref the transfer's bo until it's no longer used
The bo will often come from a slab in which case it doesn't matter. But
for larger allocations this will be in its own bo, and we have to make
sure to wait until it's no longer used in order for it to be freed.
Signed-off-by: Ilia Mirkin <[email protected]>
Cc: [email protected]
Tested-by: Marcin Ĺšlusarz <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/nouveau/nouveau_buffer.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/drivers/nouveau/nouveau_buffer.c b/src/gallium/drivers/nouveau/nouveau_buffer.c index 310e9dbcfd4..72e070b5f06 100644 --- a/src/gallium/drivers/nouveau/nouveau_buffer.c +++ b/src/gallium/drivers/nouveau/nouveau_buffer.c @@ -286,7 +286,8 @@ nouveau_buffer_transfer_del(struct nouveau_context *nv, { if (tx->map) { if (likely(tx->bo)) { - nouveau_bo_ref(NULL, &tx->bo); + nouveau_fence_work(nv->screen->fence.current, + nouveau_fence_unref_bo, tx->bo); if (tx->mm) release_allocation(&tx->mm, nv->screen->fence.current); } else { @@ -787,7 +788,7 @@ nouveau_buffer_migrate(struct nouveau_context *nv, nv->copy_data(nv, buf->bo, buf->offset, new_domain, bo, offset, old_domain, buf->base.width0); - nouveau_bo_ref(NULL, &bo); + nouveau_fence_work(screen->fence.current, nouveau_fence_unref_bo, bo); if (mm) release_allocation(&mm, screen->fence.current); } else |