[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 11/12] ui/dbus: do not send 2d scanout until gfx_update
From: |
marcandre . lureau |
Subject: |
[PATCH v3 11/12] ui/dbus: do not send 2d scanout until gfx_update |
Date: |
Mon, 7 Mar 2022 11:46:31 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
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>
---
ui/dbus-listener.c | 37 ++++++++++++++++++++-----------------
1 file changed, 20 insertions(+), 17 deletions(-)
diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c
index a287edd2fc15..f9fc8eda519a 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,
--
2.35.1.273.ge6ebfd0e8cbb
- [PATCH v3 01/12] ui/console: move check for compatible GL context, (continued)
- [PATCH v3 01/12] ui/console: move check for compatible GL context, marcandre . lureau, 2022/03/07
- [PATCH v3 02/12] ui/console: move dcl compatiblity check to a callback, marcandre . lureau, 2022/03/07
- [PATCH v3 03/12] ui/console: egl-headless is compatible with non-gl listeners, marcandre . lureau, 2022/03/07
- [PATCH v3 04/12] ui/dbus: associate the DBusDisplayConsole listener with the given console, marcandre . lureau, 2022/03/07
- [PATCH v3 05/12] ui/console: move console compatibility check to dcl_display_console(), marcandre . lureau, 2022/03/07
- [PATCH v3 06/12] ui/shader: fix potential leak of shader on error, marcandre . lureau, 2022/03/07
- [PATCH v3 07/12] ui/shader: free associated programs, marcandre . lureau, 2022/03/07
- [PATCH v3 08/12] ui/console: add a dpy_gfx_switch callback helper, marcandre . lureau, 2022/03/07
- [PATCH v3 09/12] ui/console: optionally update after gfx switch, marcandre . lureau, 2022/03/07
- [PATCH v3 10/12] ui/dbus: fix texture sharing, marcandre . lureau, 2022/03/07
- [PATCH v3 11/12] ui/dbus: do not send 2d scanout until gfx_update,
marcandre . lureau <=
- [PATCH v3 12/12] ui/console: call gfx_switch() even if the current scanout is GL, marcandre . lureau, 2022/03/07
- Re: [PATCH v3 12/12] ui/console: call gfx_switch() even if the current scanout is GL, Akihiko Odaki, 2022/03/07
- Re: [PATCH v3 12/12] ui/console: call gfx_switch() even if the current scanout is GL, Marc-André Lureau, 2022/03/07
- Re: [PATCH v3 12/12] ui/console: call gfx_switch() even if the current scanout is GL, Akihiko Odaki, 2022/03/07
- Re: [PATCH v3 12/12] ui/console: call gfx_switch() even if the current scanout is GL, Marc-André Lureau, 2022/03/07
- Re: [PATCH v3 12/12] ui/console: call gfx_switch() even if the current scanout is GL, Akihiko Odaki, 2022/03/07
- Re: [PATCH v3 12/12] ui/console: call gfx_switch() even if the current scanout is GL, Marc-André Lureau, 2022/03/07
- Re: [PATCH v3 12/12] ui/console: call gfx_switch() even if the current scanout is GL, Akihiko Odaki, 2022/03/07
- Re: [PATCH v3 12/12] ui/console: call gfx_switch() even if the current scanout is GL, Marc-André Lureau, 2022/03/08
- Re: [PATCH v3 12/12] ui/console: call gfx_switch() even if the current scanout is GL, Akihiko Odaki, 2022/03/08