diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2022-08-11 18:25:16 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2023-03-13 23:48:45 +0400 |
commit | 84a0a2ef0a073fdfcf4a79686e67e7edbcacad34 (patch) | |
tree | 39441645dd7aaef335d7855a93f24f297dc4c2bb /ui/dbus-listener.c | |
parent | 0e1be59ed9b3b50aa7e66669e94aabdf0c3d80d2 (diff) |
ui/dbus: do not require opengl & gbm
Allow to build & use the DBus display without 3d/GPU acceleration support.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'ui/dbus-listener.c')
-rw-r--r-- | ui/dbus-listener.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c index 2e87ed7e9a..85692f1b27 100644 --- a/ui/dbus-listener.c +++ b/ui/dbus-listener.c @@ -27,9 +27,11 @@ #include "dbus.h" #include <gio/gunixfdlist.h> +#ifdef CONFIG_OPENGL #include "ui/shader.h" #include "ui/egl-helpers.h" #include "ui/egl-context.h" +#endif #include "trace.h" struct _DBusDisplayListener { @@ -48,6 +50,7 @@ struct _DBusDisplayListener { G_DEFINE_TYPE(DBusDisplayListener, dbus_display_listener, G_TYPE_OBJECT) +#ifdef CONFIG_OPENGL static void dbus_update_gl_cb(GObject *source_object, GAsyncResult *res, gpointer user_data) @@ -229,12 +232,14 @@ static void dbus_gl_refresh(DisplayChangeListener *dcl) ddl->gl_updates = 0; } } +#endif static void dbus_refresh(DisplayChangeListener *dcl) { graphic_hw_update(dcl->con); } +#ifdef CONFIG_OPENGL static void dbus_gl_gfx_update(DisplayChangeListener *dcl, int x, int y, int w, int h) { @@ -242,6 +247,7 @@ static void dbus_gl_gfx_update(DisplayChangeListener *dcl, ddl->gl_updates++; } +#endif static void dbus_gfx_update(DisplayChangeListener *dcl, int x, int y, int w, int h) @@ -296,6 +302,7 @@ static void dbus_gfx_update(DisplayChangeListener *dcl, DBUS_DEFAULT_TIMEOUT, NULL, NULL, NULL); } +#ifdef CONFIG_OPENGL static void dbus_gl_gfx_switch(DisplayChangeListener *dcl, struct DisplaySurface *new_surface) { @@ -311,6 +318,7 @@ static void dbus_gl_gfx_switch(DisplayChangeListener *dcl, width, height, 0, 0, width, height); } } +#endif static void dbus_gfx_switch(DisplayChangeListener *dcl, struct DisplaySurface *new_surface) @@ -361,6 +369,7 @@ static void dbus_cursor_define(DisplayChangeListener *dcl, NULL); } +#ifdef CONFIG_OPENGL const DisplayChangeListenerOps dbus_gl_dcl_ops = { .dpy_name = "dbus-gl", .dpy_gfx_update = dbus_gl_gfx_update, @@ -378,6 +387,7 @@ const DisplayChangeListenerOps dbus_gl_dcl_ops = { .dpy_gl_release_dmabuf = dbus_release_dmabuf, .dpy_gl_update = dbus_scanout_update, }; +#endif const DisplayChangeListenerOps dbus_dcl_ops = { .dpy_name = "dbus", @@ -406,11 +416,12 @@ dbus_display_listener_constructed(GObject *object) { DBusDisplayListener *ddl = DBUS_DISPLAY_LISTENER(object); + ddl->dcl.ops = &dbus_dcl_ops; +#ifdef CONFIG_OPENGL if (display_opengl) { ddl->dcl.ops = &dbus_gl_dcl_ops; - } else { - ddl->dcl.ops = &dbus_dcl_ops; } +#endif G_OBJECT_CLASS(dbus_display_listener_parent_class)->constructed(object); } |