From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FG1z8-0007Mk-Hr for qemu-devel@nongnu.org; Sun, 05 Mar 2006 17:45:54 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FG1z4-00074x-Ut for qemu-devel@nongnu.org; Sun, 05 Mar 2006 17:45:53 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FG1z4-00074d-Md for qemu-devel@nongnu.org; Sun, 05 Mar 2006 17:45:50 -0500 Received: from [70.116.13.229] (helo=localhost.localdomain) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FG21B-0006Ms-QT for qemu-devel@nongnu.org; Sun, 05 Mar 2006 17:48:02 -0500 Received: from [192.168.1.102] (helo=[192.168.1.102]) by localhost.localdomain with esmtp (Exim 4.52) id 1FG1yG-00051y-MC for qemu-devel@nongnu.org; Sun, 05 Mar 2006 16:45:01 -0600 Message-ID: <440B69F3.1070801@codemonkey.ws> Date: Sun, 05 Mar 2006 16:45:07 -0600 From: Anthony Liguori MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------070503010309070501020000" Subject: [Qemu-devel] [PATCH] Use opaque alpha channel to support Xgl 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 This is a multi-part message in MIME format. --------------070503010309070501020000 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Xgl introduces a new pixel format that's a 32 bit depth with a true alpha channel. When we let SDL choose a depth on an Xgl server, it picks up this format (as it's the native pixel format in Xgl). We don't fill out the alpha channel which results in a completely transparent screen. This patch fills out the alpha channel to all 1s for 32 bit pixels. I'm not sure if this handles every case where a pixel is generated but it seems to work on all of my VMs. I really don't like this patch as it seems like a hack but I couldn't figure out a way to differentiate in SDL between a 24-bit depth with a 32-bit pixel width (which is a common, non-alpha format) and a true 32 bit depth with an alpha channel. Hopefully, this will be fixed in future versions of SDL. Regards, Anthony Liguori --------------070503010309070501020000 Content-Type: text/plain; name="qemu-xgl.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="qemu-xgl.diff" # HG changeset patch # User Anthony Liguori # Node ID 9ad5f865d44bf962f0ed9ca712e9ce2d8a4d46dd # Parent 945c27df128e8b5b1f43f1b3ddcb77c887c51f4d Xgl introduces a new surface type that's 32-bit with a true alpha channel. Make sure that we return pixels with opaque alpha channels. diff -r 945c27df128e -r 9ad5f865d44b hw/vga.c --- a/hw/vga.c Thu Mar 2 16:46:45 2006 -0500 +++ b/hw/vga.c Sat Mar 4 12:34:45 2006 -0500 @@ -803,7 +803,7 @@ static inline unsigned int rgb_to_pixel32(unsigned int r, unsigned int g, unsigned b) { - return (r << 16) | (g << 8) | b; + return 0xFF000000 | (r << 16) | (g << 8) | b; } #define DEPTH 8 --------------070503010309070501020000--