From b1424e0381a7f1c9969079eca4458d5f20bf1859 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Wed, 20 Feb 2013 09:37:12 +0100 Subject: vga: fix byteswapping. In case host and guest endianness differ the vga code first creates a shared surface (using qemu_create_displaysurface_from), then goes patch the surface format to indicate that the bytes must be swapped. The switch to pixman broke that hack as the format patching isn't propagated into the pixman image, so ui code using the pixman image directly (such as vnc) uses the wrong format. Fix that by adding a byteswap parameter to qemu_create_displaysurface_from, so we'll use the correct format when creating the surface (and the pixman image) and don't have to patch the format afterwards. [ v2: unbreak xen build ] Cc: qemu-stable@nongnu.org Cc: mark.cave-ayland@ilande.co.uk Cc: agraf@suse.de Signed-off-by: Gerd Hoffmann Message-id: 1361349432-23884-1-git-send-email-kraxel@redhat.com Signed-off-by: Anthony Liguori --- include/ui/console.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/ui') diff --git a/include/ui/console.h b/include/ui/console.h index fc23baa06b..18012f1dc1 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -184,7 +184,8 @@ struct DisplayState { void register_displaystate(DisplayState *ds); DisplayState *get_displaystate(void); DisplaySurface* qemu_create_displaysurface_from(int width, int height, int bpp, - int linesize, uint8_t *data); + int linesize, uint8_t *data, + bool byteswap); PixelFormat qemu_different_endianness_pixelformat(int bpp); PixelFormat qemu_default_pixelformat(int bpp); -- cgit v1.2.3-55-g7522