[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 12/37] ui: associate GL context outside of display listener re
From: |
marcandre . lureau |
Subject: |
[PATCH v2 12/37] ui: associate GL context outside of display listener registration |
Date: |
Sun, 10 Oct 2021 01:08:13 +0400 |
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 64f35e163c..3c4012271c 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -1523,8 +1523,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) {
diff --git a/ui/egl-headless.c b/ui/egl-headless.c
index a26a2520c4..08327c40c6 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 163b6bcb6a..f8beddbb91 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -2057,6 +2057,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 9ba3bc49e7..bb186a381a 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -866,6 +866,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 52d9f3260a..2c204bceee 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -1156,6 +1156,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.33.0.721.g106298f7f9
- [PATCH v2 02/37] ui/vdagent: add CHECK_SPICE_PROTOCOL_VERSION, (continued)
- [PATCH v2 02/37] ui/vdagent: add CHECK_SPICE_PROTOCOL_VERSION, marcandre . lureau, 2021/10/09
- [PATCH v2 03/37] ui/vdagent: replace #if 0 with protocol version check, marcandre . lureau, 2021/10/09
- [PATCH v2 04/37] ui: generalize clipboard notifier, marcandre . lureau, 2021/10/09
- [PATCH v2 05/37] ui/vdagent: add serial capability support, marcandre . lureau, 2021/10/09
- [PATCH v2 06/37] ui/clipboard: add qemu_clipboard_check_serial(), marcandre . lureau, 2021/10/09
- [PATCH v2 07/37] ui/clipboard: add a clipboard reset serial event, marcandre . lureau, 2021/10/09
- [PATCH v2 08/37] hw/display: report an error if virgl initialization failed, marcandre . lureau, 2021/10/09
- [PATCH v2 09/37] virtio-gpu: use VIRTIO_GPU_RESOURCE_FLAG_Y_0_TOP, marcandre . lureau, 2021/10/09
- [PATCH v2 10/37] ui: do not delay further remote resize, marcandre . lureau, 2021/10/09
- [PATCH v2 11/37] ui: factor out qemu_console_set_display_gl_ctx(), marcandre . lureau, 2021/10/09
- [PATCH v2 12/37] ui: associate GL context outside of display listener registration,
marcandre . lureau <=
- [PATCH v2 13/37] ui: make gl_block use a counter, marcandre . lureau, 2021/10/09
- [PATCH v2 14/37] ui: add a gl-unblock warning timer, marcandre . lureau, 2021/10/09
- [PATCH v2 15/37] ui: simplify gl unblock & flush, marcandre . lureau, 2021/10/09
- [PATCH v2 16/37] ui: dispatch GL events to all listeners, marcandre . lureau, 2021/10/09
- [PATCH v2 17/37] ui: split the GL context in a different object, marcandre . lureau, 2021/10/09
- [PATCH v2 18/37] ui: move qemu_spice_fill_device_address to ui/util.c, marcandre . lureau, 2021/10/09
- [PATCH v2 19/37] console: save current scanout details, marcandre . lureau, 2021/10/09
- [PATCH v2 20/37] scripts: teach modinfo to skip non-C sources, marcandre . lureau, 2021/10/09
- [PATCH v2 21/37] docs/sphinx: add sphinx modules to include D-Bus documentation, marcandre . lureau, 2021/10/09
- [PATCH v2 22/37] backends: move dbus-vmstate1.xml to backends/, marcandre . lureau, 2021/10/09