Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: qemu/qemu
base: ac84b57b4d74
Choose a base ref
...
head repository: qemu/qemu
compare: 57b93c0f8ea3
Choose a head ref
  • 20 commits
  • 19 files changed
  • 7 contributors

Commits on May 28, 2023

  1. ui/gtk: fix passing y0_top parameter to scanout

    The dmabuf->y0_top flag is passed to .dpy_gl_scanout_dmabuf(), however
    in the gtk ui both implementations dropped it when doing the next
    scanout_texture call.
    
    Fixes flipped linux console using vhost-user-gpu with the gtk ui
    display.
    
    Signed-off-by: Erico Nunes <ernunes@redhat.com>
    Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Message-Id: <20230220175605.43759-1-ernunes@redhat.com>
    ernunesrh authored and elmarco committed May 28, 2023
    Copy the full SHA
    94400fa View commit details
    Browse the repository at this point in the history
  2. ui/gtk: use widget size for cursor motion event

    The gd_motion_event size has some calculations for the cursor position,
    which also take into account things like different size of the
    framebuffer compared to the window size.
    The use of window size makes things more difficult though, as at least
    in the case of Wayland includes the size of ui elements like a menu bar
    at the top of the window. This leads to a wrong position calculation by
    a few pixels.
    Fix it by using the size of the widget, which already returns the size
    of the actual space to render the framebuffer.
    
    Signed-off-by: Erico Nunes <ernunes@redhat.com>
    Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Acked-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
    Message-Id: <20230320160856.364319-1-ernunes@redhat.com>
    ernunesrh authored and elmarco committed May 28, 2023
    Copy the full SHA
    2f31663 View commit details
    Browse the repository at this point in the history
  3. ui/gtk-egl: fix scaling for cursor position in scanout mode

    vc->gfx.w and vc->gfx.h are not updated appropriately in this code path,
    which leads to a different scaling factor for rendering the cursor on
    some edge cases (e.g. the focus has left and re-entered the gtk window).
    This can be reproduced using vhost-user-gpu with the gtk ui on the x11
    backend.
    Use the surface dimensions which are already updated accordingly.
    
    Signed-off-by: Erico Nunes <ernunes@redhat.com>
    Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Message-Id: <20230320160856.364319-2-ernunes@redhat.com>
    ernunesrh authored and elmarco committed May 28, 2023
    Copy the full SHA
    f8a951b View commit details
    Browse the repository at this point in the history
  4. ui/sdl2: fix surface_gl_update_texture: Assertion 'gls' failed

    Before sdl2_gl_update() is called, sdl2_gl_switch() may decide to
    destroy the console window and its associated shaders.
    
    Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1644
    Fixes: c84ab0a ("ui/console: optionally update after gfx switch")
    
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Tested-by: Bin Meng <bin.meng@windriver.com>
    Message-Id: <20230511074217.4171842-1-marcandre.lureau@redhat.com>
    elmarco committed May 28, 2023
    Copy the full SHA
    b3a654d View commit details
    Browse the repository at this point in the history
  5. ui/dbus: fix compilation when GBM && !OPENGL

    commit 4814d3c ("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>
    elmarco committed May 28, 2023
    Copy the full SHA
    0b31e48 View commit details
    Browse the repository at this point in the history
  6. win32: wrap socket close() with an exception handler

    Since commit abe3428 ("win32: avoid mixing SOCKET and file descriptor
    space"), we set HANDLE_FLAG_PROTECT_FROM_CLOSE on the socket FD, to
    prevent closing the HANDLE with CloseHandle. This raises an exception
    which under gdb is fatal, and qemu exits.
    
    Let's catch the expected error instead.
    
    Note: this appears to work, but the mingw64 macro is not well documented
    or tested, and it's not obvious how it is meant to be used.
    
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Message-Id: <20230515132440.1025315-1-marcandre.lureau@redhat.com>
    elmarco committed May 28, 2023
    Copy the full SHA
    d89f30b View commit details
    Browse the repository at this point in the history
  7. virtio-gpu: add a FIXME for virtio_gpu_load()

    It looks like the virtio_gpu_load() does not compute and set the offset,
    the same way virtio_gpu_set_scanout() does. This probably results in
    incorrect display until the scanout/framebuffer is updated again, I
    guess we should fix it, although I haven't checked this yet.
    
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Message-Id: <20230515132518.1025853-1-marcandre.lureau@redhat.com>
    elmarco committed May 28, 2023
    Copy the full SHA
    529969b View commit details
    Browse the repository at this point in the history
  8. gtk: add gl-area support on win32

    On Windows, we don't use the low-level GBM/EGL helpers (no dmabuf etc),
    we can turn on GL area support for the rest of rendering.
    
    (fwiw, GDK backend may be either WGL or EGL)
    
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Tested-by: Bernhard Beschow <shentey@gmail.com>
    Message-Id: <20230515132527.1026064-1-marcandre.lureau@redhat.com>
    elmarco committed May 28, 2023
    Copy the full SHA
    57430aa View commit details
    Browse the repository at this point in the history
  9. ui/dbus: add a FIXME about texture/dmabuf scanout handling

    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>
    elmarco committed May 28, 2023
    Copy the full SHA
    da1d066 View commit details
    Browse the repository at this point in the history
  10. ui/sdl2: Grab Alt+Tab also in fullscreen mode

    By default, SDL grabs Alt+Tab only in non-fullscreen mode. This causes Alt+Tab
    to switch tasks on the host rather than in the VM in fullscreen mode while it
    switches tasks in non-fullscreen mode in the VM. Fix this confusing behavior
    by grabbing Alt+Tab in fullscreen mode, always causing tasks to be switched in
    the VM.
    
    Signed-off-by: Bernhard Beschow <shentey@gmail.com>
    Reviewed-by: Volker Rümelin <vr_qemu@t-online.de>
    Message-Id: <20230417192139.43263-2-shentey@gmail.com>
    shentok authored and elmarco committed May 28, 2023
    Copy the full SHA
    efc00a3 View commit details
    Browse the repository at this point in the history
  11. ui/sdl2: Grab Alt+F4 also under Windows

    SDL doesn't grab Alt+F4 under Windows by default. Pressing Alt+F4 thus closes
    the VM immediately without confirmation, possibly leading to data loss. Fix
    this by always grabbing Alt+F4 on Windows hosts, too.
    
    Signed-off-by: Bernhard Beschow <shentey@gmail.com>
    Reviewed-by: Volker Rümelin <vr_qemu@t-online.de>
    Message-Id: <20230417192139.43263-3-shentey@gmail.com>
    shentok authored and elmarco committed May 28, 2023
    Copy the full SHA
    083db9d View commit details
    Browse the repository at this point in the history
  12. ui/sdl2: disable SDL_HINT_GRAB_KEYBOARD on Windows

    Windows sends an extra left control key up/down input event for
    every right alt key up/down input event for keyboards with
    international layout. Since commit 8304734 ("ui/sdl2: fix
    handling of AltGr key on Windows") QEMU uses a Windows low level
    keyboard hook procedure to reliably filter out the special left
    control key and to grab the keyboard on Windows.
    
    The SDL2 version 2.0.16 introduced its own Windows low level
    keyboard hook procedure to grab the keyboard. Windows calls this
    callback before the QEMU keyboard hook procedure. This disables
    the special left control key filter when the keyboard is grabbed.
    
    To fix the problem, disable the SDL2 Windows low level keyboard
    hook procedure.
    
    Reported-by: Bernhard Beschow <shentey@gmail.com>
    Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
    Reviewed-by: Thomas Huth <thuth@redhat.com>
    Tested-by: Bernhard Beschow <shentey@gmail.com>
    Message-Id: <20230418062823.5683-1-vr_qemu@t-online.de>
    Volker Rümelin authored and elmarco committed May 28, 2023
    Copy the full SHA
    1dfea3f View commit details
    Browse the repository at this point in the history
  13. ui/cursor: make width/height unsigned 16-bit integer

    Although not actually exploitable at the moment, a negative width/height
    could make datasize wrap around and potentially lead to buffer overflow.
    Since there is no reason a negative width/height is ever appropriate,
    modify QEMUCursor struct and cursor_alloc prototype to accept uint16_t.
    This protects us against accidentally introducing future bugs.
    
    Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com>
    Reported-by: Jacek Halon <jacek.halon@gmail.com>
    Reported-by: Yair Mizrahi <yairh33@gmail.com>
    Reported-by: Elsayed El-Refa'ei <e.elrefaei99@gmail.com>
    Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
    Message-Id: <20230523163023.608121-1-mcascell@redhat.com>
    Mauro Matteo Cascella authored and elmarco committed May 28, 2023
    Copy the full SHA
    4c93ce5 View commit details
    Browse the repository at this point in the history
  14. virtio-input: generalize virtio_input_key_config()

    As there are other bitmap-based config properties that need to be dealt in a
    similar fashion as VIRTIO_INPUT_CFG_EV_BITS, generalize the function to
    receive select and subsel as arguments, and rename it to
    virtio_input_extend_config()
    
    Signed-off-by: Sergio Lopez <slp@redhat.com>
    Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Message-Id: <20230526112925.38794-2-slp@redhat.com>
    slp authored and elmarco committed May 28, 2023
    Copy the full SHA
    944ae6d View commit details
    Browse the repository at this point in the history
  15. ui: add the infrastructure to support MT events

    Add the required infrastructure to support generating multitouch events.
    
    Signed-off-by: Sergio Lopez <slp@redhat.com>
    Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Reviewed-by: Markus Armbruster <armbru@redhat.com>
    Message-Id: <20230526112925.38794-3-slp@redhat.com>
    slp authored and elmarco committed May 28, 2023
    Copy the full SHA
    2bfb10d View commit details
    Browse the repository at this point in the history
  16. virtio-input: add a virtio-mulitouch device

    Add a virtio-multitouch device to the family of devices emulated by
    virtio-input implementing the Multi-touch protocol as descripted here:
    
    https://www.kernel.org/doc/html/latest/input/multi-touch-protocol.html?highlight=multi+touch
    
    This patch just add the device itself, without connecting it to any
    backends. The following patches will add a PCI-based multitouch device,
    some helpers in "ui" and will enable the GTK3 backend to transpose
    multi-touch events from the host to the guest.
    
    Signed-off-by: Sergio Lopez <slp@redhat.com>
    Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Message-Id: <20230526112925.38794-4-slp@redhat.com>
    slp authored and elmarco committed May 28, 2023
    Copy the full SHA
    8e9ebd7 View commit details
    Browse the repository at this point in the history
  17. virtio-input-pci: add virtio-multitouch-pci

    Add virtio-multitouch-pci, a Multitouch-capable input device, to the
    list of devices that can be provided by virtio-input-pci.
    
    Signed-off-by: Sergio Lopez <slp@redhat.com>
    Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Message-Id: <20230526112925.38794-5-slp@redhat.com>
    slp authored and elmarco committed May 28, 2023
    Copy the full SHA
    4b2321c View commit details
    Browse the repository at this point in the history
  18. ui: add helpers for virtio-multitouch events

    Add helpers for generating Multi-touch events from the UI backends that
    can be sent to the guest through a virtio-multitouch device.
    
    Signed-off-by: Sergio Lopez <slp@redhat.com>
    Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Message-Id: <20230526112925.38794-6-slp@redhat.com>
    slp authored and elmarco committed May 28, 2023
    Copy the full SHA
    f615739 View commit details
    Browse the repository at this point in the history
  19. ui/gtk: enable backend to send multi-touch events

    GTK3 provides the infrastructure to receive and process multi-touch
    events through the "touch-event" signal and the GdkEventTouch type.
    Make use of it to transpose events from the host to the guest.
    
    This allows users of machines with hardware capable of receiving
    multi-touch events to run guests that can also receive those events
    and interpret them as gestures, when appropriate.
    
    An example of this in action can be seen here:
    
     https://fosstodon.org/@slp/109545849296546767
    
    Signed-off-by: Sergio Lopez <slp@redhat.com>
    Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
    Message-Id: <20230526112925.38794-7-slp@redhat.com>
    slp authored and elmarco committed May 28, 2023
    Copy the full SHA
    5a4cb61 View commit details
    Browse the repository at this point in the history

Commits on May 29, 2023

  1. Merge tag 'ui-pull-request' of https://gitlab.com/marcandre.lureau/qemu

    … into staging
    
    UI queue
    
    - virtio: add virtio-multitouch device
    - sdl: various keyboard grab fixes
    - gtk: enable multi-touch events
    - misc fixes
    
    # -----BEGIN PGP SIGNATURE-----
    #
    # iQJQBAABCAA6FiEEh6m9kz+HxgbSdvYt2ujhCXWWnOUFAmRzVQAcHG1hcmNhbmRy
    # ZS5sdXJlYXVAcmVkaGF0LmNvbQAKCRDa6OEJdZac5a34D/9+1I9XnecCQk4rZhHI
    # Fb1fUei4eLNOdxTZUK2zpOkArWf59VNsEa1LFqIiM+0IlWU3gQmrCLRFOuJrDxiA
    # ugq9H23QLs3Z7HEab6/aq+VwUy+o1AXowLZBTrEGmw9SZQnrKeu4/prW0f5wbsTf
    # u5ALDkJWo733vkbAplsfWPcOLzp3CoTvA89iw/I9eNVYsm6+vBJ+0cRBr0GCPmiJ
    # 2xprhGkie491clNlbR3HmOX/RGFmcj/ClPraLXepaQq1gNCqurIrU7V3J/JcY5W0
    # YemXDEgpZ8iVt1OOKGKzTftGZzuhRpxAYvSPwjAp1XeEXB7eJEmjUWoFpyVt1tQZ
    # 4y6pQGYdM2XW0sbAkt3w2TIgj/odv7L3IHG3UcsBRefl6Pm43G1FuGWjbulQ1ch0
    # YyFAr1xNPkWMYSW1MTb4vuTYFO9OEY08W4n+M6O187RUFiuf+W00OZUDqpp6zjqT
    # LKjMktilpUOya1LvWU3D5et9LEXFgSrZj9rQlFsuMe3g24ZNPLypQh/jzSFs9ZsW
    # At1nIGGrrZDr8YMFnANBudJbJc0Q1+ce5TB6090XSpNn/YXvu2H+n/ceA4/mA6sy
    # MlQBrDmifb9iY6+62MbW8wJtiIy8Zi7A632pw8gbqB0ilkg4DNSBR5O42n1Fmhqp
    # gLfxN48NN9Bx6H+zPJbwz2aDQQ==
    # =3bPI
    # -----END PGP SIGNATURE-----
    # gpg: Signature made Sun 28 May 2023 06:20:00 AM PDT
    # gpg:                using RSA key 87A9BD933F87C606D276F62DDAE8E10975969CE5
    # gpg:                issuer "marcandre.lureau@redhat.com"
    # gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>" [full]
    # gpg:                 aka "Marc-André Lureau <marcandre.lureau@gmail.com>" [full]
    
    * tag 'ui-pull-request' of https://gitlab.com/marcandre.lureau/qemu:
      ui/gtk: enable backend to send multi-touch events
      ui: add helpers for virtio-multitouch events
      virtio-input-pci: add virtio-multitouch-pci
      virtio-input: add a virtio-mulitouch device
      ui: add the infrastructure to support MT events
      virtio-input: generalize virtio_input_key_config()
      ui/cursor: make width/height unsigned 16-bit integer
      ui/sdl2: disable SDL_HINT_GRAB_KEYBOARD on Windows
      ui/sdl2: Grab Alt+F4 also under Windows
      ui/sdl2: Grab Alt+Tab also in fullscreen mode
      ui/dbus: add a FIXME about texture/dmabuf scanout handling
      gtk: add gl-area support on win32
      virtio-gpu: add a FIXME for virtio_gpu_load()
      win32: wrap socket close() with an exception handler
      ui/dbus: fix compilation when GBM && !OPENGL
      ui/sdl2: fix surface_gl_update_texture: Assertion 'gls' failed
      ui/gtk-egl: fix scaling for cursor position in scanout mode
      ui/gtk: use widget size for cursor motion event
      ui/gtk: fix passing y0_top parameter to scanout
    
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    rth7680 committed May 29, 2023
    Copy the full SHA
    57b93c0 View commit details
    Browse the repository at this point in the history