From 8bb6af6792f50a43807b152e1221e2ac9177f6c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Tue, 14 Feb 2023 19:15:09 +0400 Subject: ui/dbus: initialize cursor_fb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Or else, we may randomly destroy some textures.. Signed-off-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé --- include/ui/egl-helpers.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/ui/egl-helpers.h b/include/ui/egl-helpers.h index 2fb6e0d..c92dd90 100644 --- a/include/ui/egl-helpers.h +++ b/include/ui/egl-helpers.h @@ -22,6 +22,8 @@ typedef struct egl_fb { QemuDmaBuf *dmabuf; } egl_fb; +#define EGL_FB_INIT { 0, } + void egl_fb_destroy(egl_fb *fb); void egl_fb_setup_default(egl_fb *fb, int width, int height); void egl_fb_setup_for_tex(egl_fb *fb, int width, int height, -- cgit v1.1 From f4579e2899df552ea0c1e2f68447fd64b0c38836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Tue, 17 Jan 2023 15:07:02 +0400 Subject: ui: rename cursor_{put->unref} MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The naming is more conventional in QEMU. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé --- include/ui/console.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/ui/console.h b/include/ui/console.h index 1cb53ac..3efd1f6 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -152,7 +152,7 @@ typedef struct QEMUCursor { QEMUCursor *cursor_alloc(int width, int height); void cursor_get(QEMUCursor *c); -void cursor_put(QEMUCursor *c); +void cursor_unref(QEMUCursor *c); QEMUCursor *cursor_builtin_hidden(void); QEMUCursor *cursor_builtin_left_ptr(void); void cursor_print_ascii_art(QEMUCursor *c, const char *prefix); -- cgit v1.1 From 2512a026fab8d526e623426a3002599a2de09d16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Tue, 17 Jan 2023 15:10:13 +0400 Subject: ui: rename cursor_{get->ref}, return it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Daniel P. Berrangé --- include/ui/console.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/ui/console.h b/include/ui/console.h index 3efd1f6..0b01df9 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -151,7 +151,7 @@ typedef struct QEMUCursor { } QEMUCursor; QEMUCursor *cursor_alloc(int width, int height); -void cursor_get(QEMUCursor *c); +QEMUCursor *cursor_ref(QEMUCursor *c); void cursor_unref(QEMUCursor *c); QEMUCursor *cursor_builtin_hidden(void); QEMUCursor *cursor_builtin_left_ptr(void); -- cgit v1.1 From 385ac97f8fad0e6980c5dfea71132d5ecfb16608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Tue, 17 Jan 2023 15:24:40 +0400 Subject: ui: keep current cursor with QemuConsole MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Keeping the current cursor around is useful, not only for VNC, but for other displays. Let's move it down, see the following patches for other usages. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé --- include/ui/console.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/ui/console.h b/include/ui/console.h index 0b01df9..2a8fab0 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -459,6 +459,7 @@ QemuConsole *qemu_console_lookup_by_device(DeviceState *dev, uint32_t head); QemuConsole *qemu_console_lookup_by_device_name(const char *device_id, uint32_t head, Error **errp); QemuConsole *qemu_console_lookup_unused(void); +QEMUCursor *qemu_console_get_cursor(QemuConsole *con); bool qemu_console_is_visible(QemuConsole *con); bool qemu_console_is_graphic(QemuConsole *con); bool qemu_console_is_fixedsize(QemuConsole *con); -- cgit v1.1 From 0e1be59ed9b3b50aa7e66669e94aabdf0c3d80d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Tue, 14 Feb 2023 16:11:24 +0400 Subject: ui: introduce egl_init() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Future patches will introduce EGL support on win32 (too late for 8.0 though). Having a common place for EGL initialization and error handling will make it simpler. Signed-off-by: Marc-André Lureau Reviewed-by: Daniel P. Berrangé --- include/ui/egl-helpers.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/ui/egl-helpers.h b/include/ui/egl-helpers.h index c92dd90..53d953d 100644 --- a/include/ui/egl-helpers.h +++ b/include/ui/egl-helpers.h @@ -65,4 +65,6 @@ int qemu_egl_init_dpy_mesa(EGLNativeDisplayType dpy, DisplayGLMode mode); EGLContext qemu_egl_init_ctx(void); bool qemu_egl_has_dmabuf(void); +bool egl_init(const char *rendernode, DisplayGLMode mode, Error **errp); + #endif /* EGL_HELPERS_H */ -- cgit v1.1