aboutsummaryrefslogtreecommitdiff
path: root/ui
AgeCommit message (Collapse)AuthorFilesLines
2022-01-18spice: Update QXLInterface for spice >= 0.15.0John Snow1-0/+11
spice updated the spelling (and arguments) of "attache_worker" in 0.15.0. Update QEMU to match, preventing -Wdeprecated-declarations compilations from reporting build errors. See also: https://gitlab.freedesktop.org/spice/spice/-/commit/974692bda1e77af92b71ed43b022439448492cb9 Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20211215141949.3512719-3-berrange@redhat.com> Message-Id: <20220105135009.1584676-3-alex.bennee@linaro.org>
2022-01-18ui: avoid compiler warnings from unused clipboard info variableDaniel P. Berrangé1-3/+1
With latest clang 13.0.0 we get ../ui/clipboard.c:47:34: error: variable 'old' set but not used [-Werror,-Wunused-but-set-variable] g_autoptr(QemuClipboardInfo) old = NULL; ^ The compiler can't tell that we only declared this variable in order to get the side effect of free'ing it when out of scope. This pattern is a little dubious for a use of g_autoptr, so rewrite the code to avoid it. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> [AJB: fix merge conflict] Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20211215141949.3512719-2-berrange@redhat.com> Message-Id: <20220105135009.1584676-2-alex.bennee@linaro.org>
2022-01-13ui/input-legacy: pass horizontal scroll informationDmitry Petrov1-0/+15
This code seems to be used by vmport hack, passing these values allows to implement horizontal scroll support even when using vmport. In case it's not supported horizontal scroll will act as a vertical one. Signed-off-by: Dmitry Petrov <dpetroff@gmail.com> Message-Id: <20220108153947.171861-6-dpetroff@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2022-01-13ui/sdl2: pass horizontal scroll information to the device codeDmitry Petrov1-0/+5
Signed-off-by: Dmitry Petrov <dpetroff@gmail.com> Message-Id: <20220108153947.171861-5-dpetroff@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2022-01-13ui/gtk: pass horizontal scroll information to the device codeDmitry Petrov1-12/+42
Signed-off-by: Dmitry Petrov <dpetroff@gmail.com> Message-Id: <20220108153947.171861-4-dpetroff@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2022-01-13ui/cocoa: pass horizontal scroll information to the device codeDmitry Petrov1-6/+12
Signed-off-by: Dmitry Petrov <dpetroff@gmail.com> Message-Id: <20220108153947.171861-3-dpetroff@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2022-01-13ui: fix gtk clipboard clear assertionMarc-André Lureau1-10/+11
When closing the QEMU Gtk display window, it can occasionaly warn: qemu-system-x86_64: Gtk: gtk_clipboard_set_with_data: assertion 'targets != NULL' failed #3 0x00007ffff4f02f22 in gtk_clipboard_set_with_data (clipboard=<optimized out>, targets=<optimized out>, n_targets=<optimized out>, get_func=<optimized out>, clear_func=<optimized out>, user_data=<optimized out>) at /usr/src/debug/gtk3-3.24.30-4.fc35.x86_64/gtk/gtkclipboard.c:672 #4 0x00007ffff552cd75 in gd_clipboard_update_info (gd=0x5555579a9e00, info=0x555557ba4b50) at ../ui/gtk-clipboard.c:98 #5 0x00007ffff552ce00 in gd_clipboard_notify (notifier=0x5555579aaba8, data=0x7fffffffd720) at ../ui/gtk-clipboard.c:128 #6 0x000055555603e0ff in notifier_list_notify (list=0x555556657470 <clipboard_notifiers>, data=0x7fffffffd720) at ../util/notify.c:39 #7 0x000055555594e8e0 in qemu_clipboard_update (info=0x555557ba4b50) at ../ui/clipboard.c:54 #8 0x000055555594e840 in qemu_clipboard_peer_release (peer=0x55555684a5b0, selection=QEMU_CLIPBOARD_SELECTION_PRIMARY) at ../ui/clipboard.c:40 #9 0x000055555594e786 in qemu_clipboard_peer_unregister (peer=0x55555684a5b0) at ../ui/clipboard.c:19 #10 0x000055555595f044 in vdagent_disconnect (vd=0x55555684a400) at ../ui/vdagent.c:852 #11 0x000055555595f262 in vdagent_chr_fini (obj=0x55555684a400) at ../ui/vdagent.c:908 Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20211216083233.1166504-1-marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2022-01-13ui/dbus: fix buffer-overflow detected by ASANMarc-André Lureau1-0/+1
On the last added dbus patch, I left a tiny BO: ==441487==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x611000025a70 at pc 0x7f0817bb764c bp 0x7ffde672ae60 sp 0x7ffde672ae58 WRITE of size 8 at 0x611000025a70 thread T0 #0 0x7f0817bb764b in dbus_vc_class_init ../ui/dbus.c:401 A cookie for ASAN! not you C :) Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Fixes: 7f767ca35e5 ("ui/dbus: register D-Bus VC handler") Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20211222144032.443424-1-marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2022-01-13ui/vnc.c: Fixed a deadlock bug.Rao Lei1-2/+2
The GDB statck is as follows: (gdb) bt 0 __lll_lock_wait (futex=futex@entry=0x56211df20360, private=0) at lowlevellock.c:52 1 0x00007f263caf20a3 in __GI___pthread_mutex_lock (mutex=0x56211df20360) at ../nptl/pthread_mutex_lock.c:80 2 0x000056211a757364 in qemu_mutex_lock_impl (mutex=0x56211df20360, file=0x56211a804857 "../ui/vnc-jobs.h", line=60) at ../util/qemu-thread-posix.c:80 3 0x000056211a0ef8c7 in vnc_lock_output (vs=0x56211df14200) at ../ui/vnc-jobs.h:60 4 0x000056211a0efcb7 in vnc_clipboard_send (vs=0x56211df14200, count=1, dwords=0x7ffdf1701338) at ../ui/vnc-clipboard.c:138 5 0x000056211a0f0129 in vnc_clipboard_notify (notifier=0x56211df244c8, data=0x56211dd1bbf0) at ../ui/vnc-clipboard.c:209 6 0x000056211a75dde8 in notifier_list_notify (list=0x56211afa17d0 <clipboard_notifiers>, data=0x56211dd1bbf0) at ../util/notify.c:39 7 0x000056211a0bf0e6 in qemu_clipboard_update (info=0x56211dd1bbf0) at ../ui/clipboard.c:50 8 0x000056211a0bf05d in qemu_clipboard_peer_release (peer=0x56211df244c0, selection=QEMU_CLIPBOARD_SELECTION_CLIPBOARD) at ../ui/clipboard.c:41 9 0x000056211a0bef9b in qemu_clipboard_peer_unregister (peer=0x56211df244c0) at ../ui/clipboard.c:19 10 0x000056211a0d45f3 in vnc_disconnect_finish (vs=0x56211df14200) at ../ui/vnc.c:1358 11 0x000056211a0d4c9d in vnc_client_read (vs=0x56211df14200) at ../ui/vnc.c:1611 12 0x000056211a0d4df8 in vnc_client_io (ioc=0x56211ce70690, condition=G_IO_IN, opaque=0x56211df14200) at ../ui/vnc.c:1649 13 0x000056211a5b976c in qio_channel_fd_source_dispatch (source=0x56211ce50a00, callback=0x56211a0d4d71 <vnc_client_io>, user_data=0x56211df14200) at ../io/channel-watch.c:84 14 0x00007f263ccede8e in g_main_context_dispatch () at /lib/x86_64-linux-gnu/libglib-2.0.so.0 15 0x000056211a77d4a1 in glib_pollfds_poll () at ../util/main-loop.c:232 16 0x000056211a77d51f in os_host_main_loop_wait (timeout=958545) at ../util/main-loop.c:255 17 0x000056211a77d630 in main_loop_wait (nonblocking=0) at ../util/main-loop.c:531 18 0x000056211a45bc8e in qemu_main_loop () at ../softmmu/runstate.c:726 19 0x000056211a0b45fa in main (argc=69, argv=0x7ffdf1701778, envp=0x7ffdf17019a8) at ../softmmu/main.c:50 From the call trace, we can see it is a deadlock bug. vnc_disconnect_finish will acquire the output_mutex. But, the output_mutex will be acquired again in vnc_clipboard_send. Repeated locking will cause deadlock. So, I move qemu_clipboard_peer_unregister() behind vnc_unlock_output(); Fixes: 0bf41cab93e ("ui/vnc: clipboard support") Signed-off-by: Lei Rao <lei.rao@intel.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220105020808.597325-1-lei.rao@intel.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-12-21ui/dbus: register D-Bus VC handlerMarc-André Lureau1-0/+53
Export the default consoles over the D-Bus chardev. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2021-12-21ui/dbus: add chardev backend & interfaceMarc-André Lureau5-0/+442
Add a new chardev backend which allows D-Bus client to handle the chardev stream & events. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2021-12-21ui/dbus: add clipboard interfaceMarc-André Lureau6-0/+579
Expose the clipboard API over D-Bus. See the interface documentation for further details. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2021-12-21audio: add "dbus" audio backendMarc-André Lureau3-0/+247
Add a new -audio backend that accepts D-Bus clients/listeners to handle playback & recording, to be exported via the -display dbus. Example usage: -audiodev dbus,in.mixing-engine=off,out.mixing-engine=off,id=dbus -display dbus,audiodev=dbus Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2021-12-21ui/dbus: add p2p=on/off optionMarc-André Lureau6-7/+146
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>
2021-12-21ui: add a D-Bus display backendMarc-André Lureau8-0/+1787
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>
2021-12-21docs: add dbus-display documentationMarc-André Lureau1-0/+0
Wire up the dbus-display documentation. The interface and feature is implemented next. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2021-12-21console: save current scanout detailsMarc-André Lureau1-54/+111
Add a new DisplayScanout structure to save the current scanout details. This allows to attach later UI backends and set the scanout. Introduce displaychangelistener_display_console() helper function to handle the dpy_gfx_switch/gl_scanout() & dpy_gfx_update() calls. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2021-12-21ui: move qemu_spice_fill_device_address to ui/util.cMarc-André Lureau4-51/+80
Other backends can use it. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2021-12-21ui: split the GL context in a different objectMarc-André Lureau9-53/+83
This will allow to have one GL context but a variable number of listeners. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2021-12-21ui: dispatch GL events to all listenersMarc-André Lureau1-16/+42
For now, only one listener can receive GL events. Let's dispatch to all listeners. (preliminary check ensure there is a single listener now during regitration, and in next patches, compatible listeners only) Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2021-12-21ui: simplify gl unblock & flushMarc-André Lureau6-17/+3
GraphicHw.gl_flushed was introduced to notify the device (vhost-user-gpu) that the GL resources (the display scanout) are no longer needed. It was decoupled from QEMU own gl-blocking mechanism, but that difference isn't helping. Instead, we can reuse QEMU gl-blocking and notify virtio_gpu_gl_flushed() when unblocking (to unlock vhost-user-gpu). An extra block/unblock is added arount dpy_gl_update() so existing backends that don't block will have the flush event handled. It will also help when there are no backends associated. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2021-12-21ui: add a gl-unblock warning timerMarc-André Lureau1-0/+17
Similar to the one that exists for Spice, so we can investigate if something is locked. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2021-12-21ui: make gl_block use a counterMarc-André Lureau1-4/+13
Track multiple callers blocking requests. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2021-12-21ui: associate GL context outside of display listener registrationMarc-André Lureau5-2/+15
Consoles can have an associated GL context, without listeners (they may be added or removed later on). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2021-12-21ui: factor out qemu_console_set_display_gl_ctx()Marc-André Lureau1-8/+14
The next patch will make use of this function to dissociate DisplayChangeListener from GL context. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
2021-12-21ui: do not delay further remote resizeMarc-André Lureau6-7/+8
A remote client, such as Spice, will already avoid flooding the stream by delaying the resize requests. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2021-12-21ui/clipboard: add a clipboard reset serial eventMarc-André Lureau5-0/+28
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2021-12-21ui/clipboard: add qemu_clipboard_check_serial()Marc-André Lureau1-0/+15
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2021-12-21ui/vdagent: add serial capability supportMarc-André Lureau2-1/+39
The Spice agent implements a simple serial mechanism to avoid clipboard races between client & guest. See: https://gitlab.freedesktop.org/spice/spice-protocol/-/commit/045a6978d6dbbf7046affc5c321fa8177c8cce56 Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2021-12-21ui: generalize clipboard notifierMarc-André Lureau6-27/+71
Use a QemuClipboardNotify union type for extendable clipboard events. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2021-12-21ui/vdagent: replace #if 0 with protocol version checkMarc-André Lureau1-3/+5
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2021-12-21ui/vdagent: add CHECK_SPICE_PROTOCOL_VERSIONMarc-André Lureau1-0/+8
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2021-11-22ui/vnc-clipboard: fix adding notifier twiceVladimir Sementsov-Ogievskiy1-4/+6
vnc_server_cut_text_caps() is not guaranteed to be called only once. If it called twice, we finally call notifier_list_add() twice with same element. Which leads to loopback QLIST. So, on next notifier_list_notify() we'll loop forever and QEMU stuck. So, let's only register new notifier if it's not yet registered. Note, that similar check is used in vdagent_chr_recv_caps() (before call qemu_clipboard_peer_register()), and also before qemu_clipboard_peer_unregister() call in vdagent_disconnect() and in vnc_disconnect_finish(). Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <20211110103800.2266729-1-vsementsov@virtuozzo.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-11-22ui/gtk: graphic_hw_gl_flushed after closing dmabuf->fence_fdDongwon Kim1-2/+2
The dmabuf often becomes invalid right after unblocking pipeline and graphic_hw_gl_flushed in case a new scanout blob is submitted because the dmabuf associated with the current guest scanout is freed after swapping. So both graphic_hw_gl_block and graphic_hw_gl_flushed should be executed after closing fence_fd for the current dmabuf. Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Vivek Kasireddy <vivek.kasireddy@intel.com> Signed-off-by: Dongwon Kim <dongwon.kim@intel.com> Message-Id: <20211121172237.14937-1-dongwon.kim@intel.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-11-22ui: fix incorrect pointer position on highdpi with gtkAlexander Orzechowski1-5/+8
Signed-off-by: Alexander Orzechowski <orzechowski.alexander@gmail.com> Message-Id: <20211121065504.29101-3-orzechowski.alexander@gmail.com> [ kraxel: codestyle fix ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-11-22ui: fix incorrect scaling on highdpi with gtk/openglAlexander Orzechowski1-3/+4
Signed-off-by: Alexander Orzechowski <orzechowski.alexander@gmail.com> Message-Id: <20211121065504.29101-2-orzechowski.alexander@gmail.com> [ kraxel: codestyle fix ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-11-19meson.build: Support ncurses on MacOS and OpenBSDStefan Weil1-0/+4
MacOS provides header files for curses 5.7 with support for wide characters, but requires _XOPEN_SOURCE_EXTENDED=1 to activate that. By default those old header files are used even if there is a newer Homebrew installation of ncurses 6.2 available. Change also the old macro definition of NCURSES_WIDECHAR and set it to 1 like it is done in newer versions of curses.h when _XOPEN_SOURCE_EXTENDED=1 is defined. OpenBSD has the same version of ncurses and needs the same fix. Suggested-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Tested-by: Brad Smith <brad@comstyle.com> Message-Id: <20211117205355.1392292-1-sw@weilnetz.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-11-08ui/gtk-egl: Fix build failure when libgbm is not availablePhilippe Mathieu-Daudé1-0/+2
Since commit 4872a023a59 ("ui/gtk-egl: guest fb texture needs to be regenerated when reinitializing egl") we get on Ubuntu 18.04.4 LTS and Debian Buster (oldstable): $ ../configure --enable-virglrenderer [...] ui/gtk-egl.c: In function 'gd_egl_refresh': ui/gtk-egl.c:159:13: error: implicit declaration of function 'egl_dmabuf_release_texture' [-Werror=implicit-function-declaration] 159 | egl_dmabuf_release_texture(vc->gfx.guest_fb.dmabuf); | ^~~~~~~~~~~~~~~~~~~~~~~~~~ ui/gtk-egl.c:159:13: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes] ui/gtk-egl.c:159:13: error: nested extern declaration of 'egl_dmabuf_release_texture' [-Werror=nested-externs] Fix by restricting the egl_dmabuf_release_texture() call to the availability of the generic buffer management library (libgbm). Fixes: 4872a023a593e6519b272a Cc: Dongwon Kim <dongwon.kim@intel.com> Cc: Vivek Kasireddy <vivek.kasireddy@intel.com> Reported-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Tested-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20211108083129.1262040-1-f4bug@amsat.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-11-05ui/gtk-egl: blitting partial guest fb to the proper scanout surfaceDongwon Kim1-4/+21
eb_fb_blit should be able to blit partial image of guest display (blob res) in case multiple displays are configured for the guest and they are set as extended- desktop mode. v2: egl_fb includes dmabuf info then make egl_fb_blit position and size parameters programmed in dmabuf structure (previously position/size parameters were given to egl_fb_blit separately) (Vivek Kasireddy) changed the commit message as there is no interface change to egl_fb_blit Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Vivek Kasireddy <vivek.kasireddy@intel.com> Signed-off-by: Dongwon Kim <dongwon.kim@intel.com> Message-Id: <20211104065153.28897-6-dongwon.kim@intel.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-11-05ui/gtk: gd_draw_event returns FALSE when no cairo surface is boundDongwon Kim1-0/+3
gd_draw_event shouldn't try to repaint if surface does not exist for the VC. Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Dongwon Kim <dongwon.kim@intel.com> Message-Id: <20211104065153.28897-4-dongwon.kim@intel.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-11-05ui/gtk-egl: guest fb texture needs to be regenerated when reinitializing eglDongwon Kim1-0/+4
If guest fb is backed by dmabuf (blob-resource), the texture bound to the old context needs to be recreated in case the egl is re-initialized (e.g. new window for vc is created in case of detaching/reattaching of the tab) v2: call egl_dmabuf_release_texutre instead of putting 0 to dmabuf->texture (Vivek Kasireddy) Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Dongwon Kim <dongwon.kim@intel.com> Message-Id: <20211104065153.28897-3-dongwon.kim@intel.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-11-05ui/gtk-egl: make sure the right context is set as the currentDongwon Kim1-0/+6
Making the vc->gfx.ectx current before handling texture associated with it Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Dongwon Kim <dongwon.kim@intel.com> Message-Id: <20211104065153.28897-2-dongwon.kim@intel.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-11-05ui/gtk-egl: un-tab and re-tab should destroy egl surface and contextDongwon Kim1-0/+20
An old esurface should be destroyed and set to be NULL when doing un-tab and re-tab so that a new esurface an context can be created for the window widget that those will be bound to. v2: enabling opengl specific routines only when CONFIG_OPENGL is set Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Dongwon Kim <dongwon.kim@intel.com> Signed-off-by: Khairul Anuar Romli <khairul.anuar.romli@intel.com> Message-Id: <20211104065153.28897-1-dongwon.kim@intel.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-11-02ui/console: remove chardev frontend connected testVolker Rümelin1-8/+5
The test if the chardev frontend is connected in kbd_put_keysym_console() is redundant, because the call to qemu_chr_be_can_write() in kbd_send_chars() tests the connected condition again. Remove the redundant test whether the chardev frontend is connected. Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20210916192239.18742-3-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-11-02ui/console: replace kbd_timer with chr_accept_input callbackVolker Rümelin1-15/+13
There's a ChardevClass chr_accept_input() callback function that can replace the write retry timer. Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <20210916192239.18742-2-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-11-02ui/console: replace QEMUFIFO with Fifo8Volker Rümelin1-66/+20
One of the two FIFO implementations QEMUFIFO and Fifo8 is redundant. Replace QEMUFIFO with Fifo8. Signed-off-by: Volker Rümelin <vr_qemu@t-online.de> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20210916192239.18742-1-vr_qemu@t-online.de> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-11-02ui/gtk: skip any extra draw of same guest scanout blob resDongwon Kim2-32/+57
Any extra draw call for the same blob resource representing guest scanout before the previous drawing is not finished can break synchronous draw sequence. To prevent this, drawing is now done only once for each draw submission (when draw_submitted == true). v2: - removed mutex - updated commit msg Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Vivek Kasireddy <vivek.kasireddy@intel.com> Signed-off-by: Dongwon Kim <dongwon.kim@intel.com> Message-Id: <20210924225105.24930-1-dongwon.kim@intel.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-11-02ui/gtk: Update the refresh rate for gl-area tooNikola Pavlica1-0/+3
This is a bugfix that stretches all the way back to January 2020, where I initially introduced this problem and potential solutions. A quick recap of the issue: QEMU did not sync up with the monitors refresh rate causing the VM to render frames that were NOT displayed to the user. That "fix" allowed QEMU to obtain the screen refreshrate information from the system using GDK API's and was for GTK only. Well, I'm back with the same issue again. But this time on Wayland. And I did NOT realize there was YET another screen refresh rate function, this time for Wayland specifically. Thankfully the fix was simple and without much hassle. Thanks, Nikola PS: It seems that my patch has gone missing from the mailing list, hence I'm sending it again. Sorry for any inconveniences. Signed-off-by: Nikola Pavlica <pavlica.nikola@gmail.com> Message-Id: <20211024143110.704296-1-pavlica.nikola@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-10-14configure, meson: move Spice configure handling to mesonMarc-André Lureau1-2/+2
Add meson feature options for Spice and Spice protocol, and move detection logic out of configure. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20211007102453.978041-1-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20211007130829.632254-13-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-09-15ui/gtk-egl: Wait for the draw signal for dmabuf blobsVivek Kasireddy2-1/+16
Instead of immediately drawing and submitting, queue and wait for the draw signal if the dmabuf submitted is a blob. Cc: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com> Message-Id: <20210914211837.3229977-5-vivek.kasireddy@intel.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>