From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LRWnE-0007Op-VZ for qemu-devel@nongnu.org; Mon, 26 Jan 2009 14:06:45 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LRWnD-0007My-5E for qemu-devel@nongnu.org; Mon, 26 Jan 2009 14:06:44 -0500 Received: from [199.232.76.173] (port=52121 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LRWnC-0007MA-PO for qemu-devel@nongnu.org; Mon, 26 Jan 2009 14:06:42 -0500 Received: from mx20.gnu.org ([199.232.41.8]:52086) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LRVEy-00056N-Kb for qemu-devel@nongnu.org; Mon, 26 Jan 2009 12:27:16 -0500 Received: from smtp.ctxuk.citrix.com ([62.200.22.115] helo=SMTP.EU.CITRIX.COM) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LRPXr-0000j1-V6 for qemu-devel@nongnu.org; Mon, 26 Jan 2009 06:22:24 -0500 Message-ID: <497D9B15.10900@eu.citrix.com> Date: Mon, 26 Jan 2009 11:14:29 +0000 From: Stefano Stabellini MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Update cocoa.m to match new DisplayState code References: <3A471E0D-F371-46C4-B0FB-A476D69845CD@digitalescape.info> <497B3574.3060802@eu.citrix.com> <1EA45CC4-0126-4CCC-B467-E528511C1E07@digitalescape.info> In-Reply-To: <1EA45CC4-0126-4CCC-B467-E528511C1E07@digitalescape.info> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Samuel Benson wrote: >> It would be better not to change the DisplayState surface from >> cocoa\sdl\vnc but try to render the format exposed by the emulated >> graphic card ourself. >> In fact in most cases the emulated vga exposes a 32bpp surface with >> linesize = width * 4, so you don't need to force it yourself. >> The only exception is the 16bpp case, but you should be able to render >> that as well without too many problems. > > The previous code forced this change, and as this code merely synced it > to the new structures, > I did not think anything to be wrong with it. If the structures come pre > initialized, > I'll remove these lines and see if it still works. The old DisplayState interface was supposed to be initialized by cocoa, then the emulated graphic card would do the conversion into the format requested by cocoa. The new DisplayState interface is initialized by the graphic card and cocoa is supposed to be able to render whatever format is exposed by the graphic card. The pixel formats actually exposed are very few, see my other mail. But from the second version of the patch I gather that you already understand how the new interface works. > The one section I did have trouble understanding was the DisplaySurface > flags; are those set > in regards to the host endianness or the guests? > QEMU_BIG_ENDIAN_FLAG refers to the host endianness. The guest video buffer is automatically converted into the host endianness if necessary, so you don't have to worry about it. You can always assume that the DisplayState surface has the same endianness as the host, as long as you repect the pixelformat ds->surface->pf (see my other mail and console.c:qemu_default_pixelformat).