summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/virgl/virgl_texture.c
diff options
context:
space:
mode:
authorAlexandros Frantzis <alexandros.frantzis@collabora.com>2019-06-24 16:57:46 +0300
committerChia-I Wu <olvaffe@gmail.com>2019-06-28 04:30:02 +0000
commit5388be039bc8dc4c0ed2875d0ca35c6f37053948 (patch)
tree3de3edc9787ee74e39e16e5b15778b096371e730 /src/gallium/drivers/virgl/virgl_texture.c
parent790d1a0b17376ac3c53c123f7a1b117220d71f95 (diff)
virgl: Use virgl_staging_mgr
Use an instance of virgl_staging_mgr instead of u_upload_mgr to handle the staging buffer. This removes the need to track the availability of the staging manager, since virgl_staging_mgr can handle concurrent active allocations. Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com> Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Diffstat (limited to 'src/gallium/drivers/virgl/virgl_texture.c')
-rw-r--r--src/gallium/drivers/virgl/virgl_texture.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/gallium/drivers/virgl/virgl_texture.c b/src/gallium/drivers/virgl/virgl_texture.c
index 1553d41a072..8a85a28cec4 100644
--- a/src/gallium/drivers/virgl/virgl_texture.c
+++ b/src/gallium/drivers/virgl/virgl_texture.c
@@ -149,7 +149,7 @@ static void *texture_transfer_map_plain(struct pipe_context *ctx,
map_addr = NULL;
break;
case VIRGL_TRANSFER_MAP_STAGING:
- map_addr = virgl_transfer_uploader_map(vctx, trans);
+ map_addr = virgl_staging_map(vctx, trans);
/* Copy transfers don't make use of hw_res_map at the moment. */
trans->hw_res_map = NULL;
break;
@@ -317,12 +317,9 @@ static void virgl_texture_transfer_unmap(struct pipe_context *ctx,
struct pipe_resource *res = transfer->resource;
bool queue_unmap = false;
- /* We don't need to transfer the contents of staging buffers, since they
- * don't have any host-side storage. */
- if (pipe_to_virgl_bind(vs, res->bind, res->flags) == VIRGL_BIND_STAGING) {
- virgl_resource_destroy_transfer(vctx, trans);
- return;
- }
+ /* We don't transfer the contents of staging resources, since they don't
+ * have any host-side storage. */
+ assert(pipe_to_virgl_bind(vs, res->bind, res->flags) != VIRGL_BIND_STAGING);
if (transfer->usage & PIPE_TRANSFER_WRITE &&
(transfer->usage & PIPE_TRANSFER_FLUSH_EXPLICIT) == 0) {
@@ -357,8 +354,6 @@ static void virgl_texture_transfer_unmap(struct pipe_context *ctx,
if (queue_unmap) {
if (trans->copy_src_hw_res) {
virgl_encode_copy_transfer(vctx, trans);
- /* It's now safe for other mappings to use the transfer_uploader. */
- vctx->transfer_uploader_in_use = false;
virgl_resource_destroy_transfer(vctx, trans);
} else {
virgl_transfer_queue_unmap(&vctx->queue, trans);