Skip to content

Commit

Permalink
vhost-user-gpu: glFlush before notifying clients
Browse files Browse the repository at this point in the history
For similar reasons as commit 3af1671 ("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>
  • Loading branch information
elmarco authored and kraxel committed Mar 26, 2021
1 parent d2aea77 commit 0c27b9c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion contrib/vhost-user-gpu/meson.build
Expand Up @@ -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'))

Expand Down
3 changes: 3 additions & 0 deletions contrib/vhost-user-gpu/virgl.c
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 0c27b9c

Please sign in to comment.