summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/virgl/virgl_buffer.c
diff options
context:
space:
mode:
authorErik Faye-Lund <[email protected]>2019-04-02 10:48:30 +0200
committerErik Faye-Lund <[email protected]>2019-04-03 18:59:23 +0200
commitb85ca86c1eb2cd095351196cd3a3eb7c1ff4184a (patch)
tree59b06e58cff4c56b76e9c0392ce0591df2baebc8 /src/gallium/drivers/virgl/virgl_buffer.c
parent4c332a1f9fa60fe0e587a07b7265766ed136e5ea (diff)
virgl: also destroy all read-transfers
For texture write-transfers, we either free them on the transfer-queue or right away. But for read-transfers, we currently only destroy them in case they used a temp-resource. This leads to occasional resource-leaks. Let's add a call to virgl_resource_destroy_transfer in the missing case. Do the same thing for buffers as well, but the logic is a bit easier to follow there. Signed-off-by: Erik Faye-Lund <[email protected]> Fixes: f0e71b10888 ("virgl: use transfer queue") Reviewed-by: Gurchetan Singh <[email protected]>
Diffstat (limited to 'src/gallium/drivers/virgl/virgl_buffer.c')
-rw-r--r--src/gallium/drivers/virgl/virgl_buffer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/drivers/virgl/virgl_buffer.c b/src/gallium/drivers/virgl/virgl_buffer.c
index 3baccc010be..784cc02a545 100644
--- a/src/gallium/drivers/virgl/virgl_buffer.c
+++ b/src/gallium/drivers/virgl/virgl_buffer.c
@@ -90,7 +90,8 @@ static void virgl_buffer_transfer_unmap(struct pipe_context *ctx,
vctx->num_transfers++;
virgl_transfer_queue_unmap(&vctx->queue, trans);
- }
+ } else
+ virgl_resource_destroy_transfer(&vctx->transfer_pool, trans);
}
static void virgl_buffer_transfer_flush_region(struct pipe_context *ctx,