qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [6336] DisplayState interface change (Stefano Stabellin


From: malc
Subject: Re: [Qemu-devel] [6336] DisplayState interface change (Stefano Stabellini)
Date: Thu, 22 Jan 2009 01:03:22 +0300 (MSK)

On Wed, 21 Jan 2009, Stefano Stabellini wrote:

malc wrote:


This breaks truecolor display for both sdl and vnc on big-endian
hosts.



I hope that "breaks" in this case means "the colors are wrong".

Yes.


I think I just need to change console.c:qemu_default_pixelformat to
correctly handle big-endian hosts, the fix should be simple but it will
be really difficult for me to test.

If it will help any, following brings the colors back to normal for vnc:

diff --git a/vnc.c b/vnc.c
index 17ea9a2..2096a7a 100644
--- a/vnc.c
+++ b/vnc.c
@@ -1283,7 +1283,7 @@ static void set_pixel_format(VncState *vs,
     vs->clientds.pf.bits_per_pixel = bits_per_pixel;
     vs->clientds.pf.bytes_per_pixel = bits_per_pixel / 8;
     vs->clientds.pf.depth = bits_per_pixel == 32 ? 24 : bits_per_pixel;
-    vs->clientds.flags = big_endian_flag ? QEMU_BIG_ENDIAN_FLAG : 0x00;
+    vs->clientds.flags = 0;

     set_pixel_conversion(vs);


P.S. In console.c you have this:
    if (surface->flags & QEMU_ALLOCATED_FLAG)
        surface->data = (uint8_t*) qemu_realloc(surface->data, surface->linesize * 
surface->height);
    else
        surface->data = (uint8_t*) qemu_malloc(surface->linesize * 
surface->height);

    Why? Have reservations that qemu_realloc might break the realloc contract
    (of being the same as malloc in case of NULL ptr)? Also the casts are 
unnecessary.

--
mailto:address@hidden




reply via email to

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