Re: [Qemu-devel] Updated BGR vs. RGB vga patch...

2006-04-11 Thread Leonardo E. Reiter
By the way, I did verify that the patch works correctly in B/G/R 5/6/5 mode - I wasn't sure about 16-bit BGR before. However, in 16-bit mode, only -std-vga works correctly if the X server is in BGR mode. In 24-bit BGR mode, cirrus has no problem. I think there is some 16-bit trickery going

Re: [Qemu-devel] Updated BGR vs. RGB vga patch...

2006-04-11 Thread Leonardo E. Reiter
How's this: Index: sdl.c === RCS file: /cvsroot/qemu/qemu/sdl.c,v retrieving revision 1.25 diff -a -u -r1.25 sdl.c --- sdl.c 9 Apr 2006 01:06:34 - 1.25 +++ sdl.c 11 Apr 2006 17:03:51 - @@ -510,4 +510,9 @@

[Qemu-devel] Updated BGR vs. RGB vga patch...

2006-04-10 Thread Leonardo E. Reiter
Hello, attached is an updated version (against today's CVS) of a patch to enable B/G/R color encoding rather than R/G/B with the command-line option -bgr. I found the original here (post by Martin Bochnig): http://lists.nongnu.org/archive/html/qemu-devel/2005-09/msg00059.html It's main

Re: [Qemu-devel] Updated BGR vs. RGB vga patch...

2006-04-10 Thread Paul Brook
On Monday 10 April 2006 17:25, Leonardo E. Reiter wrote: Hello, attached is an updated version (against today's CVS) of a patch to enable B/G/R color encoding rather than R/G/B with the command-line option -bgr. I found the original here (post by Martin Bochnig): Shouldn't we be able to

Re: [Qemu-devel] Updated BGR vs. RGB vga patch...

2006-04-10 Thread Leonardo E. Reiter
You can definitely figure it out by asking the X server or SDL. I don't know enough SDL to have hacked it in myself. X is pretty simple on the other hand. As for where to add it, I agree that the low level conversions are not a great place to add this. I didn't originate the patch, I just

Re: [Qemu-devel] Updated BGR vs. RGB vga patch...

2006-04-10 Thread Leonardo E. Reiter
Actually it should probably be made conditionally compiled for now, until the VGA architecture changes to something more efficient. Would you agree with that? That way, people who know they will need the hack can enable it at configure/compile time, and the rest will not be affected. How

Re: [Qemu-devel] Updated BGR vs. RGB vga patch...

2006-04-10 Thread Paul Brook
Unfortunately X11 will not allow you to force a certain color order in 24-bit mode. You can tell it to force byte-order but this only affects 16-bit blits - it's ignored for 24-bit since the individual components of the 24-bit blits, even if packed into 32-bits, are still 8-bits long.

Re: [Qemu-devel] Updated BGR vs. RGB vga patch...

2006-04-10 Thread Leonardo E. Reiter
Okay, that makes perfect sense. Let me see if I can figure out how to get SDL to report the ordering, and I'll try to roll it out that way. thanks for clarifying, - Leo Reiter Paul Brook wrote: Unfortunately X11 will not allow you to force a certain color order in 24-bit mode. You can tell

Re: [Qemu-devel] Updated BGR vs. RGB vga patch...

2006-04-10 Thread Paul Brook
On Monday 10 April 2006 17:44, Leonardo E. Reiter wrote: Actually it should probably be made conditionally compiled for now, until the VGA architecture changes to something more efficient. Would you agree with that? That way, people who know they will need the hack can enable it at

Re: [Qemu-devel] Updated BGR vs. RGB vga patch...

2006-04-10 Thread Leonardo E. Reiter
I was talking about enabling the use of the -bgr flag at compile time, to save the check at runtime if the user doesn't even care about the flag, not forcing the determination of the blit order altogether at compile-time. In any case, this is moot, your clarification on how to better

Re: [Qemu-devel] Updated BGR vs. RGB vga patch...

2006-04-10 Thread Paul Brook
On Monday 10 April 2006 17:51, Leonardo E. Reiter wrote: I was talking about enabling the use of the -bgr flag at compile time, to save the check at runtime if the user doesn't even care about the flag, not forcing the determination of the blit order altogether at compile-time. In any case,

Re: [Qemu-devel] Updated BGR vs. RGB vga patch...

2006-04-10 Thread Leonardo E. Reiter
Here's a better patch... I can't seem to validate BGR X servers in 15 or 16-bit mode. This may not make sense (or be prevalent) on little-endian machines anyway (I'm using VNC server on a little endian box to test against.) In any case, 24 and 32-bit works like a charm. I use the same basic

Re: [Qemu-devel] Updated BGR vs. RGB vga patch...

2006-04-10 Thread Leonardo E. Reiter
Here's a better patch (attached this time!)... I can't seem to validate BGR X servers in 15 or 16-bit mode. This may not make sense (or be prevalent) on little-endian machines anyway (I'm using VNC server on a little endian box to test against.) In any case, 24 and 32-bit works like a charm.

Re: [Qemu-devel] Updated BGR vs. RGB vga patch...

2006-04-10 Thread malc
On Mon, 10 Apr 2006, Leonardo E. Reiter wrote: Anyway, I didn't spend time figuring out how to query SDL for the ordering. You still have to manually pass in -bgr. The good news is that all the computation is now done at compile-time, with only very few tests done at run-time. I agree with

Re: [Qemu-devel] Updated BGR vs. RGB vga patch...

2006-04-10 Thread Leonardo E. Reiter
Probably... I just don't know anything about SDL and I needed this patch to work right away with at least the command-line option. It's definitely deducible from X11, and that's very easy. - Leo Reiter malc wrote: On Mon, 10 Apr 2006, Leonardo E. Reiter wrote: Anyway, I didn't spend time