[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 2/5] ui/dbus: factor out sending a scanout
From: |
marcandre . lureau |
Subject: |
[PULL 2/5] ui/dbus: factor out sending a scanout |
Date: |
Tue, 12 Mar 2024 18:02:13 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
ui/dbus-listener.c | 35 +++++++++++++++++------------------
1 file changed, 17 insertions(+), 18 deletions(-)
diff --git a/ui/dbus-listener.c b/ui/dbus-listener.c
index 18f556aa73..3f4529dbbd 100644
--- a/ui/dbus-listener.c
+++ b/ui/dbus-listener.c
@@ -630,11 +630,26 @@ static void dbus_gfx_update_sub(DBusDisplayListener *ddl,
DBUS_DEFAULT_TIMEOUT, NULL, NULL, NULL);
}
+static void ddl_scanout(DBusDisplayListener *ddl)
+{
+ GVariant *v_data;
+
+ 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,
+ g_object_ref(ddl));
+}
+
static void dbus_gfx_update(DisplayChangeListener *dcl,
int x, int y, int w, int h)
{
DBusDisplayListener *ddl = container_of(dcl, DBusDisplayListener, dcl);
- GVariant *v_data;
assert(ddl->ds);
@@ -652,23 +667,7 @@ static void dbus_gfx_update(DisplayChangeListener *dcl,
#endif
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;
+ return ddl_scanout(ddl);
}
dbus_gfx_update_sub(ddl, x, y, w, h);
--
2.44.0
- [PULL 0/5] UI patches, marcandre . lureau, 2024/03/12
- [PULL 1/5] ui/vnc: Respect bound console, marcandre . lureau, 2024/03/12
- [PULL 2/5] ui/dbus: factor out sending a scanout,
marcandre . lureau <=
- [PULL 5/5] virtio-gpu: fix scanout migration post-load, marcandre . lureau, 2024/03/12
- [PULL 4/5] virtio-gpu: remove needless condition, marcandre . lureau, 2024/03/12
- [PULL 3/5] ui/dbus: filter out pending messages when scanout, marcandre . lureau, 2024/03/12
- Re: [PULL 0/5] UI patches, Peter Maydell, 2024/03/12
- [PULL 0/5] Ui patches, marcandre . lureau, 2024/03/20
- [PULL 1/5] ui/vc: Do not inherit the size of active console, marcandre . lureau, 2024/03/20
- [PULL 2/5] ui/vnc: Do not use console_select(), marcandre . lureau, 2024/03/20
- [PULL 3/5] ui/cocoa: Do not use console_select(), marcandre . lureau, 2024/03/20
- [PULL 4/5] ui/curses: Do not use console_select(), marcandre . lureau, 2024/03/20
- [PULL 5/5] ui: compile dbus-display1.c with -fPIC as necessary, marcandre . lureau, 2024/03/20