summaryrefslogtreecommitdiff
path: root/xc
diff options
context:
space:
mode:
authorbrianp <brianp>2000-05-24 21:55:09 +0000
committerbrianp <brianp>2000-05-24 21:55:09 +0000
commit985b00360128d4123aaf969e03cff2e36029039e (patch)
tree55fc5371c381a43e6885294121e1030d64e38903 /xc
parentc3becee58fdc4c212f2ecd95f0ecafb7976bcf37 (diff)
separated visual setup code for 16 vs 24/32bpp
Diffstat (limited to 'xc')
-rw-r--r--xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c93
1 files changed, 91 insertions, 2 deletions
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c
index c5dd04308..e7e8b8f97 100644
--- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c
+++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c
@@ -53,8 +53,6 @@ TDFXInitVisualConfigs(ScreenPtr pScreen)
switch (pScrn->bitsPerPixel) {
case 8:
case 16:
- case 24:
- case 32:
numConfigs = 16;
if (!(pConfigs = (__GLXvisualConfig*)xnfcalloc(sizeof(__GLXvisualConfig),
@@ -141,6 +139,97 @@ TDFXInitVisualConfigs(ScreenPtr pScreen)
ErrorF("Incorrect initialization of visuals\n");
return FALSE;
} else ErrorF("Created %d visuals\n", numConfigs);
+ break; /* 16bpp */
+
+ case 24:
+ case 32:
+ numConfigs = 16;
+
+ if (!(pConfigs = (__GLXvisualConfig*)xnfcalloc(sizeof(__GLXvisualConfig),
+ numConfigs))) {
+ return FALSE;
+ }
+ if (!(pTDFXConfigs = (TDFXConfigPrivPtr)xnfcalloc(sizeof(TDFXConfigPrivRec),
+ numConfigs))) {
+ xfree(pConfigs);
+ return FALSE;
+ }
+ if (!(pTDFXConfigPtrs = (TDFXConfigPrivPtr*)xnfcalloc(sizeof(TDFXConfigPrivPtr),
+ numConfigs))) {
+ xfree(pConfigs);
+ xfree(pTDFXConfigs);
+ return FALSE;
+ }
+ for (i=0; i<numConfigs; i++)
+ pTDFXConfigPtrs[i] = &pTDFXConfigs[i];
+
+ i=0;
+ depth=1;
+ for (db = 0; db <=1; db++) {
+ for (depth = 0; depth<=1; depth++) {
+ for (accum = 0; accum <= 1; accum++) {
+ for (stencil = 0; stencil <= 1; stencil++) {
+ pConfigs[i].vid = -1;
+ pConfigs[i].class = -1;
+ pConfigs[i].rgba = TRUE;
+ pConfigs[i].redSize = 8;
+ pConfigs[i].greenSize = 8;
+ pConfigs[i].blueSize = 8;
+ pConfigs[i].alphaSize = (pScrn->bitsPerPixel==32) ? 8 : 0;
+ pConfigs[i].redMask = 0x00ff0000;
+ pConfigs[i].greenMask = 0x0000ff00;
+ pConfigs[i].blueMask = 0x000000ff;
+ pConfigs[i].alphaMask = (pScrn->bitsPerPixel==32) ? 0xff000000 : 0;
+ if (accum) {
+ pConfigs[i].accumRedSize = 16;
+ pConfigs[i].accumGreenSize = 16;
+ pConfigs[i].accumBlueSize = 16;
+ pConfigs[i].accumAlphaSize = (pScrn->bitsPerPixel==32) ? 16 : 0;
+ } else {
+ pConfigs[i].accumRedSize = 0;
+ pConfigs[i].accumGreenSize = 0;
+ pConfigs[i].accumBlueSize = 0;
+ pConfigs[i].accumAlphaSize = 0;
+ }
+ if (db)
+ pConfigs[i].doubleBuffer = TRUE;
+ else
+ pConfigs[i].doubleBuffer = FALSE;
+ pConfigs[i].stereo = FALSE;
+ pConfigs[i].bufferSize = 16;
+ if (depth) {
+ if (pTDFX->cpp > 2)
+ pConfigs[i].depthSize = 24;
+ else
+ pConfigs[i].depthSize = 16;
+ } else {
+ pConfigs[i].depthSize = 0;
+ }
+ if (stencil)
+ pConfigs[i].stencilSize = 8;
+ else
+ pConfigs[i].stencilSize = 0;
+ pConfigs[i].auxBuffers = 0;
+ pConfigs[i].level = 0;
+ if (stencil || accum)
+ pConfigs[i].visualRating = GLX_SLOW_VISUAL_EXT;
+ else
+ pConfigs[i].visualRating = GLX_NONE_EXT;
+ pConfigs[i].transparentPixel = 0;
+ pConfigs[i].transparentRed = 0;
+ pConfigs[i].transparentGreen = 0;
+ pConfigs[i].transparentBlue = 0;
+ pConfigs[i].transparentAlpha = 0;
+ pConfigs[i].transparentIndex = 0;
+ i++;
+ }
+ }
+ }
+ }
+ if (i!=numConfigs) {
+ ErrorF("Incorrect initialization of visuals\n");
+ return FALSE;
+ } else ErrorF("Created %d visuals\n", numConfigs);
break;
}
pTDFX->numVisualConfigs = numConfigs;