From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mcz8p-0001AB-7q for qemu-devel@nongnu.org; Mon, 17 Aug 2009 06:08:39 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mcz8i-0000yu-7Y for qemu-devel@nongnu.org; Mon, 17 Aug 2009 06:08:36 -0400 Received: from [199.232.76.173] (port=50097 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mcz8i-0000yP-0s for qemu-devel@nongnu.org; Mon, 17 Aug 2009 06:08:32 -0400 Received: from mail.gmx.net ([213.165.64.20]:40243) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1Mcz8h-0006ia-CR for qemu-devel@nongnu.org; Mon, 17 Aug 2009 06:08:31 -0400 Date: Mon, 17 Aug 2009 12:08:28 +0200 From: Reimar =?iso-8859-1?Q?D=F6ffinger?= Message-ID: <20090817100828.GA22029@1und1.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="a8Wt8u1KmwUX3Y2C" Content-Disposition: inline Subject: [Qemu-devel] [PATCH] use corect depth from DisplaySurface in vmware_vga.c List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --a8Wt8u1KmwUX3Y2C Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline 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. Note that this further breaks the already broken compilation if you use #undef EMBED_STDVGA (maybe it is time to throw away all that broken code??). --a8Wt8u1KmwUX3Y2C Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: attachment; filename="vmware_depth.diff" diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c index 5ceebf1..23d5fc8 100644 --- a/hw/vmware_vga.c +++ b/hw/vmware_vga.c @@ -923,7 +927,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 +1130,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 +1144,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, --a8Wt8u1KmwUX3Y2C--