summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/virgl/virgl_buffer.c
diff options
context:
space:
mode:
authorGurchetan Singh <[email protected]>2019-03-13 22:58:22 +0000
committerGurchetan Singh <[email protected]>2019-03-13 22:58:22 +0000
commitd6dc68e7b5b6f76a55037f6995dad101cc089d02 (patch)
tree9da41c73d685f8717d26ede50df3b816da256590 /src/gallium/drivers/virgl/virgl_buffer.c
parent56717e13a65007a641ede756ea0b26a333dbc72b (diff)
virgl: use uint16_t mask instead of separate booleans
This should save some space. Suggested-by: Erik Faye-Lund <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/gallium/drivers/virgl/virgl_buffer.c')
-rw-r--r--src/gallium/drivers/virgl/virgl_buffer.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/gallium/drivers/virgl/virgl_buffer.c b/src/gallium/drivers/virgl/virgl_buffer.c
index ae4e74c7936..3baccc010be 100644
--- a/src/gallium/drivers/virgl/virgl_buffer.c
+++ b/src/gallium/drivers/virgl/virgl_buffer.c
@@ -40,28 +40,25 @@ static void *virgl_buffer_transfer_map(struct pipe_context *ctx,
struct virgl_transfer *trans;
void *ptr;
bool readback;
- bool doflushwait = false;
+ bool flush = false;
trans = virgl_resource_create_transfer(&vctx->transfer_pool, resource,
&vbuf->metadata, level, usage, box);
if (usage & PIPE_TRANSFER_READ)
- doflushwait = true;
+ flush = true;
else
- doflushwait = virgl_res_needs_flush_wait(vctx, trans);
+ flush = virgl_res_needs_flush(vctx, trans);
- if (doflushwait)
+ if (flush)
ctx->flush(ctx, NULL, 0);
readback = virgl_res_needs_readback(vctx, vbuf, usage, 0);
- if (readback)
+ if (readback) {
vs->vws->transfer_get(vs->vws, vbuf->hw_res, box, trans->base.stride,
trans->l_stride, trans->offset, level);
- if (!(usage & PIPE_TRANSFER_UNSYNCHRONIZED))
- doflushwait = true;
-
- if (doflushwait || readback)
vs->vws->resource_wait(vs->vws, vbuf->hw_res);
+ }
ptr = vs->vws->resource_map(vs->vws, vbuf->hw_res);
if (!ptr) {