Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Erjh7-0006bd-8y for qemu-devel@nongnu.org; Wed, 28 Dec 2005 17:22:53 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Erjh5-0006bN-Mu for qemu-devel@nongnu.org; Wed, 28 Dec 2005 17:22:52 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Erjh5-0006bJ-Ha for qemu-devel@nongnu.org; Wed, 28 Dec 2005 17:22:51 -0500 Received: from [82.183.137.225] (helo=1-1-5-8a.ehn.lk.bostream.se) by monty-python.gnu.org with esmtp (Exim 4.34) id 1ErjhK-0008Jb-5u for qemu-devel@nongnu.org; Wed, 28 Dec 2005 17:23:06 -0500 Received: from draken.lkp.se (henca@localhost [127.0.0.1]) by 1-1-5-8a.ehn.lk.bostream.se (8.11.4/8.11.4) with SMTP id jBSMLQ623643 for ; Wed, 28 Dec 2005 23:21:26 +0100 Date: Wed, 28 Dec 2005 23:21:25 +0100 From: Henrik Carlqvist Subject: Re: [Qemu-devel] How to submit a patch? Message-Id: <20051228232125.17d3e464.hc7@uthyres.com> In-Reply-To: <41e41e7a0512281242y3c79c0d9j6af3711c58809dbf@mail.gmail.com> References: <20051228204145.0cafb300.hc7@uthyres.com> <41e41e7a0512281242y3c79c0d9j6af3711c58809dbf@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org > i would suggest to you to re-submit an updated patch which which works > with cvs and includes full description. Please cc fabrice. Thanks for the advice! I'm sending an updated patch which works with 0.8.0 together with my old description. Which cvs server should I use to get access to the source from CVS? I don't cc Fabrice with this message as the code is untested with cvs source. regards Henrik -8<--------------------------------------------------- Most X servers I have seen have color masks something like this (from xdpyinfo): red, green, blue masks: 0xf800, 0x7e0, 0x1f However, Hummingbird eXceed which is an X server for Microsoft Windows instead looks something like this: red, green, blue masks: 0xff, 0xff00, 0xff0000 With such an X server connected to a Linux host qemu version 0.7.2 gives strange colors on screen as the red and blue components of colors gets mixed up. For example an MS Windows blue screen of death becomes a red screen of death instead. The SDL_SetVideoMode function call returns some information about how the color masks are ordered in the returned struct, and that data could be used to correctly render the colors by modifying files like console.c and vga.c. However, I found it easier to only call SDL_SetVideoMode again to find a bit depth which does not correspond to the actual bit depth of the X server. Then SDL gives a surface which has the color masks in the right order. My simple patch looks like this: -8<----------------------------------------------------------------- --- sdl.c.org 2005-12-28 23:09:32.000000000 +0100 +++ sdl.c 2005-12-28 23:16:06.000000000 +0100 @@ -49,6 +49,8 @@ static void sdl_resize(DisplayState *ds, int w, int h) { int flags; + int i=0; + int a[4]={0,32,16,0}; // printf("resizing to %d %d\n", w, h); @@ -57,11 +59,16 @@ flags |= SDL_FULLSCREEN; again: - screen = SDL_SetVideoMode(w, h, 0, flags); - if (!screen) { - fprintf(stderr, "Could not open SDL display\n"); - exit(1); - } + do + { + screen = SDL_SetVideoMode(w, h, a[i], flags); + if (!screen) { + fprintf(stderr, "Could not open SDL display\n"); + exit(1); + } + }while ( (screen->format->Rmask < screen->format->Bmask) && (++i < 4)); + /* Trying to find a screen which won't produce wrong colors */ + if (!screen->pixels && (flags & SDL_HWSURFACE) && (flags & SDL_FULLSCREEN)) { flags &= ~SDL_HWSURFACE; goto again; -8<----------------------------------------------------------------- -- NOTE: Dear Outlook users: Please remove me from your address books. Read this article and you know why: http://newsforge.com/article.pl?sid=03/08/21/143258