diff options
| author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2022-02-17 15:07:21 +0400 |
|---|---|---|
| committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2022-03-15 12:54:55 +0400 |
| commit | 589089feee5bf5110f21fd582f9c2c479ae718a2 (patch) | |
| tree | 2e658edeb5b5abdc5b3dfb9f798d9abb9875afe0 /ui/dbus-listener.c | |
| parent | c84ab0a500a84851debd1d4485e72325da98c778 (diff) | |
| download | focaccia-qemu-589089feee5bf5110f21fd582f9c2c479ae718a2.tar.gz focaccia-qemu-589089feee5bf5110f21fd582f9c2c479ae718a2.zip | |
ui/dbus: fix texture sharing
The DBus listener naively create, update and destroy textures without taking into account other listeners. The texture were shared, but texture update was unnecessarily duplicated. Teach DisplayGLCtx to do optionally shared texture handling. This is only implemented for DBus display at this point, however the same infrastructure could potentially be used for other future combinations. Reported-by: Akihiko Odaki <akihiko.odaki@gmail.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui/dbus-listener.c')
| -rw-r--r-- | ui/dbus-listener.c | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c index 81c119b13a..a287edd2fc 100644 --- a/ui/dbus-listener.c +++ b/ui/dbus-listener.c @@ -42,7 +42,6 @@ struct _DBusDisplayListener { DisplayChangeListener dcl; DisplaySurface *ds; - QemuGLShader *gls; int gl_updates; }; @@ -240,10 +239,6 @@ static void dbus_gl_gfx_update(DisplayChangeListener *dcl, { DBusDisplayListener *ddl = container_of(dcl, DBusDisplayListener, dcl); - if (ddl->ds) { - surface_gl_update_texture(ddl->gls, ddl->ds, x, y, w, h); - } - ddl->gl_updates++; } @@ -285,15 +280,11 @@ static void dbus_gl_gfx_switch(DisplayChangeListener *dcl, { DBusDisplayListener *ddl = container_of(dcl, DBusDisplayListener, dcl); - if (ddl->ds) { - surface_gl_destroy_texture(ddl->gls, ddl->ds); - } ddl->ds = new_surface; if (ddl->ds) { int width = surface_width(ddl->ds); int height = surface_height(ddl->ds); - surface_gl_create_texture(ddl->gls, ddl->ds); /* TODO: lazy send dmabuf (there are unnecessary sent otherwise) */ dbus_scanout_texture(&ddl->dcl, ddl->ds->texture, false, width, height, 0, 0, width, height); @@ -403,7 +394,6 @@ dbus_display_listener_dispose(GObject *object) g_clear_object(&ddl->conn); g_clear_pointer(&ddl->bus_name, g_free); g_clear_object(&ddl->proxy); - g_clear_pointer(&ddl->gls, qemu_gl_fini_shader); G_OBJECT_CLASS(dbus_display_listener_parent_class)->dispose(object); } @@ -414,7 +404,6 @@ dbus_display_listener_constructed(GObject *object) DBusDisplayListener *ddl = DBUS_DISPLAY_LISTENER(object); if (display_opengl) { - ddl->gls = qemu_gl_init_shader(); ddl->dcl.ops = &dbus_gl_dcl_ops; } else { ddl->dcl.ops = &dbus_dcl_ops; |