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: Wed, 28 Jan 2009 10:47:35 +0000	[thread overview]
Message-ID: <498037C7.8010807@eu.citrix.com> (raw)
In-Reply-To: <55D6B519-C248-4AE1-B0E5-A9AB4FF45851@digitalescape.info>

Samuel Benson wrote:

> 
> On Jan 27, 2009, at 4:47 AM, Stefano Stabellini wrote:
> 
>> As I was telling you before, the guest in 16bpp is one of the "odd"
>> cases, because everything usually is converted into 32bpp.
>> It only happen when both host and guest are x86 because the 16bpp
>> optimization that the displaystate interface change introduced is only
>> enabled when guest and host have the same endianness.
> 
>> I think the way you specify bitsPerComponent may be incorrect in the
>> 16bpp case, because the format is actually 565:
>>
> 
> It was; since OS X is an RGBA system, it also assumes everything to be
> RGBA, so when I did the
> math for 16bpp, it comes out 4444. It turns out OSX not only assumes,
> but forces everything
> it does into RGBA; valid bits-per-component are forced into powers of 2.
> Also, according to
> CoreImage mail-list, OSX does not support RGB 565;  however it does
> support XRGB 1555.
> 
>> isn't there a way to provide the full color masks like with sdl?
>>
>> guest_screen = SDL_CreateRGBSurfaceFrom(ds_get_data(ds),
>> ds_get_width(ds), ds_get_height(ds),
>>                                            ds_get_bits_per_pixel(ds),
>> ds_get_linesize(ds),
>>                                            ds->surface->pf.rmask,
>> ds->surface->pf.gmask,
>>                                            ds->surface->pf.bmask,
>> ds->surface->pf.amask);
> 
> I spent a couple hours pouring thru the documentation, and being unable
> to find a similar
> function, I was forced to google. That's when I came across the above
> mentioned "answer".
> 
> Now, you stated that the 16bpp case only exists when both host and guest
> are x86; Is there a way
> I can trick it into thinking its a x86 guest on a ppc host so it would
> return the upconverted
> 32bpp? I'm assuming it would be just a toggle of the
> QEMU_BIG_ENDIAN_FLAG on the DisplaySurface.
> 
> The only other option I can think of is passing it thru some CoreVector
> Imaging constructs to
> try to convert it to XRGB and telling it to ignore the leading fake
> alpha bit.
> 




Maybe cocoa does not support RGB565 rendering but it has to provide a
way to convert preexiting RGB565 pictures into a format that it can
actually render.  Isn't there an image manipulation library, or
something like that?

Sorry for insisting on this but I would like to expoit all the other
possible options before adding hacks to the interface or removing the
16bpp shared video buffer.

Anyway if it is really not possible I could add something like:

---

diff --git a/hw/vga.c b/hw/vga.c
index 2084ff4..b742c78 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -1621,7 +1621,7 @@ static void vga_draw_graphic(VGAState *s, int full_update)
         disp_width != s->last_width ||
         height != s->last_height ||
         s->last_depth != depth) {
-#if defined(WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN)
+#if defined(WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN) && !defined(CONFIG_COCOA)
         if (depth == 16 || depth == 32) {
 #else
         if (depth == 32) {

---

this would prevent 16bpp to ever be expoed to cocoa, but you would still be
required of being able to render inverted ARGB8888, I mean the pixel
format specified by console.c:qemu_different_endianness_pixelformat in
32bpp case.
Do you think cocoa can do that?
You can try if that works using a Windows VM with stdvga in 32bpp (no 24bpp,
I really mean 32bpp) on a PPC host.

  reply	other threads:[~2009-01-28 10:55 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 [this message]
2009-01-26 18:26 ` Stefano Stabellini
2009-01-26 18:26 ` Stefano Stabellini
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=498037C7.8010807@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).