]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
vhost-user-gpu: glFlush before notifying clients
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Fri, 12 Mar 2021 10:00:43 +0000 (14:00 +0400)
committerGerd Hoffmann <kraxel@redhat.com>
Fri, 26 Mar 2021 05:37:03 +0000 (06:37 +0100)
For similar reasons as commit 3af1671852 ("spice: flush on GL update
before notifying client"), vhost-user-gpu must ensure the GL state is
flushed before sharing its rendering result.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20210312100108.2706195-3-marcandre.lureau@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
contrib/vhost-user-gpu/meson.build
contrib/vhost-user-gpu/virgl.c

index 2fc2320b52fe830f8c0f6d15fabad910fdae8d4b..0ce1515a10e5c9212e634f266a79b4ffb22da018 100644 (file)
@@ -2,7 +2,7 @@ if 'CONFIG_TOOLS' in config_host and 'CONFIG_VIRGL' in config_host \
     and 'CONFIG_GBM' in config_host and 'CONFIG_LINUX' in config_host \
     and pixman.found()
   executable('vhost-user-gpu', files('vhost-user-gpu.c', 'virgl.c', 'vugbm.c'),
-             dependencies: [qemuutil, pixman, gbm, virgl, vhost_user],
+             dependencies: [qemuutil, pixman, gbm, virgl, vhost_user, opengl],
              install: true,
              install_dir: get_option('libexecdir'))
 
index 8bb3c563d975092843e55a43633a2418c77be8a0..9e6660c7ab875fe83f366d040c975b2ca8b20ca6 100644 (file)
@@ -16,6 +16,8 @@
 #include <virglrenderer.h>
 #include "virgl.h"
 
+#include <epoxy/gl.h>
+
 void
 vg_virgl_update_cursor_data(VuGpu *g, uint32_t resource_id,
                             gpointer data)
@@ -372,6 +374,7 @@ virgl_cmd_resource_flush(VuGpu *g,
 
     VUGPU_FILL_CMD(rf);
 
+    glFlush();
     if (!rf.resource_id) {
         g_debug("bad resource id for flush..?");
         return;