summary refs log tree commit diff stats
path: root/ui/dbus-listener.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ui/dbus: filter out pending messages when scanoutMarc-André Lureau2024-03-121-0/+40
| | | | | | | | | | | | | | | | | | The "Listener" connection, being private and under the control of the qemu display, allows for the optimization of discarding pending intermediary messages when queuing a new scanout. This ensures that the client receives only the latest scanout update, improving communication efficiency. While the current implementation does not provide a mechanism for clients who may wish to receive all updates, making this behavior optional could be considered in the future. For now, adopting this new default behavior accelerates the communication process without a guarantee of delivering all updates. The filter is removed when the connection is dropped. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* ui/dbus: factor out sending a scanoutMarc-André Lureau2024-03-121-18/+17
| | | | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* ui/dbus: do not require PIXMANMarc-André Lureau2023-11-071-27/+63
| | | | | | Implement a fallback path for region 2D update. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
* ui/dbus: implement damage regions for GLBilal Elmoussaoui2023-09-041-7/+25
| | | | | | | | | | | | | | | | | | | Currently, when using `-display dbus,gl=on` all updates to the client become "full scanout" updates, meaning there is no way for the client to limit damage regions to the display server. Instead of using an "update count", this patch tracks the damage region and propagates it to the client. This was less of an issue when clients were using GtkGLArea for rendering, as you'd be doing full-surface redraw. To be efficient, the client needs both a DMA-BUF and the damage region to be updated. Co-authored-by: Christian Hergert <chergert@redhat.com> Signed-off-by: Bilal Elmoussaoui <belmouss@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230814125802.102160-1-belmouss@redhat.com>
* ui/dbus: fix clang compilation issueMarc-André Lureau2023-08-011-1/+2
| | | | | | | | | | | | | | ../ui/dbus-listener.c:236:9: error: expected expression Error *err = NULL; See: https://gitlab.com/qemu-project/qemu/-/issues/1782#note_1488517427 Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20230726151221.515761-1-marcandre.lureau@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
* ui/dbus: fix win32 compilation when !openglMarc-Andre Lureau2023-08-011-1/+3
| | | | | | | | | Fixes: https://gitlab.com/qemu-project/qemu/-/issues/1782 Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230725112540.53284-1-marcandre.lureau@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
* virtio-gpu-udmabuf: correct naming of QemuDmaBuf size propertiesDongwon Kim2023-07-171-4/+4
| | | | | | | | | | | | | | | Replace 'width' and 'height' in QemuDmaBuf with 'backing_widht' and 'backing_height' as these commonly indicate the size of the whole surface (e.g. guest's Xorg extended display). Then use 'width' and 'height' for sub region in there (e.g. guest's scanouts). Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Marc-André Lureau <marcandre.lureau@redhat.com> Cc: Vivek Kasireddy <vivek.kasireddy@intel.com> Signed-off-by: Dongwon Kim <dongwon.kim@intel.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-ID: <20230713040444.32267-1-dongwon.kim@intel.com>
* ui/dbus: fix build errors in dbus_update_gl_cb and dbus_call_update_glRichard Henderson2023-06-301-0/+4
| | | | | | | | | Add some ifdefs to avoid an unused function and unused variable. Fixes: de1f8ce0abb8 ("ui/dbus: use shared D3D11 Texture2D when possible") Co-developed-by: BALATON Zoltan <balaton@eik.bme.hu> Message-Id: <336f7697-bcfa-1f5f-e411-6859815aa26c@eik.bme.hu> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
* ui/dbus: use shared D3D11 Texture2D when possibleMarc-André Lureau2023-06-271-29/+270
| | | | | | | | | When the client implements "org.qemu.Display1.Listener.Win32.D3d11" and we are running on ANGLE/win32, share the scanout texture with the peer process, and draw with ScanoutTexture2d/UpdateTexture2d methods. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230606115658.677673-22-marcandre.lureau@redhat.com>
* ui: add optional d3d texture pointer to scanout textureMarc-André Lureau2023-06-271-2/+3
| | | | | | | | | The following patch will get the underlying D3D11 Texture2D from the virgl renderer scanout. Pass it along to the texture scanout callbacks as a priliminary step, to simplify review. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230606115658.677673-20-marcandre.lureau@redhat.com>
* ui/dbus: add some GL tracesMarc-André Lureau2023-06-271-0/+6
| | | | | Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230606115658.677673-17-marcandre.lureau@redhat.com>
* ui/dbus: add GL support on win32Marc-André Lureau2023-06-271-30/+68
| | | | | | | | | Enable usage of dbus,gl= on win32. At this point, the scanout texture is read on the DisplaySurface memory, and the client is then updated with the "2D" API (with shared memory if possible). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230606115658.677673-16-marcandre.lureau@redhat.com>
* ui/dbus: use shared memory when possible on win32Marc-André Lureau2023-06-271-2/+163
| | | | | | | | | | | | When the display surface has an associated HANDLE, we can duplicate it to the client process and let it map the memory to avoid expensive copies. Introduce two new win32-specific methods ScanoutMap and UpdateMap. The first is used to inform the listener about the a shared map availability, and the second for display updates. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230606115658.677673-12-marcandre.lureau@redhat.com>
* ui/dbus: compile without gio/gunixfdlist.hMarc-André Lureau2023-06-271-0/+2
| | | | | | | | | D-Bus on windows doesn't support fd-passing. Let's isolate the fdlist-related code as a first step, before adding Windows support, using another mechanism. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230606115658.677673-4-marcandre.lureau@redhat.com>
* ui/dbus: add a FIXME about texture/dmabuf scanout handlingMarc-André Lureau2023-05-281-0/+5
| | | | | | | | | Except SDL, display backends seem to fail at handing full scanout geometry correctly. It would need some test/reproducer to actually check it. In the meantime, fill some missing fields, and leave a FIXME. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230515132537.1026310-1-marcandre.lureau@redhat.com>
* ui/dbus: fix compilation when GBM && !OPENGLMarc-André Lureau2023-05-281-5/+5
| | | | | | | | | | commit 4814d3cbf ("ui/dbus: restrict opengl to gbm-enabled config") assumes that whenever GBM is available, OpenGL is. This is not always the case, let's further restrict opengl-related paths and fix some compilation issues. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20230515132348.1024663-1-marcandre.lureau@redhat.com>
* ui/dbus: restrict opengl to gbm-enabled configMarc-André Lureau2023-03-131-5/+5
| | | | | | | We can enable EGL later for non-GBM hosts. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* ui/dbus: do not require opengl & gbmMarc-André Lureau2023-03-131-2/+13
| | | | | | | Allow to build & use the DBus display without 3d/GPU acceleration support. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* ui: rename cursor_{get->ref}, return itMarc-André Lureau2023-03-131-2/+1
| | | | | | | | | The naming is more conventional in QEMU code, and allows to simplify some code by changing the API design, so it returns the input parameter, instead of void. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* ui: rename cursor_{put->unref}Marc-André Lureau2023-03-131-1/+1
| | | | | | | The naming is more conventional in QEMU. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* ui/dbus: initialize cursor_fbMarc-André Lureau2023-03-131-1/+1
| | | | | | | Or else, we may randomly destroy some textures.. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
* Do not include "qemu/error-report.h" in headers that do not need itThomas Huth2023-02-141-0/+1
| | | | | | | | | | Include it in the .c files instead that use the error reporting functions. Message-Id: <20230210111931.1115489-1-thuth@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
* ui/dbus: do not send 2d scanout until gfx_updateMarc-André Lureau2022-03-151-17/+20
| | | | | | | | | 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>
* ui/dbus: fix texture sharingMarc-André Lureau2022-03-151-11/+0
| | | | | | | | | | | | | | 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>
* ui/dbus: add p2p=on/off optionMarc-André Lureau2021-12-211-1/+1
| | | | | | | | | | | | Add an option to use direct connections instead of via the bus. Clients are accepted with QMP add_client. This allows to provide the D-Bus display without a bus. It also simplifies the testing setup (some CI have issues to setup a D-Bus bus in a container). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
* ui: add a D-Bus display backendMarc-André Lureau2021-12-211-0/+486
The "dbus" display backend exports the QEMU consoles and other UI-related interfaces over D-Bus. By default, the connection is established on the session bus, but you can specify a different bus with the "addr" option. The backend takes the "org.qemu" service name, while still allowing further instances to queue on the same name (so you can lookup all the available instances too). It accepts any number of clients at this point, although this is expected to evolve with options to restrict clients, or only accept p2p via fd passing. The interface is intentionally very close to the internal QEMU API, and can be introspected or interacted with busctl/dfeet etc: $ ./qemu-system-x86_64 -name MyVM -display dbus $ busctl --user introspect org.qemu /org/qemu/Display1/Console_0 org.qemu.Display1.Console interface - - - .RegisterListener method h - - .SetUIInfo method qqiiuu - - .DeviceAddress property s "pci/0000/01.0" emits-change .Head property u 0 emits-change .Height property u 480 emits-change .Label property s "VGA" emits-change .Type property s "Graphic" emits-change .Width property u 640 emits-change [...] See the interfaces XML source file and Sphinx docs for the generated API documentations. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>