From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60304) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYDt8-0006sB-PQ for qemu-devel@nongnu.org; Tue, 23 Feb 2016 09:24:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aYDt5-0001S1-AR for qemu-devel@nongnu.org; Tue, 23 Feb 2016 09:24:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53188) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYDt5-0001Rr-4u for qemu-devel@nongnu.org; Tue, 23 Feb 2016 09:24:27 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id D178F85542 for ; Tue, 23 Feb 2016 14:24:26 +0000 (UTC) From: Gerd Hoffmann Date: Tue, 23 Feb 2016 15:24:20 +0100 Message-Id: <1456237462-3687-7-git-send-email-kraxel@redhat.com> In-Reply-To: <1456237462-3687-1-git-send-email-kraxel@redhat.com> References: <1456237462-3687-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 6/8] spice/gl: add unblock timer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Pure debug aid, print a warning in case unblocking doesn't happen within one second. Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-Andr=C3=A9 Lureau --- 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_listen= er_ops =3D { =20 static void qemu_spice_gl_block(SimpleSpiceDisplay *ssd, bool block) { + uint64_t timeout; + + if (block) { + timeout =3D qemu_clock_get_ms(QEMU_CLOCK_REALTIME); + timeout +=3D 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); } =20 @@ -807,6 +816,11 @@ static void qemu_spice_gl_unblock_bh(void *opaque) qemu_spice_gl_block(ssd, false); } =20 +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 =3D &display_listener_gl_ops; ssd->dmabuf_fd =3D -1; ssd->gl_unblock_bh =3D qemu_bh_new(qemu_spice_gl_unblock_bh, ssd= ); + ssd->gl_unblock_timer =3D timer_new_ms(QEMU_CLOCK_REALTIME, + qemu_spice_gl_block_timer, = ssd); } #endif ssd->dcl.con =3D con; --=20 1.8.3.1