aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2009-08-23 18:00:33 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-08-27 21:23:38 -0500
commitd2bb9964d1c52ff73e75f7c081f631bf5effda08 (patch)
treefe5e0d5ec4abdab60433e552a13a8ec2122faeb9
parent1960cacfeb2ba02b794ac4c6d80d77203068be85 (diff)
downloadqemu-d2bb9964d1c52ff73e75f7c081f631bf5effda08.zip
qemu-d2bb9964d1c52ff73e75f7c081f631bf5effda08.tar.gz
qemu-d2bb9964d1c52ff73e75f7c081f631bf5effda08.tar.bz2
Use corect depth from DisplaySurface in vmware_vga.c
Hello, for what I can tell, there is no way for vmware_vga to work correctly right now. It assumes that the framebuffer bits-per-pixel and the one from the DisplaySurface are identical (it uses directly the VRAM from vga.c), but it always assumes 3 bytes per pixel, which is never possible with the current version of DisplaySurface. Attached patch fixes that by using ds_get_bits_per_pixel. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r--hw/vmware_vga.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c
index accdac4..d887c48 100644
--- a/hw/vmware_vga.c
+++ b/hw/vmware_vga.c
@@ -923,7 +923,7 @@ static void vmsvga_reset(struct vmsvga_state_s *s)
s->width = -1;
s->height = -1;
s->svgaid = SVGA_ID;
- s->depth = 24;
+ s->depth = ds_get_bits_per_pixel(s->vga.ds);
s->bypp = (s->depth + 7) >> 3;
s->cursor.on = 0;
s->redraw_fifo_first = 0;
@@ -1126,8 +1126,6 @@ static void vmsvga_init(struct vmsvga_state_s *s, int vga_ram_size)
s->scratch_size = SVGA_SCRATCH_SIZE;
s->scratch = (uint32_t *) qemu_malloc(s->scratch_size * 4);
- vmsvga_reset(s);
-
#ifdef EMBED_STDVGA
vga_common_init((VGAState *) s, vga_ram_size);
vga_init((VGAState *) s);
@@ -1142,6 +1140,8 @@ static void vmsvga_init(struct vmsvga_state_s *s, int vga_ram_size)
vmsvga_screen_dump,
vmsvga_text_update, &s->vga);
+ vmsvga_reset(s);
+
#ifdef CONFIG_BOCHS_VBE
/* XXX: use optimized standard vga accesses */
cpu_register_physical_memory(VBE_DISPI_LFB_PHYSICAL_ADDRESS,