From e2f82e924d057935dd4c61c0c53e11b15762eda2 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Wed, 27 Sep 2017 12:38:11 +0200 Subject: console: purge curses bits from console.h Handle the translation from vga chars to curses chars in curses_update() instead of console_write_ch(). Purge any curses support bits from ui/console.h include file. Signed-off-by: Gerd Hoffmann Message-id: 20170927103811.19249-1-kraxel@redhat.com --- include/ui/console.h | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) (limited to 'include') diff --git a/include/ui/console.h b/include/ui/console.h index 8024878..6966e4b 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -336,29 +336,10 @@ static inline pixman_format_code_t surface_format(DisplaySurface *s) return s->format; } -#ifdef CONFIG_CURSES -/* KEY_EVENT is defined in wincon.h and in curses.h. Avoid redefinition. */ -#undef KEY_EVENT -#include -#undef KEY_EVENT -typedef chtype console_ch_t; -extern chtype vga_to_curses[]; -#else -typedef unsigned long console_ch_t; -#endif +typedef uint32_t console_ch_t; + static inline void console_write_ch(console_ch_t *dest, uint32_t ch) { - uint8_t c = ch; -#ifdef CONFIG_CURSES - if (vga_to_curses[c]) { - ch &= ~(console_ch_t)0xff; - ch |= vga_to_curses[c]; - } -#else - if (c == '\0') { - ch |= ' '; - } -#endif *dest = ch; } -- cgit v1.1 From 74083f9c01910b1d36ddaca04db468eb326676ae Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Wed, 27 Sep 2017 13:50:31 +0200 Subject: egl: misc framebuffer helper improvements. Rename the functions to to say "setup" instead of "create" because they support being called multiple times on the same egl framebuffer. Properly delete unused textures, update function interfaces to support this. Signed-off-by: Gerd Hoffmann Message-id: 20170927115031.12063-1-kraxel@redhat.com --- include/ui/egl-helpers.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/ui/egl-helpers.h b/include/ui/egl-helpers.h index be89087..81cb255 100644 --- a/include/ui/egl-helpers.h +++ b/include/ui/egl-helpers.h @@ -18,8 +18,9 @@ typedef struct egl_fb { void egl_fb_destroy(egl_fb *fb); void egl_fb_setup_default(egl_fb *fb, int width, int height); -void egl_fb_create_for_tex(egl_fb *fb, int width, int height, GLuint texture); -void egl_fb_create_new_tex(egl_fb *fb, int width, int height); +void egl_fb_setup_for_tex(egl_fb *fb, int width, int height, + GLuint texture, bool delete); +void egl_fb_setup_new_tex(egl_fb *fb, int width, int height); void egl_fb_blit(egl_fb *dst, egl_fb *src, bool flip); void egl_fb_read(void *dst, egl_fb *src); -- cgit v1.1 From f4924974c7c72560f68ab298ac25a525a28a2124 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 26 Sep 2017 13:32:43 +0200 Subject: virtio-input: send rel-wheel events for wheel buttons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit qemu uses wheel-up/down button events for mouse wheel input, however linux applications typically want REL_WHEEL events. This fixes wheel with linux guests. Tested with X11/wayland, and windows virtio-input driver. Based on a patch from Marc. Added property to enable/disable wheel axis. Cc: Marc-André Lureau Signed-off-by: Gerd Hoffmann Message-id: 20170926113243.26081-1-kraxel@redhat.com --- include/hw/compat.h | 10 +++++++++- include/hw/virtio/virtio-input.h | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/hw/compat.h b/include/hw/compat.h index 9cc14dd..cf389b4 100644 --- a/include/hw/compat.h +++ b/include/hw/compat.h @@ -2,7 +2,15 @@ #define HW_COMPAT_H #define HW_COMPAT_2_10 \ - /* empty */ + {\ + .driver = "virtio-mouse-device",\ + .property = "wheel-axis",\ + .value = "false",\ + },{\ + .driver = "virtio-tablet-device",\ + .property = "wheel-axis",\ + .value = "false",\ + }, #define HW_COMPAT_2_9 \ {\ diff --git a/include/hw/virtio/virtio-input.h b/include/hw/virtio/virtio-input.h index 91df57e..054c388 100644 --- a/include/hw/virtio/virtio-input.h +++ b/include/hw/virtio/virtio-input.h @@ -89,6 +89,7 @@ struct VirtIOInputHID { QemuInputHandler *handler; QemuInputHandlerState *hs; int ledstate; + bool wheel_axis; }; struct VirtIOInputHost { -- cgit v1.1