diff options
| author | Peter Maydell <peter.maydell@linaro.org> | 2014-12-17 19:22:41 +0000 |
|---|---|---|
| committer | Peter Maydell <peter.maydell@linaro.org> | 2014-12-17 19:22:42 +0000 |
| commit | b574f602680d41c4cf4a9c106e3e2244bed01cdd (patch) | |
| tree | 937dc4627f8a1a5be739cdbf69cc21c3eae05172 /hw/display/vga.c | |
| parent | 86b182ac0e0b44726d85598cbefb468ed22517fc (diff) | |
| parent | 46817e86fc1d97af0a7d9e4060730f7b00183083 (diff) | |
| download | focaccia-qemu-b574f602680d41c4cf4a9c106e3e2244bed01cdd.tar.gz focaccia-qemu-b574f602680d41c4cf4a9c106e3e2244bed01cdd.zip | |
Merge remote-tracking branch 'remotes/kraxel/tags/pull-vga-20141216-1' into staging
cirrus hwcursor fixes. set secondary-vga category. # gpg: Signature made Tue 16 Dec 2014 14:44:09 GMT using RSA key ID D3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" * remotes/kraxel/tags/pull-vga-20141216-1: vga: set catagory bit for secondary vga device move hw cursor pos from cirrus to vga cirrus: Force use of shadow pixmap when HW cursor is enabled vga: Add mechanism to force the use of a shadow surface Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/display/vga.c')
| -rw-r--r-- | hw/display/vga.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/hw/display/vga.c b/hw/display/vga.c index 52eaf05659..a620c07864 100644 --- a/hw/display/vga.c +++ b/hw/display/vga.c @@ -1436,6 +1436,7 @@ static void vga_draw_graphic(VGACommonState *s, int full_update) uint8_t *d; uint32_t v, addr1, addr; vga_draw_line_func *vga_draw_line = NULL; + bool share_surface; #ifdef HOST_WORDS_BIGENDIAN bool byteswap = !s->big_endian_fb; #else @@ -1479,21 +1480,33 @@ static void vga_draw_graphic(VGACommonState *s, int full_update) } depth = s->get_bpp(s); + + share_surface = (!s->force_shadow) && + ( depth == 32 || (depth == 16 && !byteswap) ); if (s->line_offset != s->last_line_offset || disp_width != s->last_width || height != s->last_height || s->last_depth != depth || - s->last_byteswap != byteswap) { - if (depth == 32 || (depth == 16 && !byteswap)) { + s->last_byteswap != byteswap || + share_surface != is_buffer_shared(surface)) { + if (share_surface) { pixman_format_code_t format = qemu_default_pixman_format(depth, !byteswap); surface = qemu_create_displaysurface_from(disp_width, height, format, s->line_offset, s->vram_ptr + (s->start_addr * 4)); dpy_gfx_replace_surface(s->con, surface); +#ifdef DEBUG_VGA + printf("VGA: Using shared surface for depth=%d swap=%d\n", + depth, byteswap); +#endif } else { qemu_console_resize(s->con, disp_width, height); surface = qemu_console_surface(s->con); +#ifdef DEBUG_VGA + printf("VGA: Using shadow surface for depth=%d swap=%d\n", + depth, byteswap); +#endif } s->last_scr_width = disp_width; s->last_scr_height = height; |