[Mesa-dev] [RFC, PATCH] Fix 24bpp software rendering, take 2
Marc Pignat
marc at pignat.org
Tue Jun 28 06:21:58 PDT 2011
This patch add the support for 24bpp in the dri/swrast implementation.
Signed-off-by: Marc Pignat <marc at pignat.org>
---
Hi all!
Here is a fix for https://bugs.freedesktop.org/show_bug.cgi?id=23525
This time it has been tested under kvm/qemu using:
* cirrus emulation (truecolor 24 bits with 24 bpp)
* vga (truecolor 24 bits with 32 bpp)
I know this is a workaround, but I think we don't need to spend
too much time for this unusual (24 bpp) mode.
Best regards
Marc
diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c
index 07d4955..a57b327 100644
--- a/src/glx/drisw_glx.c
+++ b/src/glx/drisw_glx.c
@@ -100,6 +100,13 @@ XCreateDrawable(struct drisw_drawable * pdp,
32, /* bitmap_pad */
0); /* bytes_per_line
*/
+ /**
+ * swrast does not handle 24-bit depth with 24 bpp, so let X do the
+ * the conversion for us.
+ */
+ if (pdp->ximage->bits_per_pixel == 24)
+ pdp->ximage->bits_per_pixel = 32;
+
return True;
}
More information about the mesa-dev
mailing list