UI: small fixes and improvements
-----BEGIN PGP SIGNATURE----- iQJQBAABCAA6FiEEh6m9kz+HxgbSdvYt2ujhCXWWnOUFAmZDZEAcHG1hcmNhbmRy ZS5sdXJlYXVAcmVkaGF0LmNvbQAKCRDa6OEJdZac5UxvD/9HWbB8JdbV8lNCLePT a6RUWSqLyP/cV0FCw9URYgAjAYROO966dZopCH7+Sz6goC8tk3IFUoqL0LbtZQjK zMNueGRbwJj0iGMxFG4wuWBpBF6Dzc4sh90TF3XWSE8PMpWsDY+sP3VRu4sP1qu7 OmCGTuSwNUugxazPLxvbTpLMnco9b+asAGlAU6WqpcURmia7XN7dBLGzfQ9vMxuc L5od+pPGfcxuj3ETMG+5OQlIZH1lmX3465LajkUDVxffNfznqMVDYyo4sKNW5KOY u420AoACeVsANWce1Aw2ekj1ETsvqxj23RClNIgdpDbMsGk9eM6eS+6vRctcM6z4 wMH6GAKKI3AWj7Q6qY4096bcdNmYD/GOs9dgswqYjf+JLzEVcI1dHQ36K124nKH0 t+9t3UUx1NBMwAp+EEN94W1ClwOZ0zvapS8zNaf76KIi9Eb4vrIyOlzdTM7SU4kC CQ4Tu9MBB5WIqzhsVtIH36zDBasgAU8DCtpelDY1AJiODGiQbfZi4yo8eEiQMS1s onixsXa7zyCCpmxwkYmvF54RbZFlPXxmdvu0jYxKddbEuTGX/Y3qvDAWv1kz6iJS iGmYtokfkv86XBCTGTAb3QEmFfOWcLnPc59Gg0TF3zyzY3q05nU/qjuIlgYedR/o TnnNYbyqXumojRCd69Dyy3THEg== =SW9v -----END PGP SIGNATURE----- Merge tag 'ui-pull-request' of https://gitlab.com/marcandre.lureau/qemu into staging UI: small fixes and improvements # -----BEGIN PGP SIGNATURE----- # # iQJQBAABCAA6FiEEh6m9kz+HxgbSdvYt2ujhCXWWnOUFAmZDZEAcHG1hcmNhbmRy # ZS5sdXJlYXVAcmVkaGF0LmNvbQAKCRDa6OEJdZac5UxvD/9HWbB8JdbV8lNCLePT # a6RUWSqLyP/cV0FCw9URYgAjAYROO966dZopCH7+Sz6goC8tk3IFUoqL0LbtZQjK # zMNueGRbwJj0iGMxFG4wuWBpBF6Dzc4sh90TF3XWSE8PMpWsDY+sP3VRu4sP1qu7 # OmCGTuSwNUugxazPLxvbTpLMnco9b+asAGlAU6WqpcURmia7XN7dBLGzfQ9vMxuc # L5od+pPGfcxuj3ETMG+5OQlIZH1lmX3465LajkUDVxffNfznqMVDYyo4sKNW5KOY # u420AoACeVsANWce1Aw2ekj1ETsvqxj23RClNIgdpDbMsGk9eM6eS+6vRctcM6z4 # wMH6GAKKI3AWj7Q6qY4096bcdNmYD/GOs9dgswqYjf+JLzEVcI1dHQ36K124nKH0 # t+9t3UUx1NBMwAp+EEN94W1ClwOZ0zvapS8zNaf76KIi9Eb4vrIyOlzdTM7SU4kC # CQ4Tu9MBB5WIqzhsVtIH36zDBasgAU8DCtpelDY1AJiODGiQbfZi4yo8eEiQMS1s # onixsXa7zyCCpmxwkYmvF54RbZFlPXxmdvu0jYxKddbEuTGX/Y3qvDAWv1kz6iJS # iGmYtokfkv86XBCTGTAb3QEmFfOWcLnPc59Gg0TF3zyzY3q05nU/qjuIlgYedR/o # TnnNYbyqXumojRCd69Dyy3THEg== # =SW9v # -----END PGP SIGNATURE----- # gpg: Signature made Tue 14 May 2024 03:16:48 PM CEST # 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/sdl2: Allow host to power down screen ui/gtk: Fix mouse/motion event scaling issue with GTK display backend ui/gtk: Add gd_motion_event trace event ui/console: move QemuDmaBuf struct def to dmabuf.c ui/console: Use qemu_dmabuf_new() and free() helpers instead ui/console: Use qemu_dmabuf_set_..() helpers instead ui/console: Use qemu_dmabuf_get_..() helpers instead ui/console: new dmabuf.h and dmabuf.c for QemuDmaBuf struct and helpers ui/gtk: Check if fence_fd is equal to or greater than 0 ui/gtk: Draw guest frame at refresh cycle Allow UNIX socket option for VNC websocket Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
commit
265aad58e9
22 changed files with 554 additions and 210 deletions
|
|
@ -148,7 +148,7 @@ typedef struct VFIOGroup {
|
|||
} VFIOGroup;
|
||||
|
||||
typedef struct VFIODMABuf {
|
||||
QemuDmaBuf buf;
|
||||
QemuDmaBuf *buf;
|
||||
uint32_t pos_x, pos_y, pos_updates;
|
||||
uint32_t hot_x, hot_y, hot_updates;
|
||||
int dmabuf_id;
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ struct VirtIOGPUBaseClass {
|
|||
DEFINE_PROP_UINT32("yres", _state, _conf.yres, 800)
|
||||
|
||||
typedef struct VGPUDMABuf {
|
||||
QemuDmaBuf buf;
|
||||
QemuDmaBuf *buf;
|
||||
uint32_t scanout_id;
|
||||
QTAILQ_ENTRY(VGPUDMABuf) next;
|
||||
} VGPUDMABuf;
|
||||
|
|
@ -238,7 +238,7 @@ struct VhostUserGPU {
|
|||
VhostUserBackend *vhost;
|
||||
int vhost_gpu_fd; /* closed by the chardev */
|
||||
CharBackend vhost_chr;
|
||||
QemuDmaBuf dmabuf[VIRTIO_GPU_MAX_SCANOUTS];
|
||||
QemuDmaBuf *dmabuf[VIRTIO_GPU_MAX_SCANOUTS];
|
||||
bool backend_blocked;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
#include "qapi/qapi-types-ui.h"
|
||||
#include "ui/input.h"
|
||||
#include "ui/surface.h"
|
||||
#include "ui/dmabuf.h"
|
||||
|
||||
#define TYPE_QEMU_CONSOLE "qemu-console"
|
||||
OBJECT_DECLARE_TYPE(QemuConsole, QemuConsoleClass, QEMU_CONSOLE)
|
||||
|
|
@ -185,25 +186,6 @@ struct QEMUGLParams {
|
|||
int minor_ver;
|
||||
};
|
||||
|
||||
typedef struct QemuDmaBuf {
|
||||
int fd;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
uint32_t stride;
|
||||
uint32_t fourcc;
|
||||
uint64_t modifier;
|
||||
uint32_t texture;
|
||||
uint32_t x;
|
||||
uint32_t y;
|
||||
uint32_t backing_width;
|
||||
uint32_t backing_height;
|
||||
bool y0_top;
|
||||
void *sync;
|
||||
int fence_fd;
|
||||
bool allow_fences;
|
||||
bool draw_submitted;
|
||||
} QemuDmaBuf;
|
||||
|
||||
enum display_scanout {
|
||||
SCANOUT_NONE,
|
||||
SCANOUT_SURFACE,
|
||||
|
|
|
|||
49
include/ui/dmabuf.h
Normal file
49
include/ui/dmabuf.h
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*
|
||||
* QemuDmaBuf struct and helpers used for accessing its data
|
||||
*
|
||||
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
||||
* See the COPYING file in the top-level directory.
|
||||
*/
|
||||
|
||||
#ifndef DMABUF_H
|
||||
#define DMABUF_H
|
||||
|
||||
typedef struct QemuDmaBuf QemuDmaBuf;
|
||||
|
||||
QemuDmaBuf *qemu_dmabuf_new(uint32_t width, uint32_t height,
|
||||
uint32_t stride, uint32_t x,
|
||||
uint32_t y, uint32_t backing_width,
|
||||
uint32_t backing_height, uint32_t fourcc,
|
||||
uint64_t modifier, int dmabuf_fd,
|
||||
bool allow_fences, bool y0_top);
|
||||
void qemu_dmabuf_free(QemuDmaBuf *dmabuf);
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(QemuDmaBuf, qemu_dmabuf_free);
|
||||
|
||||
int qemu_dmabuf_get_fd(QemuDmaBuf *dmabuf);
|
||||
int qemu_dmabuf_dup_fd(QemuDmaBuf *dmabuf);
|
||||
void qemu_dmabuf_close(QemuDmaBuf *dmabuf);
|
||||
uint32_t qemu_dmabuf_get_width(QemuDmaBuf *dmabuf);
|
||||
uint32_t qemu_dmabuf_get_height(QemuDmaBuf *dmabuf);
|
||||
uint32_t qemu_dmabuf_get_stride(QemuDmaBuf *dmabuf);
|
||||
uint32_t qemu_dmabuf_get_fourcc(QemuDmaBuf *dmabuf);
|
||||
uint64_t qemu_dmabuf_get_modifier(QemuDmaBuf *dmabuf);
|
||||
uint32_t qemu_dmabuf_get_texture(QemuDmaBuf *dmabuf);
|
||||
uint32_t qemu_dmabuf_get_x(QemuDmaBuf *dmabuf);
|
||||
uint32_t qemu_dmabuf_get_y(QemuDmaBuf *dmabuf);
|
||||
uint32_t qemu_dmabuf_get_backing_width(QemuDmaBuf *dmabuf);
|
||||
uint32_t qemu_dmabuf_get_backing_height(QemuDmaBuf *dmabuf);
|
||||
bool qemu_dmabuf_get_y0_top(QemuDmaBuf *dmabuf);
|
||||
void *qemu_dmabuf_get_sync(QemuDmaBuf *dmabuf);
|
||||
int32_t qemu_dmabuf_get_fence_fd(QemuDmaBuf *dmabuf);
|
||||
bool qemu_dmabuf_get_allow_fences(QemuDmaBuf *dmabuf);
|
||||
bool qemu_dmabuf_get_draw_submitted(QemuDmaBuf *dmabuf);
|
||||
void qemu_dmabuf_set_texture(QemuDmaBuf *dmabuf, uint32_t texture);
|
||||
void qemu_dmabuf_set_fence_fd(QemuDmaBuf *dmabuf, int32_t fence_fd);
|
||||
void qemu_dmabuf_set_sync(QemuDmaBuf *dmabuf, void *sync);
|
||||
void qemu_dmabuf_set_draw_submitted(QemuDmaBuf *dmabuf, bool draw_submitted);
|
||||
void qemu_dmabuf_set_fd(QemuDmaBuf *dmabuf, int32_t fd);
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue