From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uoa0I-0000QB-Qv for qemu-devel@nongnu.org; Mon, 17 Jun 2013 10:01:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uoa0F-0008VP-Kp for qemu-devel@nongnu.org; Mon, 17 Jun 2013 10:01:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:2500) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uoa0F-0008U0-5r for qemu-devel@nongnu.org; Mon, 17 Jun 2013 10:01:51 -0400 From: Gerd Hoffmann Date: Mon, 17 Jun 2013 16:01:46 +0200 Message-Id: <1371477707-7039-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1371477707-7039-1-git-send-email-kraxel@redhat.com> References: <1371477707-7039-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [RfC PATCH 1/2] display update with notification List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Anthony Liguori , alevy@redhat.com, Gerd Hoffmann , lcapitulino@redhat.com Signed-off-by: Gerd Hoffmann --- include/ui/console.h | 2 ++ ui/console.c | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/include/ui/console.h b/include/ui/console.h index 092b9be..4860687 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -273,6 +273,7 @@ static inline void console_write_ch(console_ch_t *dest, uint32_t ch) typedef struct GraphicHwOps { void (*invalidate)(void *opaque); void (*gfx_update)(void *opaque); + void (*gfx_update_notify)(void *opaque, QEMUBH *notify); void (*text_update)(void *opaque, console_ch_t *text); void (*update_interval)(void *opaque, uint64_t interval); } GraphicHwOps; @@ -282,6 +283,7 @@ QemuConsole *graphic_console_init(DeviceState *dev, void *opaque); void graphic_hw_update(QemuConsole *con); +void graphic_hw_update_notify(QemuConsole *con, QEMUBH *notify); void graphic_hw_invalidate(QemuConsole *con); void graphic_hw_text_update(QemuConsole *con, console_ch_t *chardata); diff --git a/ui/console.c b/ui/console.c index 07d4d63..020805c 100644 --- a/ui/console.c +++ b/ui/console.c @@ -255,6 +255,21 @@ void graphic_hw_update(QemuConsole *con) } } +void graphic_hw_update_notify(QemuConsole *con, QEMUBH *notify) +{ + assert(con != NULL); + + if (con->hw_ops->gfx_update_notify) { + con->hw_ops->gfx_update_notify(con->hw, notify); + return; + } + + if (con->hw_ops->gfx_update) { + con->hw_ops->gfx_update(con->hw); + } + qemu_bh_schedule(notify); +} + void graphic_hw_invalidate(QemuConsole *con) { if (!con) { -- 1.7.9.7