diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2022-02-20 23:57:00 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2022-03-15 12:54:59 +0400 |
commit | 2fa2386e38387f592a0abf871eabb16e7a43dcd1 (patch) | |
tree | 29dfd5be6b29248d4c6515eb9919beef72f2b2fc /ui | |
parent | 589089feee5bf5110f21fd582f9c2c479ae718a2 (diff) |
ui/dbus: do not send 2d scanout until gfx_update
gfx_switch() is called to set the new_surface, not necessarily to
display it. It should be displayed after gfx_update(). Send the whole
scanout only in this case.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/dbus-listener.c | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c index a287edd2fc..f9fc8eda51 100644 --- a/ui/dbus-listener.c +++ b/ui/dbus-listener.c @@ -255,6 +255,26 @@ static void dbus_gfx_update(DisplayChangeListener *dcl, trace_dbus_update(x, y, w, h); + if (x == 0 && y == 0 && w == surface_width(ddl->ds) && h == surface_height(ddl->ds)) { + v_data = g_variant_new_from_data( + G_VARIANT_TYPE("ay"), + surface_data(ddl->ds), + surface_stride(ddl->ds) * surface_height(ddl->ds), + TRUE, + (GDestroyNotify)pixman_image_unref, + pixman_image_ref(ddl->ds->image)); + qemu_dbus_display1_listener_call_scanout( + ddl->proxy, + surface_width(ddl->ds), + surface_height(ddl->ds), + surface_stride(ddl->ds), + surface_format(ddl->ds), + v_data, + G_DBUS_CALL_FLAGS_NONE, + DBUS_DEFAULT_TIMEOUT, NULL, NULL, NULL); + return; + } + /* make a copy, since gvariant only handles linear data */ img = pixman_image_create_bits(surface_format(ddl->ds), w, h, NULL, stride); @@ -295,29 +315,12 @@ static void dbus_gfx_switch(DisplayChangeListener *dcl, struct DisplaySurface *new_surface) { DBusDisplayListener *ddl = container_of(dcl, DBusDisplayListener, dcl); - GVariant *v_data = NULL; ddl->ds = new_surface; if (!ddl->ds) { /* why not call disable instead? */ return; } - - v_data = g_variant_new_from_data( - G_VARIANT_TYPE("ay"), - surface_data(ddl->ds), - surface_stride(ddl->ds) * surface_height(ddl->ds), - TRUE, - (GDestroyNotify)pixman_image_unref, - pixman_image_ref(ddl->ds->image)); - qemu_dbus_display1_listener_call_scanout(ddl->proxy, - surface_width(ddl->ds), - surface_height(ddl->ds), - surface_stride(ddl->ds), - surface_format(ddl->ds), - v_data, - G_DBUS_CALL_FLAGS_NONE, - DBUS_DEFAULT_TIMEOUT, NULL, NULL, NULL); } static void dbus_mouse_set(DisplayChangeListener *dcl, |