diff options
author | Gurchetan Singh <[email protected]> | 2019-01-03 16:20:47 -0800 |
---|---|---|
committer | Gert Wollny <[email protected]> | 2019-02-15 11:19:04 +0100 |
commit | 168c3ffce34e8c0f81d6bf32da82c0b5427f5c89 (patch) | |
tree | 8e60c88aa0edb26e231fc27c10dd2d1bd3293ac9 /src/gallium/drivers/virgl/virgl_buffer.c | |
parent | d5c2dacc155912ad6e78afe9022aabc9af6ee697 (diff) |
virgl: when creating / freeing transfers, pass slab pool directly
This will allow us to destroy transfers w/o having a pointer
to the context.
Reviewed-by: Gert Wollny <[email protected]>
Diffstat (limited to 'src/gallium/drivers/virgl/virgl_buffer.c')
-rw-r--r-- | src/gallium/drivers/virgl/virgl_buffer.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gallium/drivers/virgl/virgl_buffer.c b/src/gallium/drivers/virgl/virgl_buffer.c index 3c732c90132..e46c9f504fd 100644 --- a/src/gallium/drivers/virgl/virgl_buffer.c +++ b/src/gallium/drivers/virgl/virgl_buffer.c @@ -50,8 +50,8 @@ static void *virgl_buffer_transfer_map(struct pipe_context *ctx, if (doflushwait) ctx->flush(ctx, NULL, 0); - trans = virgl_resource_create_transfer(ctx, resource, &vbuf->metadata, level, - usage, box); + trans = virgl_resource_create_transfer(&vctx->transfer_pool, resource, + &vbuf->metadata, level, usage, box); readback = virgl_res_needs_readback(vctx, vbuf, usage, 0); if (readback) @@ -66,6 +66,7 @@ static void *virgl_buffer_transfer_map(struct pipe_context *ctx, ptr = vs->vws->resource_map(vs->vws, vbuf->hw_res); if (!ptr) { + virgl_resource_destroy_transfer(&vctx->transfer_pool, trans); return NULL; } @@ -100,7 +101,7 @@ static void virgl_buffer_transfer_unmap(struct pipe_context *ctx, } out: - virgl_resource_destroy_transfer(vctx, trans); + virgl_resource_destroy_transfer(&vctx->transfer_pool, trans); } static void virgl_buffer_transfer_flush_region(struct pipe_context *ctx, |