From patchwork Fri Jan 22 12:23:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 8089731 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A83D69F1CC for ; Fri, 22 Jan 2016 12:31:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 16380203AA for ; Fri, 22 Jan 2016 12:31:41 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6356A20361 for ; Fri, 22 Jan 2016 12:31:40 +0000 (UTC) Received: from localhost ([::1]:53067 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMasN-000570-PQ for patchwork-qemu-devel@patchwork.kernel.org; Fri, 22 Jan 2016 07:31:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMakx-00018o-9W for qemu-devel@nongnu.org; Fri, 22 Jan 2016 07:24:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMakt-0001f7-3d for qemu-devel@nongnu.org; Fri, 22 Jan 2016 07:23:59 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53403) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMaks-0001f1-U8 for qemu-devel@nongnu.org; Fri, 22 Jan 2016 07:23:55 -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 9C70683F37; Fri, 22 Jan 2016 12:23:54 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-19.ams2.redhat.com [10.36.116.19]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0MCNrjV000847; Fri, 22 Jan 2016 07:23:54 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 6F351807C6; Fri, 22 Jan 2016 13:23:50 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 22 Jan 2016 13:23:43 +0100 Message-Id: <1453465427-6961-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1453465427-6961-1-git-send-email-kraxel@redhat.com> References: <1453465427-6961-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Subject: [Qemu-devel] [PATCH v2 2/6] console: block rendering until client is done X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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é 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; 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); QemuConsole *qemu_console_lookup_by_index(unsigned int index); QemuConsole *qemu_console_lookup_by_device(DeviceState *dev, uint32_t head); 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) } } +void graphic_hw_gl_block(QemuConsole *con, bool block) +{ + if (!con) { + con = 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) {