summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2004-05-21 03:32:27 +0000
committerKeith Packard <keithp@keithp.com>2004-05-21 03:32:27 +0000
commit932efe8e6d4e6280aed9b5e25af56888c964d37b (patch)
treec5b626235cc47d85f49db69291c7c3ca5851553a
parentcde51fd05b2bd413d8db8ad750e6a72398a7039c (diff)
Allow for multiple composite-based visuals, then add an RGB24 visual in
addition to the ARGB32 one. This allows 'glitz' to run on top of any X server using mesa. Switch to using 32bpp for depth 24 pixmaps (even when the frame buffer is not depth 24).
-rw-r--r--hw/kdrive/src/kdrive.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c
index 0eb7bd40c..fb0edffea 100644
--- a/hw/kdrive/src/kdrive.c
+++ b/hw/kdrive/src/kdrive.c
@@ -43,9 +43,22 @@
#include "dpmsproc.h"
#endif
-CARD8 kdBpp[] = { 1, 4, 8, 16, 24, 32 };
-
-#define NUM_KD_BPP (sizeof (kdBpp) / sizeof (kdBpp[0]))
+typedef struct _kdDepths {
+ CARD8 depth;
+ CARD8 bpp;
+} KdDepths;
+
+KdDepths kdDepths[] = {
+ { 1, 1 },
+ { 4, 4 },
+ { 8, 8 },
+ { 15, 16 },
+ { 16, 16 },
+ { 24, 32 },
+ { 32, 32 }
+};
+
+#define NUM_KD_DEPTHS (sizeof (kdDepths) / sizeof (kdDepths[0]))
int kdScreenPrivateIndex;
unsigned long kdGeneration;
@@ -1320,9 +1333,9 @@ KdSetPixmapFormats (ScreenInfo *pScreenInfo)
/*
* Fill in additional formats
*/
- for (i = 0; i < NUM_KD_BPP; i++)
- if (!depthToBpp[kdBpp[i]])
- depthToBpp[kdBpp[i]] = kdBpp[i];
+ for (i = 0; i < NUM_KD_DEPTHS; i++)
+ if (!depthToBpp[kdDepths[i].depth])
+ depthToBpp[kdDepths[i].depth] = kdDepths[i].bpp;
pScreenInfo->imageByteOrder = IMAGE_BYTE_ORDER;
pScreenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT;