qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Gives user ability to select endian format for video di


From: Programmingkid
Subject: Re: [Qemu-devel] Gives user ability to select endian format for video display - fixes Mac OS X guest color issue.
Date: Fri, 9 Jan 2015 10:11:33 -0500

On Jan 9, 2015, at 3:58 AM, Gerd Hoffmann wrote:

> On Do, 2015-01-08 at 12:07 -0500, Programmingkid wrote:
>> On Jan 8, 2015, at 4:02 AM, Gerd Hoffmann wrote:
>> 
>>> Hi,
>>> 
>>>> VGA: Using shared surface for depth=32 swap=1
>>> 
>>> Ok, 32bpp.  byteswapping needed.
>>> 
>>> I guess the host is a intel macintosh then?
>> 
>> Yes.
> 
> So we have be guest @ le host.
> 
>> 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. 
> 
> Indeed.
> 
>> Is this what you mean?
>> s->force_shadow = 1;
>>    share_surface = (!s->force_shadow) &&
>>            ( depth == 32 || (depth == 16 && !byteswap) );
> 
> Yes.
> 
>> I tried it out and didn't notice any change in colors for the Mac OS X 
>> guest. 
> 
> Hmm, strange.

I had done a bunch of changes to the code, so the data I gave you is probably 
inaccurate.  Please discard it. 

> 
> Can you test
>   https://www.kraxel.org/cgit/qemu/log/?h=rebase/console-wip ?

Ok. I will put it on my to do list. 

> 
>> I do have an idea. What if on cocoa_update(DisplayChangeListener ...),
>> we find out the format of the framebuffer. 
>> 
>> 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.
> 
> Better place is probably switchSurface, so you have to look only once
> for every surface, not on every display update.
> 
> Just look at surface->format.

Great idea. Looks like I have solved the Mac OS X guest color problem. This 
code in cocoa_switch() does the trick:

/* Determines the pixel format of the frame buffer */
    if (surface->format == PIXMAN_b8g8r8x8) {
        bitmap_info = kCGBitmapByteOrder32Big | kCGImageAlphaNoneSkipFirst;
    }

I was tempted to just see if the bit depth was 32, then just set bitmap_info to 
the above value. Doubtful such a patch would have been accepted. 


reply via email to

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