diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2023-01-10 17:10:01 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2023-03-13 23:48:45 +0400 |
commit | 4814d3cbf9f921b6f60a384b4aa3fc3151fdd3a7 (patch) | |
tree | 4f678823e942a0542e9dda206ad2dd002778bc32 /ui/dbus.c | |
parent | 84a0a2ef0a073fdfcf4a79686e67e7edbcacad34 (diff) |
ui/dbus: restrict opengl to gbm-enabled config
We can enable EGL later for non-GBM hosts.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'ui/dbus.c')
-rw-r--r-- | ui/dbus.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -47,8 +47,10 @@ static DBusDisplay *dbus_display; static QEMUGLContext dbus_create_context(DisplayGLCtx *dgc, QEMUGLParams *params) { +#ifdef CONFIG_GBM eglMakeCurrent(qemu_egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE, qemu_egl_rn_ctx); +#endif return qemu_egl_create_context(dgc, params); } @@ -56,7 +58,11 @@ static bool dbus_is_compatible_dcl(DisplayGLCtx *dgc, DisplayChangeListener *dcl) { - return dcl->ops == &dbus_gl_dcl_ops || dcl->ops == &dbus_console_dcl_ops; + return +#ifdef CONFIG_GBM + dcl->ops == &dbus_gl_dcl_ops || +#endif + dcl->ops == &dbus_console_dcl_ops; } static void @@ -459,7 +465,11 @@ early_dbus_init(DisplayOptions *opts) DisplayGLMode mode = opts->has_gl ? opts->gl : DISPLAYGL_MODE_OFF; if (mode != DISPLAYGL_MODE_OFF) { +#ifdef CONFIG_OPENGL egl_init(opts->u.dbus.rendernode, mode, &error_fatal); +#else + error_report("dbus: GL rendering is not supported"); +#endif } type_register(&dbus_vc_type_info); |