diff options
Diffstat (limited to 'xc/programs/Xserver/hw/xfree86/drivers/r128/r128_dri.c')
-rw-r--r-- | xc/programs/Xserver/hw/xfree86/drivers/r128/r128_dri.c | 123 |
1 files changed, 63 insertions, 60 deletions
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/r128/r128_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/r128/r128_dri.c index a1f6036c0..3fe3fd0a7 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/r128/r128_dri.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/r128/r128_dri.c @@ -1,4 +1,4 @@ -/* $XFree86$ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/r128/r128_dri.c,v 1.4 2000/06/26 05:41:32 martin Exp $ */ /************************************************************************** Copyright 1999, 2000 ATI Technologies Inc. and Precision Insight, Inc., @@ -245,11 +245,12 @@ static Bool R128InitVisualConfigs(ScreenPtr pScreen) return FALSE; #define R128_USE_ACCUM 1 -#define R128_USE_STENCIL 0 /* Only in 24 depth mode */ +#define R128_USE_STENCIL 1 case 16: numConfigs = 1; - if (R128_USE_ACCUM) numConfigs *= 2; + if (R128_USE_ACCUM) numConfigs *= 2; + if (R128_USE_STENCIL) numConfigs *= 2; if (!(pConfigs = (__GLXvisualConfig*)xnfcalloc(sizeof(__GLXvisualConfig), @@ -272,48 +273,50 @@ static Bool R128InitVisualConfigs(ScreenPtr pScreen) i = 0; for (accum = 0; accum <= R128_USE_ACCUM; accum++) { - pR128ConfigPtrs[i] = &pR128Configs[i]; - - pConfigs[i].vid = -1; - pConfigs[i].class = -1; - pConfigs[i].rgba = TRUE; - pConfigs[i].redSize = 5; - pConfigs[i].greenSize = 6; - pConfigs[i].blueSize = 5; - pConfigs[i].redMask = 0x0000F800; - pConfigs[i].greenMask = 0x000007E0; - pConfigs[i].blueMask = 0x0000001F; - - pConfigs[i].alphaMask = 0; - if (accum) { /* Simulated in software */ - pConfigs[i].accumRedSize = 16; - pConfigs[i].accumGreenSize = 16; - pConfigs[i].accumBlueSize = 16; - pConfigs[i].accumAlphaSize = 0; - } else { - pConfigs[i].accumRedSize = 0; - pConfigs[i].accumGreenSize = 0; - pConfigs[i].accumBlueSize = 0; - pConfigs[i].accumAlphaSize = 0; + for (stencil = 0; stencil <= R128_USE_STENCIL; stencil++) { + pR128ConfigPtrs[i] = &pR128Configs[i]; + + pConfigs[i].vid = -1; + pConfigs[i].class = -1; + pConfigs[i].rgba = TRUE; + pConfigs[i].redSize = 5; + pConfigs[i].greenSize = 6; + pConfigs[i].blueSize = 5; + pConfigs[i].alphaSize = 0; + pConfigs[i].redMask = 0x0000F800; + pConfigs[i].greenMask = 0x000007E0; + pConfigs[i].blueMask = 0x0000001F; + pConfigs[i].alphaMask = 0x00000000; + if (accum) { /* Simulated in software */ + pConfigs[i].accumRedSize = 16; + pConfigs[i].accumGreenSize = 16; + pConfigs[i].accumBlueSize = 16; + pConfigs[i].accumAlphaSize = 0; + } else { + pConfigs[i].accumRedSize = 0; + pConfigs[i].accumGreenSize = 0; + pConfigs[i].accumBlueSize = 0; + pConfigs[i].accumAlphaSize = 0; + } + pConfigs[i].doubleBuffer = TRUE; + pConfigs[i].stereo = FALSE; + pConfigs[i].bufferSize = 16; + pConfigs[i].depthSize = 16; + if (stencil) + pConfigs[i].stencilSize = 8; /* Simulated in software */ + else + pConfigs[i].stencilSize = 0; + pConfigs[i].auxBuffers = 0; + pConfigs[i].level = 0; + pConfigs[i].visualRating = GLX_NONE_EXT; + pConfigs[i].transparentPixel = GLX_NONE; + pConfigs[i].transparentRed = 0; + pConfigs[i].transparentGreen = 0; + pConfigs[i].transparentBlue = 0; + pConfigs[i].transparentAlpha = 0; + pConfigs[i].transparentIndex = 0; + i++; } - pConfigs[i].doubleBuffer = TRUE; - pConfigs[i].stereo = FALSE; - pConfigs[i].bufferSize = 16; - pConfigs[i].depthSize = 16; - pConfigs[i].stencilSize = 0; - pConfigs[i].auxBuffers = 0; - pConfigs[i].level = 0; - if (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++; } break; case 32: @@ -351,16 +354,16 @@ static Bool R128InitVisualConfigs(ScreenPtr pScreen) pConfigs[i].redSize = 8; pConfigs[i].greenSize = 8; pConfigs[i].blueSize = 8; + pConfigs[i].alphaSize = 8; pConfigs[i].redMask = 0x00FF0000; pConfigs[i].greenMask = 0x0000FF00; pConfigs[i].blueMask = 0x000000FF; - - pConfigs[i].alphaMask = 0; + pConfigs[i].alphaMask = 0xFF000000; if (accum) { /* Simulated in software */ pConfigs[i].accumRedSize = 16; pConfigs[i].accumGreenSize = 16; pConfigs[i].accumBlueSize = 16; - pConfigs[i].accumAlphaSize = 0; + pConfigs[i].accumAlphaSize = 16; } else { pConfigs[i].accumRedSize = 0; pConfigs[i].accumGreenSize = 0; @@ -379,11 +382,8 @@ static Bool R128InitVisualConfigs(ScreenPtr pScreen) } pConfigs[i].auxBuffers = 0; pConfigs[i].level = 0; - if (accum) - pConfigs[i].visualRating = GLX_SLOW_VISUAL_EXT; - else - pConfigs[i].visualRating = GLX_NONE_EXT; - pConfigs[i].transparentPixel = 0; + pConfigs[i].visualRating = GLX_NONE_EXT; + pConfigs[i].transparentPixel = GLX_NONE; pConfigs[i].transparentRed = 0; pConfigs[i].transparentGreen = 0; pConfigs[i].transparentBlue = 0; @@ -987,14 +987,17 @@ Bool R128DRIScreenInit(ScreenPtr pScreen) R128DRIPtr pR128DRI; int major, minor, patch; drmVersionPtr version; - -#if XFree86LOADER + /* Check that the GLX, DRI, and DRM modules have been loaded by testing * for known symbols in each module. */ - if (!LoaderSymbol("GlxSetVisualConfigs")) return FALSE; - if (!LoaderSymbol("DRIScreenInit")) return FALSE; - if (!LoaderSymbol("drmAvailable")) return FALSE; -#endif + if (!xf86LoaderCheckSymbol("GlxSetVisualConfigs")) return FALSE; + if (!xf86LoaderCheckSymbol("DRIScreenInit")) return FALSE; + if (!xf86LoaderCheckSymbol("drmAvailable")) return FALSE; + if (!xf86LoaderCheckSymbol("DRIQueryVersion")) { + xf86DrvMsg(pScreen->myNum, X_ERROR, + "R128DRIScreenInit failed (libdri.a too old)\n"); + return FALSE; + } /* Check the DRI version */ DRIQueryVersion(&major, &minor, &patch); @@ -1038,8 +1041,8 @@ Bool R128DRIScreenInit(ScreenPtr pScreen) pDRIInfo->ddxDriverPatchVersion = R128_VERSION_PATCH; pDRIInfo->frameBufferPhysicalAddress = pR128->LinearAddr; pDRIInfo->frameBufferSize = pR128->FbMapSize; - pDRIInfo->frameBufferStride = (pScrn->displayWidth - * pR128->CurrentLayout.pixel_bytes); + pDRIInfo->frameBufferStride = (pScrn->displayWidth * + pR128->CurrentLayout.pixel_bytes); pDRIInfo->ddxDrawableTableEntry = R128_MAX_DRAWABLES; pDRIInfo->maxDrawableTableEntry = (SAREA_MAX_DRAWABLES < R128_MAX_DRAWABLES |