@@ -1480,11 +1480,8 @@ void register_displaychangelistener(DisplayChangeListener *dcl)
assert(!dcl->ds);
- 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->ops->dpy_gl_ctx_create) {
+ qemu_console_set_display_gl_ctx(dcl->con, dcl);
}
if (dcl->con) {
@@ -197,7 +197,6 @@ 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);
}
}
@@ -2112,9 +2112,6 @@ 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);
@@ -871,9 +871,6 @@ 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)
@@ -1158,9 +1158,6 @@ 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);
}
This reverts commit ac32b2fff127843355b4f7e7ac9f93dd4a395adf. Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.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, 2 insertions(+), 15 deletions(-)