All of lore.kernel.org
 help / color / mirror / Atom feed
From: marcandre.lureau@redhat.com
To: qemu-devel@nongnu.org
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>
Subject: [PATCH 06/27] ui: associate GL context outside of display listener registration
Date: Fri, 12 Mar 2021 14:00:47 +0400	[thread overview]
Message-ID: <20210312100108.2706195-7-marcandre.lureau@redhat.com> (raw)
In-Reply-To: <20210312100108.2706195-1-marcandre.lureau@redhat.com>

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 ui/console.c       | 7 +++++--
 ui/egl-headless.c  | 1 +
 ui/gtk.c           | 3 +++
 ui/sdl2.c          | 3 +++
 ui/spice-display.c | 3 +++
 5 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/ui/console.c b/ui/console.c
index 83475bd8c3..53eba2019e 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -1524,8 +1524,11 @@ void register_displaychangelistener(DisplayChangeListener *dcl)
 
     assert(!dcl->ds);
 
-    if (dcl->ops->dpy_gl_ctx_create) {
-        qemu_console_set_display_gl_ctx(dcl->con, dcl);
+    if (dcl->con && dcl->con->gl &&
+        dcl->con->gl != dcl) {
+        error_report("Display %s is incompatible with the GL context",
+                     dcl->ops->dpy_name);
+        exit(1);
     }
 
     if (dcl->con && !dpy_compatible_with(dcl->con, dcl, &err)) {
diff --git a/ui/egl-headless.c b/ui/egl-headless.c
index da377a74af..773520bc17 100644
--- a/ui/egl-headless.c
+++ b/ui/egl-headless.c
@@ -197,6 +197,7 @@ static void egl_headless_init(DisplayState *ds, DisplayOptions *opts)
         edpy->dcl.con = con;
         edpy->dcl.ops = &egl_ops;
         edpy->gls = qemu_gl_init_shader();
+        qemu_console_set_display_gl_ctx(con, &edpy->dcl);
         register_displaychangelistener(&edpy->dcl);
     }
 }
diff --git a/ui/gtk.c b/ui/gtk.c
index 3edaf041de..d8b3784bf0 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -2082,6 +2082,9 @@ static GSList *gd_vc_gfx_init(GtkDisplayState *s, VirtualConsole *vc,
     vc->gfx.kbd = qkbd_state_init(con);
     vc->gfx.dcl.con = con;
 
+    if (display_opengl) {
+        qemu_console_set_display_gl_ctx(con, &vc->gfx.dcl);
+    }
     register_displaychangelistener(&vc->gfx.dcl);
 
     gd_connect_vc_gfx_signals(vc);
diff --git a/ui/sdl2.c b/ui/sdl2.c
index a203cb0239..0593a333f5 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -863,6 +863,9 @@ static void sdl2_display_init(DisplayState *ds, DisplayOptions *o)
 #endif
         sdl2_console[i].dcl.con = con;
         sdl2_console[i].kbd = qkbd_state_init(con);
+        if (display_opengl) {
+            qemu_console_set_display_gl_ctx(con, &sdl2_console[i].dcl);
+        }
         register_displaychangelistener(&sdl2_console[i].dcl);
 
 #if defined(SDL_VIDEO_DRIVER_WINDOWS) || defined(SDL_VIDEO_DRIVER_X11)
diff --git a/ui/spice-display.c b/ui/spice-display.c
index d22781a23d..f637fd1bc6 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -1152,6 +1152,9 @@ static void qemu_spice_display_init_one(QemuConsole *con)
 
     qemu_spice_create_host_memslot(ssd);
 
+    if (spice_opengl) {
+        qemu_console_set_display_gl_ctx(con, &ssd->dcl);
+    }
     register_displaychangelistener(&ssd->dcl);
 }
 
-- 
2.29.0



  parent reply	other threads:[~2021-03-12 10:07 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-12 10:00 [PATCH 00/27] Add D-Bus display backend marcandre.lureau
2021-03-12 10:00 ` [PATCH 01/27] ui: fold qemu_alloc_display in only caller marcandre.lureau
2021-03-12 10:00 ` [PATCH 02/27] vhost-user-gpu: glFlush before notifying clients marcandre.lureau
2021-03-12 10:00 ` [PATCH 03/27] vhost-user-gpu: fix vugbm_device_init fallback marcandre.lureau
2021-03-12 10:00 ` [PATCH 04/27] vhost-user-gpu: fix cursor move/update marcandre.lureau
2021-03-12 10:00 ` [PATCH 05/27] ui: factor out qemu_console_set_display_gl_ctx() marcandre.lureau
2021-03-12 15:34   ` Philippe Mathieu-Daudé
2021-03-12 10:00 ` marcandre.lureau [this message]
2021-03-12 10:00 ` [PATCH 07/27] ui: make gl_block use a counter marcandre.lureau
2021-03-12 10:12   ` Philippe Mathieu-Daudé
2021-03-12 11:21     ` Marc-André Lureau
2021-03-12 10:00 ` [PATCH 08/27] ui: add a gl-unblock warning timer marcandre.lureau
2021-03-12 10:00 ` [PATCH 09/27] ui: simplify gl unblock & flush marcandre.lureau
2021-03-12 10:00 ` [PATCH 10/27] ui: dispatch GL events to all listeners marcandre.lureau
2021-03-12 10:00 ` [PATCH 11/27] ui: split the GL context in a different object marcandre.lureau
2021-03-12 10:00 ` [PATCH 12/27] ui: move qemu_spice_fill_device_address to ui/util.c marcandre.lureau
2021-03-12 10:00 ` [PATCH 13/27] console: save current scanout details marcandre.lureau
2021-03-12 10:00 ` [PATCH 14/27] ui: add a D-Bus display backend marcandre.lureau
2021-03-12 11:03   ` Gerd Hoffmann
2021-03-12 11:27     ` Marc-André Lureau
2021-03-12 15:16       ` Gerd Hoffmann
2021-03-12 10:00 ` [PATCH 15/27] audio: add dbusaudio backend marcandre.lureau
2021-03-12 10:00 ` [PATCH 16/27] vhost-user-gpu: add vg_send_disable_scanout() marcandre.lureau
2021-03-12 10:00 ` [PATCH 17/27] vhost-user-gpu: add vg_send_scanout_dmabuf() marcandre.lureau
2021-03-12 10:00 ` [PATCH 18/27] vhost-user-gpu: add vg_send_dmabuf_update() marcandre.lureau
2021-03-12 10:01 ` [PATCH 19/27] vhost-user-gpu: add vg_send_scanout() marcandre.lureau
2021-03-12 10:01 ` [PATCH 20/27] vhost-user-gpu: add vg_send_cursor_update() marcandre.lureau
2021-03-12 10:01 ` [PATCH 21/27] vhost-user-gpu: add vg_send_cursor_pos() marcandre.lureau
2021-03-12 10:01 ` [PATCH 22/27] vhost-user-gpu: add vg_send_update() marcandre.lureau
2021-03-12 10:01 ` [PATCH 23/27] vhost-user: add VHOST_USER_GPU_QEMU_DBUS_LISTENER marcandre.lureau
2021-03-12 10:01 ` [PATCH 24/27] ui: add GraphicHwOps.register_dbus_listener() marcandre.lureau
2021-03-12 10:01 ` [PATCH 25/27] vhost-user-gpu: implement register_dbus_listener() marcandre.lureau
2021-03-12 10:01 ` [PATCH 26/27] vhost-user-gpu: check the PIXMAN format is supported marcandre.lureau
2021-03-12 10:01 ` [PATCH 27/27] vhost-user-gpu: implement GPU_QEMU_DBUS_LISTENER marcandre.lureau
2021-03-12 11:16 ` [PATCH 00/27] Add D-Bus display backend no-reply
2021-03-12 11:18 ` Gerd Hoffmann
2021-03-12 11:29   ` Marc-André Lureau
2021-03-12 14:37     ` Gerd Hoffmann
2021-03-12 14:57       ` Marc-André Lureau

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=20210312100108.2706195-7-marcandre.lureau@redhat.com \
    --to=marcandre.lureau@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.