[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 10/36] ui: factor out qemu_console_set_display_gl_ctx()
From: |
marcandre . lureau |
Subject: |
[PULL v2 10/36] ui: factor out qemu_console_set_display_gl_ctx() |
Date: |
Tue, 21 Dec 2021 10:58:29 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
The next patch will make use of this function to dissociate
DisplayChangeListener from GL context.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
include/ui/console.h | 3 +++
ui/console.c | 22 ++++++++++++++--------
2 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/include/ui/console.h b/include/ui/console.h
index 65e6bbcab8ae..fb10e6d60cd7 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -411,6 +411,9 @@ void graphic_hw_gl_flushed(QemuConsole *con);
void qemu_console_early_init(void);
+void qemu_console_set_display_gl_ctx(QemuConsole *con,
+ DisplayChangeListener *dcl);
+
QemuConsole *qemu_console_lookup_by_index(unsigned int index);
QemuConsole *qemu_console_lookup_by_device(DeviceState *dev, uint32_t head);
QemuConsole *qemu_console_lookup_by_device_name(const char *device_id,
diff --git a/ui/console.c b/ui/console.c
index dcc21eb5b244..7b83e6cdea77 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -1443,6 +1443,19 @@ static bool dpy_compatible_with(QemuConsole *con,
return true;
}
+void qemu_console_set_display_gl_ctx(QemuConsole *con,
+ DisplayChangeListener *dcl)
+{
+ /* display has opengl support */
+ assert(dcl->con);
+ if (dcl->con->gl) {
+ fprintf(stderr, "can't register two opengl displays (%s, %s)\n",
+ dcl->ops->dpy_name, dcl->con->gl->ops->dpy_name);
+ exit(1);
+ }
+ dcl->con->gl = dcl;
+}
+
void register_displaychangelistener(DisplayChangeListener *dcl)
{
static const char nodev[] =
@@ -1453,14 +1466,7 @@ void
register_displaychangelistener(DisplayChangeListener *dcl)
assert(!dcl->ds);
if (dcl->ops->dpy_gl_ctx_create) {
- /* display has opengl support */
- assert(dcl->con);
- if (dcl->con->gl) {
- fprintf(stderr, "can't register two opengl displays (%s, %s)\n",
- dcl->ops->dpy_name, dcl->con->gl->ops->dpy_name);
- exit(1);
- }
- dcl->con->gl = dcl;
+ qemu_console_set_display_gl_ctx(dcl->con, dcl);
}
if (dcl->con) {
--
2.34.1.8.g35151cf07204
- [PULL v2 00/36] ui: D-Bus display backend, marcandre . lureau, 2021/12/21
- [PULL v2 01/36] ui/vdagent: add CHECK_SPICE_PROTOCOL_VERSION, marcandre . lureau, 2021/12/21
- [PULL v2 02/36] ui/vdagent: replace #if 0 with protocol version check, marcandre . lureau, 2021/12/21
- [PULL v2 03/36] ui: generalize clipboard notifier, marcandre . lureau, 2021/12/21
- [PULL v2 04/36] ui/vdagent: add serial capability support, marcandre . lureau, 2021/12/21
- [PULL v2 05/36] ui/clipboard: add qemu_clipboard_check_serial(), marcandre . lureau, 2021/12/21
- [PULL v2 06/36] ui/clipboard: add a clipboard reset serial event, marcandre . lureau, 2021/12/21
- [PULL v2 07/36] hw/display: report an error if virgl initialization failed, marcandre . lureau, 2021/12/21
- [PULL v2 08/36] virtio-gpu: use VIRTIO_GPU_RESOURCE_FLAG_Y_0_TOP, marcandre . lureau, 2021/12/21
- [PULL v2 09/36] ui: do not delay further remote resize, marcandre . lureau, 2021/12/21
- [PULL v2 10/36] ui: factor out qemu_console_set_display_gl_ctx(),
marcandre . lureau <=
- [PULL v2 11/36] ui: associate GL context outside of display listener registration, marcandre . lureau, 2021/12/21
- [PULL v2 12/36] ui: make gl_block use a counter, marcandre . lureau, 2021/12/21
- [PULL v2 13/36] ui: add a gl-unblock warning timer, marcandre . lureau, 2021/12/21
- [PULL v2 14/36] ui: simplify gl unblock & flush, marcandre . lureau, 2021/12/21
- [PULL v2 15/36] ui: dispatch GL events to all listeners, marcandre . lureau, 2021/12/21
- [PULL v2 16/36] ui: split the GL context in a different object, marcandre . lureau, 2021/12/21
- [PULL v2 17/36] ui: move qemu_spice_fill_device_address to ui/util.c, marcandre . lureau, 2021/12/21
- [PULL v2 18/36] console: save current scanout details, marcandre . lureau, 2021/12/21
- [PULL v2 19/36] scripts: teach modinfo to skip non-C sources, marcandre . lureau, 2021/12/21
- [PULL v2 20/36] docs/sphinx: add sphinx modules to include D-Bus documentation, marcandre . lureau, 2021/12/21