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 -0000 1.25
+++ sdl.c 11 Apr 2006 17:03:51 -0000
@@ -510,4 +510,9 @@
gui_fullscreen_initial_grab = 1;
sdl_grab_start();
}
+
+ /* guess to use BGR mode by seeing if the blue color mask is
greater than
+ * the red color mask, indicating that blue comes before red */
+ if (screen->format->Bmask > screen->format->Rmask)
+ bgr_display_enabled = 1;
}
combined with my prior bgr patch of course (bgr_display_enabled doesn't
exist otherwise.) If you think it's right, let me know, or post a
better one. Either way I can post an updated BGR patch with this hack.
You can still manually use -bgr if you want, or perhaps the meaning of
-bgr should be to enable this test. It may not be correct in all
circumstances. Maybe Paul Brook can weigh in too since he originally
suggested that this patch should determine this automatically.
Thanks,
Leo Reiter
malc wrote:
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 your assessment of
compile-time versus run-time options... I was merely suggesting a
compromise to fend off the minor performance hit of using the old
patch. But the method you suggested is much better and that's how
it's implemented now.
I maybe going out on a limb here, but isn't rgb/bgr trivially deducible
from: sdl.c:screen->format->[RGBA]shift.
--
Leonardo E. Reiter
Vice President of Product Development, CTO
Win4Lin, Inc.
Virtual Computing from Desktop to Data Center
Main: +1 512 339 7979
Fax: +1 512 532 6501
http://www.win4lin.com
_______________________________________________
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel