All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PULL 6/8] spice/gl: add unblock timer
Date: Tue, 23 Feb 2016 15:24:20 +0100	[thread overview]
Message-ID: <1456237462-3687-7-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1456237462-3687-1-git-send-email-kraxel@redhat.com>

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>
---
 include/ui/spice-display.h |  1 +
 ui/spice-display.c         | 16 ++++++++++++++++
 2 files changed, 17 insertions(+)

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;
-- 
1.8.3.1

  parent reply	other threads:[~2016-02-23 14:24 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-23 14:24 [Qemu-devel] [PULL 0/8] spice: initial opengl/virgl support, postcopy migration fix Gerd Hoffmann
2016-02-23 14:24 ` [Qemu-devel] [PULL 1/8] spice: init dcl before registering qxl interface Gerd Hoffmann
2016-02-23 14:24 ` [Qemu-devel] [PULL 2/8] configure: add dma-buf support detection Gerd Hoffmann
2016-02-26  9:29   ` Paolo Bonzini
2016-02-29 11:00     ` Gerd Hoffmann
2016-02-23 14:24 ` [Qemu-devel] [PULL 3/8] egl-helpers: add functions for render nodes and dma-buf passing Gerd Hoffmann
2016-03-02 14:14   ` Paolo Bonzini
2016-02-23 14:24 ` [Qemu-devel] [PULL 4/8] spice: reset cursor on resize Gerd Hoffmann
2016-02-25 23:10   ` Paolo Bonzini
2016-02-25 23:23     ` Marc-André Lureau
2016-02-25 23:23       ` Paolo Bonzini
2016-02-23 14:24 ` [Qemu-devel] [PULL 5/8] spice: add opengl/virgl/dmabuf support Gerd Hoffmann
2016-02-23 14:24 ` Gerd Hoffmann [this message]
2016-02-23 14:24 ` [Qemu-devel] [PULL 7/8] spice/gl: tweak debug messages Gerd Hoffmann
2016-02-23 14:24 ` [Qemu-devel] [PULL 8/8] Postcopy+spice: Pass spice migration data earlier Gerd Hoffmann
2016-02-23 16:44 ` [Qemu-devel] [PULL 0/8] spice: initial opengl/virgl support, postcopy migration fix Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1456237462-3687-7-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.