summaryrefslogtreecommitdiffstats
path: root/ui/dbus.c
diff options
context:
space:
mode:
authorPeter Maydell2022-03-15 17:28:50 +0100
committerPeter Maydell2022-03-15 17:28:50 +0100
commite2fb7d8aa218256793df99571d16f92074258447 (patch)
tree013210834bdf41528641e21443bce32980981aa5 /ui/dbus.c
parentMerge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (diff)
parentui/console: call gfx_switch() even if the current scanout is GL (diff)
downloadqemu-e2fb7d8aa218256793df99571d16f92074258447.tar.gz
qemu-e2fb7d8aa218256793df99571d16f92074258447.tar.xz
qemu-e2fb7d8aa218256793df99571d16f92074258447.zip
Merge tag 'dbus-pull-request' of gitlab.com:marcandre.lureau/qemu into staging
GL & D-Bus display related fixes Hi, Here are pending fixes related to D-Bus and GL, most of them reported thanks to Akihiko Odaki. # gpg: Signature made Tue 15 Mar 2022 09:36:45 GMT # gpg: using RSA key 87A9BD933F87C606D276F62DDAE8E10975969CE5 # gpg: issuer "marcandre.lureau@redhat.com" # gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>" [full] # gpg: aka "Marc-André Lureau <marcandre.lureau@gmail.com>" [full] # Primary key fingerprint: 87A9 BD93 3F87 C606 D276 F62D DAE8 E109 7596 9CE5 * tag 'dbus-pull-request' of gitlab.com:marcandre.lureau/qemu: ui/console: call gfx_switch() even if the current scanout is GL ui/dbus: do not send 2d scanout until gfx_update ui/dbus: fix texture sharing ui/console: optionally update after gfx switch ui/console: add a dpy_gfx_switch callback helper ui/shader: free associated programs ui/shader: fix potential leak of shader on error ui/console: move console compatibility check to dcl_display_console() ui/dbus: associate the DBusDisplayConsole listener with the given console ui/console: egl-headless is compatible with non-gl listeners ui/console: move dcl compatiblity check to a callback ui/console: move check for compatible GL context Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'ui/dbus.c')
-rw-r--r--ui/dbus.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/ui/dbus.c b/ui/dbus.c
index 0074424c1f..7a87612379 100644
--- a/ui/dbus.c
+++ b/ui/dbus.c
@@ -48,11 +48,40 @@ static QEMUGLContext dbus_create_context(DisplayGLCtx *dgc,
return qemu_egl_create_context(dgc, params);
}
+static bool
+dbus_is_compatible_dcl(DisplayGLCtx *dgc,
+ DisplayChangeListener *dcl)
+{
+ return dcl->ops == &dbus_gl_dcl_ops || dcl->ops == &dbus_console_dcl_ops;
+}
+
+static void
+dbus_create_texture(DisplayGLCtx *ctx, DisplaySurface *surface)
+{
+ surface_gl_create_texture(ctx->gls, surface);
+}
+
+static void
+dbus_destroy_texture(DisplayGLCtx *ctx, DisplaySurface *surface)
+{
+ surface_gl_destroy_texture(ctx->gls, surface);
+}
+
+static void
+dbus_update_texture(DisplayGLCtx *ctx, DisplaySurface *surface,
+ int x, int y, int w, int h)
+{
+ surface_gl_update_texture(ctx->gls, surface, x, y, w, h);
+}
+
static const DisplayGLCtxOps dbus_gl_ops = {
- .compatible_dcl = &dbus_gl_dcl_ops,
+ .dpy_gl_ctx_is_compatible_dcl = dbus_is_compatible_dcl,
.dpy_gl_ctx_create = dbus_create_context,
.dpy_gl_ctx_destroy = qemu_egl_destroy_context,
.dpy_gl_ctx_make_current = qemu_egl_make_context_current,
+ .dpy_gl_ctx_create_texture = dbus_create_texture,
+ .dpy_gl_ctx_destroy_texture = dbus_destroy_texture,
+ .dpy_gl_ctx_update_texture = dbus_update_texture,
};
static NotifierList dbus_display_notifiers =
@@ -83,6 +112,9 @@ dbus_display_init(Object *o)
g_autoptr(GDBusObjectSkeleton) vm = NULL;
dd->glctx.ops = &dbus_gl_ops;
+ if (display_opengl) {
+ dd->glctx.gls = qemu_gl_init_shader();
+ }
dd->iface = qemu_dbus_display1_vm_skeleton_new();
dd->consoles = g_ptr_array_new_with_free_func(g_object_unref);
@@ -119,6 +151,7 @@ dbus_display_finalize(Object *o)
g_clear_object(&dd->iface);
g_free(dd->dbus_addr);
g_free(dd->audiodev);
+ g_clear_pointer(&dd->glctx.gls, qemu_gl_fini_shader);
dbus_display = NULL;
}