All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] Use opaque alpha channel to support Xgl
Date: Sun, 05 Mar 2006 16:45:07 -0600	[thread overview]
Message-ID: <440B69F3.1070801@codemonkey.ws> (raw)

[-- Attachment #1: Type: text/plain, Size: 801 bytes --]

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

[-- Attachment #2: qemu-xgl.diff --]
[-- Type: text/plain, Size: 668 bytes --]

# HG changeset patch
# User Anthony Liguori <anthony@codemonkey.ws>
# 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

             reply	other threads:[~2006-03-05 22:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-05 22:45 Anthony Liguori [this message]
2006-03-06 17:38 ` [Qemu-devel] Re: [PATCH] Use opaque alpha channel to support Xgl Christian Walther
2006-03-07  0:51   ` Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=440B69F3.1070801@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.