qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] [v2] Update cocoa.m to match new DisplayState code
Date: Mon, 26 Jan 2009 18:26:10 +0000	[thread overview]
Message-ID: <497E0042.6030808@eu.citrix.com> (raw)
In-Reply-To: <3097312F-7315-42BA-AF5D-4C026CD874FD@digitalescape.info>

Samuel Benson wrote:

> Version 2 does as follows:
> 
> [1]: Corrects endianness on issues by using native BGR to RGB conversion
> [2]: Uses DisplayState accessors for obtaining graphics context
> information, which
> [3]: Removes now unused variables, and
> [4]: Allows reading of varying color modes (32bit/24/16), and converting
> to native colorspace
> [5]: Attempts to keep itself centered on screen (as opposed to bottom
> right, which immediately
>      goes off screen after bios load) on context changes (window resizes)
> 
> Testing working on i386 (gentoo, Windows 2000) and PPC (debian) guests
> on PPC and x86 Macs.
> 
> In regards to [4], Windows 2000 displays fine on quick tests, but on the
> lowest setting
> I could test, 16bit color depth at 4bpp, colors are slightly off. I used
> gentoo
> install-x86-minimal-2008.0 in framebuffer mode to test above setting;
> the usual grey text is
> now blue, and Tux appears to be BGR shifted. I do not know if previous
> code worked at such
> a low color setting.
> 
> Signed-off-by: Samuel Benson <qemu_ml@digitalescape.info>





This patch looks fine to me: it uses the new interface the way it is
supposed to be used.

However if you are seeing some color problems you may still have few
bugs in the cocoa color conversion code.
To help you track them down, I'll explain a little bit more the pixel
formats that the graphic card exposes to cocoa, no matter what the host
endianness is:

- 24 bits depth, 32 bits per pixel (8888)
- 16 bits depth, 16 bits per pixel (565)

usually the pixel format is RGB, look at
console.c:qemu_default_pixelformat to have the details.
There is just one exception: if the guest endianness differs from the
host endianness and the guest native color depth is 24 bits with 32 bits
per pixels, then these masks are used instead:
console.c:qemu_different_endianness_pixelformat.
You'll probably never see this latter case in your tests, so you can
just ignore it for the moment.

Did you do the blue shifted Tux test on a ppc Mac? If so my guess is
that you have to call kCGImageAlphaNoneSkipLast instead of
kCGImageAlphaNoneSkipFirst because the format exposed by the graphic
card is already converted into big endian.

  parent reply	other threads:[~2009-01-26 18:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-25  8:23 [Qemu-devel] [PATCH] [v2] Update cocoa.m to match new DisplayState code Samuel Benson
     [not found] ` <2DDD067A-BDFD-4A05-9022-2FF16F4075C2@hotmail.com>
2009-01-25 22:15   ` C.W. Betts
2009-01-25 22:28     ` Samuel Benson
2009-01-25 22:30     ` Anthony Liguori
2009-01-26 11:05 ` Stefano Stabellini
2009-01-27  3:29   ` Samuel Benson
2009-01-27 10:47     ` Stefano Stabellini
2009-01-27 21:35       ` Samuel Benson
2009-01-28 10:47         ` Stefano Stabellini
2009-01-26 18:26 ` Stefano Stabellini
2009-01-26 18:26 ` Stefano Stabellini [this message]
2009-02-28 15:09 ` Andreas Färber
2009-03-02 11:33   ` Stefano Stabellini
2009-03-03 17:15 ` Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=497E0042.6030808@eu.citrix.com \
    --to=stefano.stabellini@eu.citrix.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).