qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: spice-devel@lists.freedesktop.org,
	"Marc-André Lureau" <marcandre.lureau@gmail.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH v2 08/12] console: track gl_block state in QemuConsole
Date: Fri, 19 Feb 2016 10:14:45 +0100	[thread overview]
Message-ID: <1455873289-349-9-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1455873289-349-1-git-send-email-kraxel@redhat.com>

Keep track of gl_block state (added in bba19b8 console: block rendering
until client is done) in QemuConsole and allow to query it.  This way
we can avoid state inconsistencies in case different code paths make use
of this.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 include/ui/console.h |  1 +
 ui/console.c         | 15 +++++++++++----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/include/ui/console.h b/include/ui/console.h
index c8f9f7e..9672ad9 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -382,6 +382,7 @@ QemuConsole *qemu_console_lookup_by_device(DeviceState *dev, uint32_t head);
 bool qemu_console_is_visible(QemuConsole *con);
 bool qemu_console_is_graphic(QemuConsole *con);
 bool qemu_console_is_fixedsize(QemuConsole *con);
+bool qemu_console_is_gl_blocked(QemuConsole *con);
 char *qemu_console_get_label(QemuConsole *con);
 int qemu_console_get_index(QemuConsole *con);
 uint32_t qemu_console_get_head(QemuConsole *con);
diff --git a/ui/console.c b/ui/console.c
index b739ae9..215c98d 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -123,6 +123,7 @@ struct QemuConsole {
     DisplaySurface *surface;
     int dcls;
     DisplayChangeListener *gl;
+    bool gl_block;
 
     /* Graphic console state.  */
     Object *device;
@@ -264,10 +265,10 @@ 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) {
+    assert(con != NULL);
+
+    con->gl_block = block;
+    if (con->hw_ops->gl_block) {
         con->hw_ops->gl_block(con->hw, block);
     }
 }
@@ -1811,6 +1812,12 @@ bool qemu_console_is_fixedsize(QemuConsole *con)
     return con && (con->console_type != TEXT_CONSOLE);
 }
 
+bool qemu_console_is_gl_blocked(QemuConsole *con)
+{
+    assert(con != NULL);
+    return con->gl_block;
+}
+
 char *qemu_console_get_label(QemuConsole *con)
 {
     if (con->console_type == GRAPHIC_CONSOLE) {
-- 
1.8.3.1

  parent reply	other threads:[~2016-02-19  9:15 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-19  9:14 [Qemu-devel] [PATCH v2 00/12] spice: add opengl/virgl/dmabuf support Gerd Hoffmann
2016-02-19  9:14 ` [Qemu-devel] [PATCH v2 01/12] spice: init dcl before registering qxl interface Gerd Hoffmann
2016-02-19 12:27   ` Marc-André Lureau
2016-02-19  9:14 ` [Qemu-devel] [PATCH v2 02/12] configure: add dma-buf support detection Gerd Hoffmann
2016-02-19  9:14 ` [Qemu-devel] [PATCH v2 03/12] egl-helpers: add functions for render nodes and dma-buf passing Gerd Hoffmann
2016-02-19  9:14 ` [Qemu-devel] [PATCH v2 04/12] spice: reset cursor on resize Gerd Hoffmann
2016-02-19  9:14 ` [Qemu-devel] [PATCH v2 05/12] spice: add opengl/virgl/dmabuf support Gerd Hoffmann
2016-02-19  9:14 ` [Qemu-devel] [PATCH v2 06/12] spice: add unblock timer Gerd Hoffmann
2016-02-19 12:34   ` Marc-André Lureau
2016-02-19  9:14 ` [Qemu-devel] [PATCH v2 07/12] spice: tweak debug messages Gerd Hoffmann
2016-02-19  9:14 ` Gerd Hoffmann [this message]
2016-02-19  9:14 ` [Qemu-devel] [PATCH v2 09/12] spice/gl: render DisplaySurface via opengl Gerd Hoffmann
2016-02-19  9:14 ` [Qemu-devel] [PATCH v2 10/12] spice/gl: create dummy primary surface (RfC) Gerd Hoffmann
2016-03-18 13:17   ` Gerd Hoffmann
2016-03-18 13:45     ` Marc-André Lureau
2016-03-21 10:24       ` Gerd Hoffmann
2016-03-21 18:24         ` Marc-André Lureau
2016-05-23 13:52           ` Gerd Hoffmann
2016-05-23 14:03             ` Marc-André Lureau
2016-05-24 13:39               ` Gerd Hoffmann
2016-05-24 19:34                 ` [Qemu-devel] [Spice-devel] " Marc-André Lureau
2016-02-19  9:14 ` [Qemu-devel] [PATCH v2 11/12] spice: add & use qemu_spice_gl_monitor_config Gerd Hoffmann
2016-02-19 12:32   ` Marc-André Lureau
2016-04-28 17:21     ` Marc-André Lureau
2016-02-19  9:14 ` [Qemu-devel] [PATCH v2 12/12] [fixup] spice: qemu_spice_gl_monitor_config + surface Gerd Hoffmann

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=1455873289-349-9-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=marcandre.lureau@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=spice-devel@lists.freedesktop.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).