@@ -409,9 +409,6 @@ void graphic_hw_gl_block(QemuConsole *con, bool block);
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,
@@ -1458,19 +1458,6 @@ 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[] =
@@ -1481,7 +1468,14 @@ void register_displaychangelistener(DisplayChangeListener *dcl)
assert(!dcl->ds);
if (dcl->ops->dpy_gl_ctx_create) {
- qemu_console_set_display_gl_ctx(dcl->con, dcl);
+ /* display has opengl support */
+ assert(dcl->con);
+ if (dcl->con->gl) {
+ error_report("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;
}
if (dcl->con) {
This reverts commit 4f4181499170dcf80182745b319607802ea32896. This eliminates the situation where a display is registered as a GL context provider but not as a listener. Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> --- include/ui/console.h | 3 --- ui/console.c | 22 ++++++++-------------- 2 files changed, 8 insertions(+), 17 deletions(-)