From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37397) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAgeQ-00041R-VW for qemu-devel@nongnu.org; Mon, 12 Jan 2015 10:11:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YAgeL-0000rY-VS for qemu-devel@nongnu.org; Mon, 12 Jan 2015 10:11:30 -0500 Received: from mail-we0-x22c.google.com ([2a00:1450:400c:c03::22c]:57320) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YAgeL-0000rS-Oa for qemu-devel@nongnu.org; Mon, 12 Jan 2015 10:11:25 -0500 Received: by mail-we0-f172.google.com with SMTP id k11so19538498wes.3 for ; Mon, 12 Jan 2015 07:11:25 -0800 (PST) Sender: Paolo Bonzini Message-ID: <54B3E419.1070408@redhat.com> Date: Mon, 12 Jan 2015 16:11:21 +0100 From: Paolo Bonzini MIME-Version: 1.0 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> In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit 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: Programmingkid , Gerd Hoffmann Cc: Peter Maydell , qemu-devel qemu-devel On 12/01/2015 15:51, Programmingkid wrote: >>>>> + /* Determines the pixel format of the frame buffer */ + >>>>> if (surface->format == PIXMAN_b8g8r8x8) { + >>>>> bitmap_info = 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