From ec9fb41a9fad0c7e05b656ae55481a6bd28cab2f Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 6 Jun 2016 11:18:45 +0200 Subject: [PATCH 1/5] vnc: drop unused depth arg for set_pixel_format Spotted by Coverity. Cc: Paolo Bonzini Signed-off-by: Gerd Hoffmann Message-id: 1465204725-31562-1-git-send-email-kraxel@redhat.com --- ui/vnc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ui/vnc.c b/ui/vnc.c index c862fdcc9d..942cfb95ab 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -2115,8 +2115,7 @@ static void send_color_map(VncState *vs) } } -static void set_pixel_format(VncState *vs, - int bits_per_pixel, int depth, +static void set_pixel_format(VncState *vs, int bits_per_pixel, int big_endian_flag, int true_color_flag, int red_max, int green_max, int blue_max, int red_shift, int green_shift, int blue_shift) @@ -2124,7 +2123,6 @@ static void set_pixel_format(VncState *vs, if (!true_color_flag) { /* Expose a reasonable default 256 color map */ bits_per_pixel = 8; - depth = 8; red_max = 7; green_max = 7; blue_max = 3; @@ -2231,7 +2229,7 @@ static int protocol_client_msg(VncState *vs, uint8_t *data, size_t len) if (len == 1) return 20; - set_pixel_format(vs, read_u8(data, 4), read_u8(data, 5), + set_pixel_format(vs, read_u8(data, 4), read_u8(data, 6), read_u8(data, 7), read_u16(data, 8), read_u16(data, 10), read_u16(data, 12), read_u8(data, 14), From 83cf07b0b577bde1afe1329d25bbcc762966e637 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Wed, 8 Jun 2016 11:42:56 +0100 Subject: [PATCH 2/5] ui: fix regression in printing VNC host/port on startup If VNC is chosen as the compile time default display backend, QEMU will print the host/port it listens on at startup. Previously this would look like VNC server running on '::1:5900' but in 04d2529da27db512dcbd5e99d0e26d333f16efcc the ':' was accidentally replaced with a ';'. This the ':' back. Reported-by: Dr. David Alan Gilbert Signed-off-by: Daniel P. Berrange Reviewed-by: Eric Blake Message-id: 1465382576-25552-1-git-send-email-berrange@redhat.com Signed-off-by: Gerd Hoffmann --- ui/vnc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/vnc.c b/ui/vnc.c index 942cfb95ab..95e4db763b 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -3223,7 +3223,7 @@ char *vnc_display_local_addr(const char *id) qapi_free_SocketAddress(addr); return NULL; } - ret = g_strdup_printf("%s;%s", addr->u.inet.data->host, + ret = g_strdup_printf("%s:%s", addr->u.inet.data->host, addr->u.inet.data->port); qapi_free_SocketAddress(addr); From 4d5942332f42a17c9ebbf67ef335ec72fcd789ff Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Wed, 8 Jun 2016 21:43:52 +0000 Subject: [PATCH 3/5] gtk: fix vte version check vte_terminal_set_encoding takes 3 args since 0.38.0. This fixes commit fba958c6 ("gtk: implement set_echo") Signed-off-by: Olaf Hering Message-id: 20160608214352.32669-1-olaf@aepfle.de Signed-off-by: Gerd Hoffmann --- ui/gtk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/gtk.c b/ui/gtk.c index 01b821616e..58d20eed62 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -1748,7 +1748,7 @@ static GSList *gd_vc_vte_init(GtkDisplayState *s, VirtualConsole *vc, /* The documentation says that the default is UTF-8, but actually it is * 7-bit ASCII at least in VTE 0.38. */ -#if VTE_CHECK_VERSION(0, 40, 0) +#if VTE_CHECK_VERSION(0, 38, 0) vte_terminal_set_encoding(VTE_TERMINAL(vc->vte.terminal), "UTF-8", NULL); #else vte_terminal_set_encoding(VTE_TERMINAL(vc->vte.terminal), "UTF-8"); From 2c2311c5451f4555e85077285233884e66f9ea33 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Mon, 6 Jun 2016 22:01:01 +0200 Subject: [PATCH 4/5] ui/console-gl: Add support for big endian display surfaces This is required for running QEMU on big endian hosts (like PowerPC machines) that use RGB instead of BGR byte ordering. Ticket: https://bugs.launchpad.net/qemu/+bug/1581796 Signed-off-by: Thomas Huth Message-id: 1465243261-26731-1-git-send-email-thuth@redhat.com Signed-off-by: Gerd Hoffmann --- ui/console-gl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ui/console-gl.c b/ui/console-gl.c index 74b1bed6ee..5165e21646 100644 --- a/ui/console-gl.c +++ b/ui/console-gl.c @@ -88,6 +88,11 @@ void surface_gl_create_texture(ConsoleGLState *gls, surface->glformat = GL_BGRA_EXT; surface->gltype = GL_UNSIGNED_BYTE; break; + case PIXMAN_BE_x8r8g8b8: + case PIXMAN_BE_a8r8g8b8: + surface->glformat = GL_RGBA; + surface->gltype = GL_UNSIGNED_BYTE; + break; case PIXMAN_r5g6b5: surface->glformat = GL_RGB; surface->gltype = GL_UNSIGNED_SHORT_5_6_5; From 1185fde40c3ba02406665b9ee0743270c526be26 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Mon, 30 May 2016 10:41:13 +0200 Subject: [PATCH 5/5] console: ignore ui_info updates which don't actually update something Signed-off-by: Gerd Hoffmann Message-id: 1464597673-26464-1-git-send-email-kraxel@redhat.com --- ui/console.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ui/console.c b/ui/console.c index bf385790b5..ce1e10570f 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1453,16 +1453,21 @@ bool dpy_ui_info_supported(QemuConsole *con) int dpy_set_ui_info(QemuConsole *con, QemuUIInfo *info) { assert(con != NULL); - con->ui_info = *info; + if (!dpy_ui_info_supported(con)) { return -1; } + if (memcmp(&con->ui_info, info, sizeof(con->ui_info)) == 0) { + /* nothing changed -- ignore */ + return 0; + } /* * Typically we get a flood of these as the user resizes the window. * Wait until the dust has settled (one second without updates), then * go notify the guest. */ + con->ui_info = *info; timer_mod(con->ui_timer, qemu_clock_get_ms(QEMU_CLOCK_REALTIME) + 1000); return 0; }