From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MfjE3-0005Xp-PX for qemu-devel@nongnu.org; Mon, 24 Aug 2009 19:45:23 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MfjDy-0005Ww-62 for qemu-devel@nongnu.org; Mon, 24 Aug 2009 19:45:22 -0400 Received: from [199.232.76.173] (port=42499 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MfjDx-0005Wt-Vr for qemu-devel@nongnu.org; Mon, 24 Aug 2009 19:45:18 -0400 Received: from mail-bw0-f227.google.com ([209.85.218.227]:41074) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MfjDx-0002WM-JH for qemu-devel@nongnu.org; Mon, 24 Aug 2009 19:45:17 -0400 Received: by bwz27 with SMTP id 27so1989704bwz.34 for ; Mon, 24 Aug 2009 16:45:15 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20090824132229.GB24730@1und1.de> References: <20090817100828.GA22029@1und1.de> <20090824132229.GB24730@1und1.de> Date: Tue, 25 Aug 2009 01:45:15 +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: qemu-devel@nongnu.org 2009/8/24 Reimar D=C3=B6ffinger : > On Sun, Aug 23, 2009 at 07:25:32PM +0200, andrzej zaborowski wrote: >> 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. > > It is not arbitrary. It matches exactly the DisplaySurface's > linesize and data buffer size. Only at the moment the function is called. The value is still hardcoded, just elsewhere. Once display backend initialises this value may be invalid. > As such, I want to add that the revert commit message of "was > incorrect." doesn't qualify as useful to me. I wasn't intending to push this commit, instead I responded to the thread but later noticed I had pushed it. > >> What vmware_vga really should do is ask SDL >> for the host's depth and set the surface's pixelformat to that. > > Obvious question: why shouldn't SDL ask the VGA for its depth and try > to use a surface with that format? It should, the VGA should create the surface using qemu_create_displaysurface... like in vga.c. But, this depth is not set by the guest, it should match the host's depth because this is how the vmware's "specification" (if you can call it that) defines it. Beside that it's an obvious performance gain. The API change did not magically remove the pixel by pixel conversion of the colour space, it just hid it in SDL, under more indirection. > Has the advantage that the depth > of the emulated stuff stays the same, whereas with your suggestion > if I tried a loadvm from a savevm of your machine qemu would get > in a bit in trouble. I'm not sure I understand this sentence, but apparently there's some way vmware can communicate to the guest that the bit depth has changed. This is not implemented in vmware_vga.c yet. Similarly when the window is resized, instead of zooming we could communicate the resolution change to the guest, but it's not implemented yet. Cheers