Received: from eggs.gnu.org ([2001:4830:134:3::10]:51032) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y9GZ1-0000Xs-Fd for qemu-devel@nongnu.org; Thu, 08 Jan 2015 12:08:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y9GYv-0004Kj-Oi for qemu-devel@nongnu.org; Thu, 08 Jan 2015 12:08:03 -0500 Received: from mail-qc0-x235.google.com ([2607:f8b0:400d:c01::235]:33649) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y9GYv-0004Jd-KR for qemu-devel@nongnu.org; Thu, 08 Jan 2015 12:07:57 -0500 Received: by mail-qc0-f181.google.com with SMTP id m20so3084172qcx.12 for ; Thu, 08 Jan 2015 09:07:56 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Programmingkid In-Reply-To: <1420707776.24470.15.camel@nilsson.home.kraxel.org> Date: Thu, 8 Jan 2015 12:07:52 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <07B03389-9719-42C2-A561-05347C36D947@gmail.com> References: <3154DC97-3B67-4DBF-BD02-C64E4A9591E3@gmail.com> <77FFD738-1433-4B15-8522-C1EA965B774B@gmail.com> <122C8E58-48F5-4A54-B0AF-A826492D73B6@gmail.com> <4A37A1CE-EE81-4408-A13E-8A4C7C91D498@gmail.com> <54AC45AE.5020804@redhat.com> <54AD0BDE.7020200@redhat.com> <1420641833.27381.39.camel@nilsson.home.kraxel.org> <67F5B5C0-41E1-4399-8A11-C3821394C31D@gmail.com> <1420707776.24470.15.camel@nilsson.home.kraxel.org> Subject: Re: [Qemu-devel] Gives user ability to select endian format for video display - fixes Mac OS X guest color issue. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: Paolo Bonzini , qemu-devel qemu-devel , Peter Maydell On Jan 8, 2015, at 4:02 AM, Gerd Hoffmann wrote: > Hi, >=20 >> VGA: Using shared surface for depth=3D32 swap=3D1 >=20 > Ok, 32bpp. byteswapping needed. >=20 > I guess the host is a intel macintosh then? Yes. I unfortunately don't have a fast enough PowerPC Mac to handle = QEMU. It would be interesting to find out if this color issue is on = PowerPC hosts.=20 >=20 > Having a quick look at the cocoa code it seems it doesn't look at the > color masks and shifts, only the color depth. So having the UI handle > the byteswapping that way isn't going to fly. >=20 > Try setting force_shadow (vga.c, needs git master) to one. That way > vga.c will byteswap and not expect the UI to do it. Alternatively = make > cocoa UI properly handle the color masks and shifts, so non-native > ordering works. Is this what you mean? s->force_shadow =3D 1; share_surface =3D (!s->force_shadow) && ( depth =3D=3D 32 || (depth =3D=3D 16 && !byteswap) ); I tried it out and didn't notice any change in colors for the Mac OS X = guest.=20 I do have an idea. What if on cocoa_update(DisplayChangeListener ...), = we find out the format of the framebuffer.=20 The DisplayChangeListener object has a QemuConsole object. The = QemuConsole object has a DisplaySurface object. The DisplaySurface = object has a pixman_format_code_t format variable. This format variable = tells us what format the framebuffer is in. So is it possible to use it? = The format types are listed in pixman.h. If it reports the correct format like BGR, then it would be possible to = automatically adjust the UI to display the correct colors. I am = currently attempting this, but accessing the format variable is not as = easy as I thought it would be. I think the code will look something like = this: dcl->con->surface->format.=20 > I have some patches from benh in the pipeline allowing to negotiate > supported formats for shared buffers, with that in place hard-coded > assumptions about what formats the UI code is able to handle will go > away. Guess I should rank them up in my priority list ;) Sounds interesting.=20 >=20 > cheers, > Gerd Thanks.=20=