From 932efe8e6d4e6280aed9b5e25af56888c964d37b Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 21 May 2004 03:32:27 +0000 Subject: [PATCH] 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). --- hw/kdrive/src/kdrive.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 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 }; +typedef struct _kdDepths { + CARD8 depth; + CARD8 bpp; +} KdDepths; -#define NUM_KD_BPP (sizeof (kdBpp) / sizeof (kdBpp[0])) +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;