summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/virgl
diff options
context:
space:
mode:
authorGurchetan Singh <[email protected]>2018-12-29 00:07:25 +0100
committerErik Faye-Lund <[email protected]>2019-01-03 20:59:29 +0100
commitca66457b0516ef8af5ef17c54460ab8d9aefc5fa (patch)
treed44d518f38eeea061c459f4cc1149e565709efea /src/gallium/drivers/virgl
parent393a756e6af69be8d7f5bcb64eeaad02a63c33c7 (diff)
virgl: don't flush an empty range
Otherwise, the gl-1.0-long-dlist Piglit test crashes. Fixes: db7757 ("virgl: modify how we handle GL_MAP_FLUSH_EXPLICIT_BIT") Reported by airlied@ v2: Exit on any invalid range (Erik) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109190 Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Erik Faye-Lund <[email protected]> Tested-by: Jakob Bornecrantz <[email protected]>
Diffstat (limited to 'src/gallium/drivers/virgl')
-rw-r--r--src/gallium/drivers/virgl/virgl_buffer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/drivers/virgl/virgl_buffer.c b/src/gallium/drivers/virgl/virgl_buffer.c
index cee26da41b7..4d30c6c340e 100644
--- a/src/gallium/drivers/virgl/virgl_buffer.c
+++ b/src/gallium/drivers/virgl/virgl_buffer.c
@@ -83,6 +83,9 @@ static void virgl_buffer_transfer_unmap(struct pipe_context *ctx,
if (trans->base.usage & PIPE_TRANSFER_WRITE) {
struct virgl_screen *vs = virgl_screen(ctx->screen);
if (transfer->usage & PIPE_TRANSFER_FLUSH_EXPLICIT) {
+ if (trans->range.end <= trans->range.start)
+ goto out;
+
transfer->box.x += trans->range.start;
transfer->box.width = trans->range.end - trans->range.start;
trans->offset = transfer->box.x;
@@ -96,6 +99,7 @@ static void virgl_buffer_transfer_unmap(struct pipe_context *ctx,
}
+out:
virgl_resource_destroy_transfer(vctx, trans);
}