From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38227) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQvQk-0000KU-B2 for qemu-devel@nongnu.org; Wed, 03 Feb 2016 06:17:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aQvQf-00025F-Jx for qemu-devel@nongnu.org; Wed, 03 Feb 2016 06:17:02 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36407) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aQvQf-00024M-FU for qemu-devel@nongnu.org; Wed, 03 Feb 2016 06:16:57 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id DC2F192A43 for ; Wed, 3 Feb 2016 11:16:55 +0000 (UTC) From: Gerd Hoffmann Date: Wed, 3 Feb 2016 12:16:44 +0100 Message-Id: <1454498208-15164-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1454498208-15164-1-git-send-email-kraxel@redhat.com> References: <1454498208-15164-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 2/6] console: block rendering until client is done List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Allow gl user interfaces to block display device gl rendering. The ui code might want to do that in case it takes a little longer to bring things to screen, for example because we'll hand over a dma-buf to another process (spice will do that). Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-Andr=C3=A9 Lureau --- include/ui/console.h | 2 ++ ui/console.c | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/include/ui/console.h b/include/ui/console.h index adac36d..12ad627 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -362,6 +362,7 @@ typedef struct GraphicHwOps { void (*text_update)(void *opaque, console_ch_t *text); void (*update_interval)(void *opaque, uint64_t interval); int (*ui_info)(void *opaque, uint32_t head, QemuUIInfo *info); + void (*gl_block)(void *opaque, bool block); } GraphicHwOps; =20 QemuConsole *graphic_console_init(DeviceState *dev, uint32_t head, @@ -374,6 +375,7 @@ void graphic_console_set_hwops(QemuConsole *con, void graphic_hw_update(QemuConsole *con); void graphic_hw_invalidate(QemuConsole *con); void graphic_hw_text_update(QemuConsole *con, console_ch_t *chardata); +void graphic_hw_gl_block(QemuConsole *con, bool block); =20 QemuConsole *qemu_console_lookup_by_index(unsigned int index); QemuConsole *qemu_console_lookup_by_device(DeviceState *dev, uint32_t he= ad); diff --git a/ui/console.c b/ui/console.c index fe950c6..791b4fc 100644 --- a/ui/console.c +++ b/ui/console.c @@ -261,6 +261,16 @@ void graphic_hw_update(QemuConsole *con) } } =20 +void graphic_hw_gl_block(QemuConsole *con, bool block) +{ + if (!con) { + con =3D active_console; + } + if (con && con->hw_ops->gl_block) { + con->hw_ops->gl_block(con->hw, block); + } +} + void graphic_hw_invalidate(QemuConsole *con) { if (!con) { --=20 1.8.3.1