aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2016-02-19 07:46:47 +0100
committerGerd Hoffmann <kraxel@redhat.com>2016-02-23 12:04:40 +0100
commit8e388e907b853ca42f5c8825042fa17b126d86de (patch)
treec5ae10ae73196bec61be096825382c200fbfc9ac
parent474114b7305cc1be7c2ee8ba5267be159a9d56e3 (diff)
downloadqemu-8e388e907b853ca42f5c8825042fa17b126d86de.zip
qemu-8e388e907b853ca42f5c8825042fa17b126d86de.tar.gz
qemu-8e388e907b853ca42f5c8825042fa17b126d86de.tar.bz2
spice/gl: add unblock timer
Pure debug aid, print a warning in case unblocking doesn't happen within one second. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
-rw-r--r--include/ui/spice-display.h1
-rw-r--r--ui/spice-display.c16
2 files changed, 17 insertions, 0 deletions
diff --git a/include/ui/spice-display.h b/include/ui/spice-display.h
index 48dc8c4..69a222b 100644
--- a/include/ui/spice-display.h
+++ b/include/ui/spice-display.h
@@ -117,6 +117,7 @@ struct SimpleSpiceDisplay {
#ifdef HAVE_SPICE_GL
/* opengl rendering */
QEMUBH *gl_unblock_bh;
+ QEMUTimer *gl_unblock_timer;
int dmabuf_fd;
#endif
};
diff --git a/ui/spice-display.c b/ui/spice-display.c
index 904fb33..d6e31e4 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -797,6 +797,15 @@ static const DisplayChangeListenerOps display_listener_ops = {
static void qemu_spice_gl_block(SimpleSpiceDisplay *ssd, bool block)
{
+ uint64_t timeout;
+
+ if (block) {
+ timeout = qemu_clock_get_ms(QEMU_CLOCK_REALTIME);
+ timeout += 1000; /* one sec */
+ timer_mod(ssd->gl_unblock_timer, timeout);
+ } else {
+ timer_del(ssd->gl_unblock_timer);
+ }
graphic_hw_gl_block(ssd->dcl.con, block);
}
@@ -807,6 +816,11 @@ static void qemu_spice_gl_unblock_bh(void *opaque)
qemu_spice_gl_block(ssd, false);
}
+static void qemu_spice_gl_block_timer(void *opaque)
+{
+ fprintf(stderr, "WARNING: spice: no gl-draw-done within one second\n");
+}
+
static QEMUGLContext qemu_spice_gl_create_context(DisplayChangeListener *dcl,
QEMUGLParams *params)
{
@@ -888,6 +902,8 @@ static void qemu_spice_display_init_one(QemuConsole *con)
ssd->dcl.ops = &display_listener_gl_ops;
ssd->dmabuf_fd = -1;
ssd->gl_unblock_bh = qemu_bh_new(qemu_spice_gl_unblock_bh, ssd);
+ ssd->gl_unblock_timer = timer_new_ms(QEMU_CLOCK_REALTIME,
+ qemu_spice_gl_block_timer, ssd);
}
#endif
ssd->dcl.con = con;