summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/virgl/virgl_context.c
diff options
context:
space:
mode:
authorGurchetan Singh <[email protected]>2019-04-15 20:36:54 -0700
committerGurchetan Singh <[email protected]>2019-04-18 15:38:04 -0700
commit599d55371c83e2a535814c78b62f4293be79408d (patch)
tree8195d33c840bce00b157dbdf216642ca7c4baf67 /src/gallium/drivers/virgl/virgl_context.c
parentdfd79079daf08cba0e1d5defc18dedeffb0c6327 (diff)
virgl: wait after a flush
We really need to wait under certain circumstances, or we can end up writing to memory the same time the host is reading. Partial revert of d6dc68 ("virgl: use uint16_t mask instead of separate booleans"). Test cases: - dEQP-GLES31.functional.texture.texture_buffer.render_modify.as_vertex_array.bufferdata on vtest protocol version 2 - Flickering during Alien Isolation Fixes: d6dc68 ("virgl: use uint16_t mask instead of separate booleans") Signed-off-by: Gurchetan Singh <[email protected]> Reviewed-By: Gert Wollny <[email protected]> Reviewed-By: Piotr Rak <[email protected]>
Diffstat (limited to 'src/gallium/drivers/virgl/virgl_context.c')
-rw-r--r--src/gallium/drivers/virgl/virgl_context.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/drivers/virgl/virgl_context.c b/src/gallium/drivers/virgl/virgl_context.c
index b5188654892..b07cab7289d 100644
--- a/src/gallium/drivers/virgl/virgl_context.c
+++ b/src/gallium/drivers/virgl/virgl_context.c
@@ -522,6 +522,7 @@ void virgl_transfer_inline_write(struct pipe_context *ctx,
unsigned layer_stride)
{
struct virgl_context *vctx = virgl_context(ctx);
+ struct virgl_screen *vs = virgl_screen(ctx->screen);
struct virgl_resource *grres = virgl_resource(res);
struct virgl_transfer trans = { 0 };
@@ -535,8 +536,10 @@ void virgl_transfer_inline_write(struct pipe_context *ctx,
virgl_resource_dirty(grres, 0);
- if (virgl_res_needs_flush(vctx, &trans))
+ if (virgl_res_needs_flush(vctx, &trans)) {
ctx->flush(ctx, NULL, 0);
+ vs->vws->resource_wait(vs->vws, grres->hw_res);
+ }
virgl_encoder_inline_write(vctx, grres, level, usage,
box, data, stride, layer_stride);