Mesa (master): virgl: Don't try handling server fences when they are not supported

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Nov 28 09:14:49 UTC 2018


Module: Mesa
Branch: master
Commit: 091295d7cb5781ddf7ca8f254471fbe896831fbc
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=091295d7cb5781ddf7ca8f254471fbe896831fbc

Author: Gert Wollny <gert.wollny at collabora.com>
Date:   Tue Nov 27 20:50:44 2018 +0100

virgl: Don't try handling server fences when they are not supported

vtest doesn't implement the according API and would segfault:

Program received signal SIGSEGV, Segmentation fault.
  #0  0x0000000000000000 in ?? ()
  #1  in virgl_fence_server_sync  at
       src/gallium/drivers/virgl/virgl_context.c:1049
  #2  in st_server_wait_sync  at
       src/mesa/state_tracker/st_cb_syncobj.c:155

so just don't do the call when the function pointers are not set.

Fixes dEQP:
  dEQP-GLES3.functional.fence_sync.wait_sync_smalldraw
  dEQP-GLES3.functional.fence_sync.wait_sync_largedraw

Fixes: d1a1c21e7621b5177febf191fcd3d3b8ef69dc96
  virgl: native fence fd support

Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
Reviewed-by: Dave Airlie <airlied at redhat.com>
Reviewed-by: Robert Foss <robert.foss at collabora.com>

---

 src/gallium/drivers/virgl/virgl_context.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/virgl/virgl_context.c b/src/gallium/drivers/virgl/virgl_context.c
index 892fef76c7..f0ee64c145 100644
--- a/src/gallium/drivers/virgl/virgl_context.c
+++ b/src/gallium/drivers/virgl/virgl_context.c
@@ -1037,7 +1037,8 @@ static void virgl_create_fence_fd(struct pipe_context *ctx,
    assert(type == PIPE_FD_TYPE_NATIVE_SYNC);
    struct virgl_screen *rs = virgl_screen(ctx->screen);
 
-   *fence = rs->vws->cs_create_fence(rs->vws, fd);
+   if (rs->vws->cs_create_fence)
+      *fence = rs->vws->cs_create_fence(rs->vws, fd);
 }
 
 static void virgl_fence_server_sync(struct pipe_context *ctx,
@@ -1046,7 +1047,8 @@ static void virgl_fence_server_sync(struct pipe_context *ctx,
    struct virgl_context *vctx = virgl_context(ctx);
    struct virgl_screen *rs = virgl_screen(ctx->screen);
 
-   rs->vws->fence_server_sync(rs->vws, vctx->cbuf, fence);
+   if (rs->vws->fence_server_sync)
+      rs->vws->fence_server_sync(rs->vws, vctx->cbuf, fence);
 }
 
 static void virgl_set_shader_images(struct pipe_context *ctx,




More information about the mesa-commit mailing list