From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MfGp1-0001Yd-9s for qemu-devel@nongnu.org; Sun, 23 Aug 2009 13:25:39 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MfGow-0001Vp-PH for qemu-devel@nongnu.org; Sun, 23 Aug 2009 13:25:38 -0400 Received: from [199.232.76.173] (port=48311 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MfGow-0001Vj-MJ for qemu-devel@nongnu.org; Sun, 23 Aug 2009 13:25:34 -0400 Received: from mail-fx0-f211.google.com ([209.85.220.211]:46836) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MfGow-0008Cs-8B for qemu-devel@nongnu.org; Sun, 23 Aug 2009 13:25:34 -0400 Received: by fxm7 with SMTP id 7so1314898fxm.34 for ; Sun, 23 Aug 2009 10:25:33 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20090817100828.GA22029@1und1.de> References: <20090817100828.GA22029@1und1.de> Date: Sun, 23 Aug 2009 19:25:32 +0200 Message-ID: Subject: Re: [Qemu-devel] [PATCH] use corect depth from DisplaySurface in vmware_vga.c From: andrzej zaborowski Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Reimar_D=C3=B6ffinger?= Cc: qemu-devel@nongnu.org 2009/8/17 Reimar D=C3=B6ffinger : > 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. It was discussed at some point earlier that at the time this code runs SDL is not initialised and the depth returned is an arbitrary value from default allocator. What vmware_vga really should do is ask SDL for the host's depth and set the surface's pixelformat to that. Unfortunately the ability to know host's pixel depth was dropped during video API conversion and afaik hasn't been added till now. The also arbitrary value of 24 bits was stuffed there for some reason but it seems to work for me. Cheers