qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2] Gives user ability to select endian format f


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v2] Gives user ability to select endian format for video display - fixes Mac OS X guest color issue.
Date: Mon, 12 Jan 2015 16:11:21 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0


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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]