All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/27] Add D-Bus display backend
@ 2021-03-12 10:00 marcandre.lureau
  2021-03-12 10:00 ` [PATCH 01/27] ui: fold qemu_alloc_display in only caller marcandre.lureau
                   ` (28 more replies)
  0 siblings, 29 replies; 39+ messages in thread
From: marcandre.lureau @ 2021-03-12 10:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau, Gerd Hoffmann

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Hi,

Both Spice and VNC are relatively complex and inefficient for local-only
display/console export. The goal of this display backend is to export over D-Bus
an interface close to the QEMU internal console API. Any -display or -audio
backend should be possible to implement externally that way. D-Bus is the
protocol of choice for the desktop, it has many convenient bindings for various
languages, or tools (d-feet, busctl etc). Data blob transfer is more efficient
than QMP too.

This implementation makes use of p2p connections for data streaming, and a bus
for basic introspection & interactions. It is currently Unix-only, but it should
be possible to port to other systems relatively easily (minus fd-passing, which
will have to use fallback or different methods).

This will allow to lift some task from the QEMU process (Spice or VNC aren't
trivial!). Backends can come and go. You can have several display opened (say
Boxes & virt-manager), while exporting the display over VNC for example.

An IPC interface is an easy starting point for writing backends in different
languages. I started a Gtk4 & VNC backends in Rust. Rather than rewrite existing
backends, it would be more interesting to develop new ones imho, such as a RDP
backend (based on IronRDP & freerdp). An option is also to build the QEMU
backends as D-Bus backends (maybe not too difficult).

Given the current goals, the D-Bus interface is not meant to be stable.
Clients/backends should be shipped together with QEMU. QEMU could ship its own
Gtk4 widget/library (ideally written in Rust, with an exposed C/GIR API).

The last part of the series modify vhost-user-gpu to notify directly the client
of display changes, bypassing QEMU (VGA-time will be blank, atm)

Basic testing:
$ qemu-system- ... -display dbus

And after git clone https://gitlab.com/marcandre.lureau/qemu-display.git
$ cargo run --bin qemu-gtk4

Better to use with gl=on and virgl. You may also export audio with "-audiodev
dbus" (see related patch).

Marc-André Lureau (27):
  ui: fold qemu_alloc_display in only caller
  vhost-user-gpu: glFlush before notifying clients
  vhost-user-gpu: fix vugbm_device_init fallback
  vhost-user-gpu: fix cursor move/update
  ui: factor out qemu_console_set_display_gl_ctx()
  ui: associate GL context outside of display listener registration
  ui: make gl_block use a counter
  ui: add a gl-unblock warning timer
  ui: simplify gl unblock & flush
  ui: dispatch GL events to all listeners
  ui: split the GL context in a different object
  ui: move qemu_spice_fill_device_address to ui/util.c
  console: save current scanout details
  ui: add a D-Bus display backend
  audio: add dbusaudio backend
  vhost-user-gpu: add vg_send_disable_scanout()
  vhost-user-gpu: add vg_send_scanout_dmabuf()
  vhost-user-gpu: add vg_send_dmabuf_update()
  vhost-user-gpu: add vg_send_scanout()
  vhost-user-gpu: add vg_send_cursor_update()
  vhost-user-gpu: add vg_send_cursor_pos()
  vhost-user-gpu: add vg_send_update()
  vhost-user: add VHOST_USER_GPU_QEMU_DBUS_LISTENER
  ui: add GraphicHwOps.register_dbus_listener()
  vhost-user-gpu: implement register_dbus_listener()
  vhost-user-gpu: check the PIXMAN format is supported
  vhost-user-gpu: implement GPU_QEMU_DBUS_LISTENER

 docs/interop/vhost-user.rst               |  10 +
 meson.build                               |   5 +
 qapi/audio.json                           |   3 +-
 qapi/ui.json                              |  27 +-
 audio/audio_int.h                         |   7 +
 audio/audio_template.h                    |   2 +
 contrib/vhost-user-gpu/vugbm.h            |   2 +-
 contrib/vhost-user-gpu/vugpu.h            |  37 +-
 include/hw/virtio/vhost-backend.h         |   2 +
 include/hw/virtio/virtio-gpu.h            |   1 +
 include/qemu/dbus.h                       |  20 +
 include/ui/console.h                      |  68 ++-
 include/ui/egl-context.h                  |   6 +-
 include/ui/gtk.h                          |  11 +-
 include/ui/sdl2.h                         |   7 +-
 include/ui/spice-display.h                |   5 +-
 subprojects/libvhost-user/libvhost-user.h |   5 +
 ui/dbus.h                                 |  69 +++
 audio/audio.c                             |   1 +
 audio/dbusaudio.c                         | 649 ++++++++++++++++++++++
 contrib/vhost-user-gpu/vhost-user-gpu.c   | 580 +++++++++++++++----
 contrib/vhost-user-gpu/virgl.c            |  45 +-
 contrib/vhost-user-gpu/vugbm.c            |  44 +-
 hw/display/qxl.c                          |   5 +-
 hw/display/vhost-user-gpu.c               |  35 +-
 hw/display/virtio-gpu-base.c              |  19 +-
 hw/display/virtio-vga.c                   |  13 +-
 hw/virtio/vhost-user.c                    |  23 +
 ui/console.c                              | 312 +++++++----
 ui/dbus-console.c                         | 460 +++++++++++++++
 ui/dbus-error.c                           |  45 ++
 ui/dbus-listener.c                        | 480 ++++++++++++++++
 ui/dbus.c                                 | 290 ++++++++++
 ui/egl-context.c                          |   6 +-
 ui/egl-headless.c                         |  20 +-
 ui/gtk-egl.c                              |  11 +-
 ui/gtk-gl-area.c                          |   9 +-
 ui/gtk.c                                  |  25 +-
 ui/sdl2-gl.c                              |  12 +-
 ui/sdl2.c                                 |  14 +-
 ui/spice-core.c                           |  50 --
 ui/spice-display.c                        |  25 +-
 ui/util.c                                 |  75 +++
 util/module.c                             |   3 +
 audio/meson.build                         |   3 +-
 audio/trace-events                        |   5 +
 contrib/vhost-user-gpu/meson.build        |   6 +-
 qemu-options.hx                           |  11 +
 ui/dbus-display1.xml                      | 205 +++++++
 ui/meson.build                            |  18 +
 ui/trace-events                           |  11 +
 51 files changed, 3386 insertions(+), 411 deletions(-)
 create mode 100644 ui/dbus.h
 create mode 100644 audio/dbusaudio.c
 create mode 100644 ui/dbus-console.c
 create mode 100644 ui/dbus-error.c
 create mode 100644 ui/dbus-listener.c
 create mode 100644 ui/dbus.c
 create mode 100644 ui/util.c
 create mode 100644 ui/dbus-display1.xml

-- 
2.29.0




^ permalink raw reply	[flat|nested] 39+ messages in thread

end of thread, other threads:[~2021-03-12 16:14 UTC | newest]

Thread overview: 39+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-12 10:00 [PATCH 00/27] Add D-Bus display backend marcandre.lureau
2021-03-12 10:00 ` [PATCH 01/27] ui: fold qemu_alloc_display in only caller marcandre.lureau
2021-03-12 10:00 ` [PATCH 02/27] vhost-user-gpu: glFlush before notifying clients marcandre.lureau
2021-03-12 10:00 ` [PATCH 03/27] vhost-user-gpu: fix vugbm_device_init fallback marcandre.lureau
2021-03-12 10:00 ` [PATCH 04/27] vhost-user-gpu: fix cursor move/update marcandre.lureau
2021-03-12 10:00 ` [PATCH 05/27] ui: factor out qemu_console_set_display_gl_ctx() marcandre.lureau
2021-03-12 15:34   ` Philippe Mathieu-Daudé
2021-03-12 10:00 ` [PATCH 06/27] ui: associate GL context outside of display listener registration marcandre.lureau
2021-03-12 10:00 ` [PATCH 07/27] ui: make gl_block use a counter marcandre.lureau
2021-03-12 10:12   ` Philippe Mathieu-Daudé
2021-03-12 11:21     ` Marc-André Lureau
2021-03-12 10:00 ` [PATCH 08/27] ui: add a gl-unblock warning timer marcandre.lureau
2021-03-12 10:00 ` [PATCH 09/27] ui: simplify gl unblock & flush marcandre.lureau
2021-03-12 10:00 ` [PATCH 10/27] ui: dispatch GL events to all listeners marcandre.lureau
2021-03-12 10:00 ` [PATCH 11/27] ui: split the GL context in a different object marcandre.lureau
2021-03-12 10:00 ` [PATCH 12/27] ui: move qemu_spice_fill_device_address to ui/util.c marcandre.lureau
2021-03-12 10:00 ` [PATCH 13/27] console: save current scanout details marcandre.lureau
2021-03-12 10:00 ` [PATCH 14/27] ui: add a D-Bus display backend marcandre.lureau
2021-03-12 11:03   ` Gerd Hoffmann
2021-03-12 11:27     ` Marc-André Lureau
2021-03-12 15:16       ` Gerd Hoffmann
2021-03-12 10:00 ` [PATCH 15/27] audio: add dbusaudio backend marcandre.lureau
2021-03-12 10:00 ` [PATCH 16/27] vhost-user-gpu: add vg_send_disable_scanout() marcandre.lureau
2021-03-12 10:00 ` [PATCH 17/27] vhost-user-gpu: add vg_send_scanout_dmabuf() marcandre.lureau
2021-03-12 10:00 ` [PATCH 18/27] vhost-user-gpu: add vg_send_dmabuf_update() marcandre.lureau
2021-03-12 10:01 ` [PATCH 19/27] vhost-user-gpu: add vg_send_scanout() marcandre.lureau
2021-03-12 10:01 ` [PATCH 20/27] vhost-user-gpu: add vg_send_cursor_update() marcandre.lureau
2021-03-12 10:01 ` [PATCH 21/27] vhost-user-gpu: add vg_send_cursor_pos() marcandre.lureau
2021-03-12 10:01 ` [PATCH 22/27] vhost-user-gpu: add vg_send_update() marcandre.lureau
2021-03-12 10:01 ` [PATCH 23/27] vhost-user: add VHOST_USER_GPU_QEMU_DBUS_LISTENER marcandre.lureau
2021-03-12 10:01 ` [PATCH 24/27] ui: add GraphicHwOps.register_dbus_listener() marcandre.lureau
2021-03-12 10:01 ` [PATCH 25/27] vhost-user-gpu: implement register_dbus_listener() marcandre.lureau
2021-03-12 10:01 ` [PATCH 26/27] vhost-user-gpu: check the PIXMAN format is supported marcandre.lureau
2021-03-12 10:01 ` [PATCH 27/27] vhost-user-gpu: implement GPU_QEMU_DBUS_LISTENER marcandre.lureau
2021-03-12 11:16 ` [PATCH 00/27] Add D-Bus display backend no-reply
2021-03-12 11:18 ` Gerd Hoffmann
2021-03-12 11:29   ` Marc-André Lureau
2021-03-12 14:37     ` Gerd Hoffmann
2021-03-12 14:57       ` Marc-André Lureau

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.