Received: from eggs.gnu.org ([2001:4830:134:3::10]:52563) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAhXi-0003Pa-Rd for qemu-devel@nongnu.org; Mon, 12 Jan 2015 11:08:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YAhXb-0006Bo-Df for qemu-devel@nongnu.org; Mon, 12 Jan 2015 11:08:38 -0500 Received: from mail-qc0-x232.google.com ([2607:f8b0:400d:c01::232]:61574) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAhXb-0006Ba-7w for qemu-devel@nongnu.org; Mon, 12 Jan 2015 11:08:31 -0500 Received: by mail-qc0-f178.google.com with SMTP id p6so18707770qcv.9 for ; Mon, 12 Jan 2015 08:08:31 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: multipart/alternative; boundary=Apple-Mail-1-390076630 From: Programmingkid In-Reply-To: <54B3E419.1070408@redhat.com> Date: Mon, 12 Jan 2015 11:08:27 -0500 Message-Id: <487E71F5-6DA1-41F2-86D6-EF6DA0353A85@gmail.com> References: <3154DC97-3B67-4DBF-BD02-C64E4A9591E3@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> <07B03389-9719-42C2-A561-05347C36D947@gmail.com> <1420793910.24278.6.camel@nilsson.home.kraxel.org> <1F47539E-5ACE-4AFD-956B-266FAA04098D@gmail.com> <1421053976.8695.13.camel@nilsson.home.kraxel.org> <54B3E419.1070408@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2] 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: Paolo Bonzini Cc: Peter Maydell , Gerd Hoffmann , qemu-devel qemu-devel --Apple-Mail-1-390076630 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Jan 12, 2015, at 10:11 AM, Paolo Bonzini wrote: >=20 >=20 > On 12/01/2015 15:51, Programmingkid wrote: >>>>>> + /* Determines the pixel format of the frame buffer */ + >>>>>> if (surface->format =3D=3D PIXMAN_b8g8r8x8) { + >>>>>> bitmap_info =3D kCGBitmapByteOrder32Big | >>>>>> kCGImageAlphaNoneSkipFirst; + } >>>>=20 >>>> That certainly goes into the right direction. >> Thank you. >>=20 >>>> PIXMAN_* is native endian though, so I expect this will work on >>>> the intel macos host you are testing on but will fail on powerpc >>>> macos hosts. >> Unfortunately there appears to be no way to know. The last PowerPC >> Macs came out over 9 years ago. There probably isn't anyone on the >> list who uses one. >=20 > I have one, though it does not have enough memory to run Mac OS X > guests. In any case, pixman clearly says that b8g8r8x8 is BGRA in > host-endianness, so not the same as kCGBitmapByteOrder32Big. >=20 > So your patch just needs something like this in ui/cocoa.m: >=20 > #ifdef HOST_WORDS_BIGENDIAN > #define PIXMAN_BE_b8g8r8x8 PIXMAN_b8g8r8x8 > #else > #define PIXMAN_BE_b8g8r8x8 PIXMAN_x8r8g8b8 > #endif >=20 > so that you can replace PIXMAN_b8g8r8x8 with PIXMAN_BE_x8r8g8b8 in = your > test. (You'll also need a matching "else" that restores > kCGBitmapByteOrder32Little---if only for clarity: assuming = little-endian > in the initializer is ugly). >=20 > Paolo It doesn't look like my color patch is needed anymore. This repo fixes = all color problems - without touching a line of code in cocoa.m! =20 git://git.kraxel.org/qemu branch rebase/console-wip --Apple-Mail-1-390076630 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii


On 12/01/2015 15:51, Programmingkid = wrote:
+ =    /* Determines the pixel format of the frame buffer */ = +
if = (surface->format =3D=3D PIXMAN_b8g8r8x8) { = +
bitmap_info =3D kCGBitmapByteOrder32Big = |
kCGImageAlphaNoneSkipFirst; + =    }

That = certainly goes into the right = direction.
Thank you.

PIXMAN_* is native endian = though, so I expect this will work = on
the = intel macos host you are testing on but will fail on = powerpc
macos = hosts.
Unfortunately there appears to be no way to know. The last = PowerPC
Macs came out over 9 = years ago. There probably isn't anyone on = the
list who uses = one.

I have one, though it does not have enough = memory to run Mac OS X
guests.  In any case, pixman clearly says = that b8g8r8x8 is BGRA in
host-endianness, so not the same as = kCGBitmapByteOrder32Big.

So your patch just needs something like = this in ui/cocoa.m:

#ifdef HOST_WORDS_BIGENDIAN
#define = PIXMAN_BE_b8g8r8x8 =     PIXMAN_b8g8r8x8
#else
#define = PIXMAN_BE_b8g8r8x8 =     PIXMAN_x8r8g8b8
#endif

so that you can = replace PIXMAN_b8g8r8x8 with PIXMAN_BE_x8r8g8b8 in your
test. =  (You'll also need a matching "else" that = restores
kCGBitmapByteOrder32Little---if only for clarity: assuming = little-endian
in the initializer is = ugly).

Paolo

It = doesn't look like my color patch is needed anymore. This repo fixes all = color problems - without touching a line of code in cocoa.m! =  

git://git.kraxel.org/qemu bran= ch rebase/console-wip

= --Apple-Mail-1-390076630--