diff options
author | Ian Romanick <idr@us.ibm.com> | 2008-05-30 17:51:22 -0700 |
---|---|---|
committer | Ian Romanick <idr@us.ibm.com> | 2008-05-30 17:51:22 -0700 |
commit | 9ee7b04b1fe57834a541ef27b4e25acffd3ac1c5 (patch) | |
tree | 2b1de9248e03f2d23a259eae0f49713f22182539 | |
parent | 254299d06eba2ede820f1fe2929a4b247ead39b1 (diff) |
cfb8_32: Gut a remnants of support for 24-bit with 8-bit overlay
-rw-r--r-- | man/mga.man | 7 | ||||
-rw-r--r-- | src/mga.h | 2 | ||||
-rw-r--r-- | src/mga_arc.c | 6 | ||||
-rw-r--r-- | src/mga_dac3026.c | 23 | ||||
-rw-r--r-- | src/mga_dacG.c | 12 | ||||
-rw-r--r-- | src/mga_dga.c | 1 | ||||
-rw-r--r-- | src/mga_dri.c | 5 | ||||
-rw-r--r-- | src/mga_driver.c | 100 | ||||
-rw-r--r-- | src/mga_esc.c | 1 | ||||
-rw-r--r-- | src/mga_merge.c | 2 | ||||
-rw-r--r-- | src/mga_storm.c | 16 | ||||
-rw-r--r-- | src/mga_video.c | 56 |
12 files changed, 44 insertions, 187 deletions
diff --git a/man/mga.man b/man/mga.man index 2ad75bc..64c54fd 100644 --- a/man/mga.man +++ b/man/mga.man @@ -126,13 +126,6 @@ loaded when available and when using hardware that it supports. Set clocks to values used by some commercial X Servers (G100, G200 and G400 only). Default: off. .TP -.BI "Option \*qOverlay\*q \*q" value \*q -Enable 8+24 overlay mode. Only appropriate for depth 24. -Recognized values are: "8,24", "24,8". Default: off. -.RB ( Note: -the G100 is unaccelerated in the 8+24 overlay mode due to a missing -hardware feature.) -.TP .BI "Option \*qPciRetry\*q \*q" boolean \*q Enable or disable PCI retries. Default: off. .TP @@ -266,7 +266,6 @@ typedef struct { int depth; int displayWidth; rgb weight; - Bool Overlay8Plus24; DisplayModePtr mode; } MGAFBLayout; @@ -506,7 +505,6 @@ typedef struct { Bool HWCursor; Bool UsePCIRetry; Bool ShowCache; - Bool Overlay8Plus24; Bool ShadowFB; unsigned char * ShadowPtr; int ShadowPitch; diff --git a/src/mga_arc.c b/src/mga_arc.c index 00b0e54..e6ad463 100644 --- a/src/mga_arc.c +++ b/src/mga_arc.c @@ -52,12 +52,6 @@ in this Software without prior written authorization from The Open Group. #include "mga_macros.h" -/* - This is only faster than cfb for stuff other than GXcopy. - And even then, only when pci_retries are on. -*/ - - #define DRAW_POINT(x, y) { \ tmp = x; \ OUTREG(MGAREG_FXBNDRY, (tmp) | (((tmp) + 1) << 16)); \ diff --git a/src/mga_dac3026.c b/src/mga_dac3026.c index e33f914..27cc6c8 100644 --- a/src/mga_dac3026.c +++ b/src/mga_dac3026.c @@ -136,14 +136,6 @@ const static unsigned char MGADACbpp32[DACREGSIZE] = { 0x00 }; -/* on at least some 2064Ws, the PSEL line flips at 4MB or so, so PSEL keying - has to be off in register 0x1e -> bit4 clear */ - -const static unsigned char MGADACbpp8plus24[DACREGSIZE] = { - 0x07, 0x06, 0x5b, 0x05, 0x00, 0x00, 0x2C, 0x00, 0x1E, 0xFF, - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x01, 0x00, 0x00, - 0x00 -}; /* * Read/write to the DAC via MMIO @@ -517,11 +509,8 @@ MGA3026Init(ScrnInfoPtr pScrn, DisplayModePtr mode) initDAC = MGADACbpp24; break; case 32: - if(pLayout->Overlay8Plus24) - initDAC = MGADACbpp8plus24; - else - initDAC = MGADACbpp32; - break; + initDAC = MGADACbpp32; + break; default: FatalError("MGA: unsupported bits per pixel\n"); } @@ -536,11 +525,6 @@ MGA3026Init(ScrnInfoPtr pScrn, DisplayModePtr mode) index_1d = i; } - if((pLayout->bitsPerPixel == 32) && pLayout->Overlay8Plus24) { - pReg->DacRegs[9] = pMga->colorKey; - pReg->DacRegs[10] = pMga->colorKey; - } - if ( (pLayout->bitsPerPixel == 16) && (pLayout->weight.red == 5) && (pLayout->weight.green == 5) && (pLayout->weight.blue == 5) ) { pReg->DacRegs[1] &= ~0x01; @@ -1138,9 +1122,6 @@ void MGA3026LoadPalette( MGAPtr pMga = MGAPTR(pScrn); int i, index; - if(pMga->CurrentLayout.Overlay8Plus24 && (pVisual->nplanes != 8)) - return; - if (pVisual->nplanes == 16) { for(i = 0; i < numColors; i++) { index = indices[i]; diff --git a/src/mga_dacG.c b/src/mga_dacG.c index 1a6a565..82fa183 100644 --- a/src/mga_dacG.c +++ b/src/mga_dacG.c @@ -466,13 +466,8 @@ MGAGInit(ScrnInfoPtr pScrn, DisplayModePtr mode) pReg->DacRegs[ MGA1064_MUL_CTL ] = MGA1064_MUL_CTL_24bits; break; case 32: - if(pLayout->Overlay8Plus24) { - pReg->DacRegs[ MGA1064_MUL_CTL ] = MGA1064_MUL_CTL_32bits; - pReg->DacRegs[ MGA1064_COL_KEY_MSK_LSB ] = 0xFF; - pReg->DacRegs[ MGA1064_COL_KEY_LSB ] = pMga->colorKey; - } else - pReg->DacRegs[ MGA1064_MUL_CTL ] = MGA1064_MUL_CTL_32_24bits; - break; + pReg->DacRegs[ MGA1064_MUL_CTL ] = MGA1064_MUL_CTL_32_24bits; + break; default: FatalError("MGA: unsupported depth\n"); } @@ -649,9 +644,6 @@ void MGAGLoadPalette( ){ MGAPtr pMga = MGAPTR(pScrn); - if((pMga->CurrentLayout.Overlay8Plus24) && (pVisual->nplanes != 8)) - return; - if(pMga->Chipset == PCI_CHIP_MGAG400 || pMga->Chipset == PCI_CHIP_MGAG550){ /* load them at the retrace in the block handler instead to work around some problems with static on the screen */ diff --git a/src/mga_dga.c b/src/mga_dga.c index 6bae9dc..e03e635 100644 --- a/src/mga_dga.c +++ b/src/mga_dga.c @@ -329,7 +329,6 @@ MGA_SetMode( pMga->CurrentLayout.weight.red = BitsSet(pMode->red_mask); pMga->CurrentLayout.weight.green = BitsSet(pMode->green_mask); pMga->CurrentLayout.weight.blue = BitsSet(pMode->blue_mask); - pMga->CurrentLayout.Overlay8Plus24 = FALSE; /* MGAModeInit() will set the mode field */ pScrn->SwitchMode(index, pMode->mode, 0); diff --git a/src/mga_dri.c b/src/mga_dri.c index 7556399..d15f5f6 100644 --- a/src/mga_dri.c +++ b/src/mga_dri.c @@ -38,11 +38,6 @@ #include "xf86PciInfo.h" #include "xf86Pci.h" -#define PSZ 8 -#include "cfb.h" -#undef PSZ -#include "cfb16.h" -#include "cfb32.h" #include "miline.h" diff --git a/src/mga_driver.c b/src/mga_driver.c index 8c63859..3f89248 100644 --- a/src/mga_driver.c +++ b/src/mga_driver.c @@ -96,8 +96,6 @@ #include "shadowfb.h" #include "fbdevhw.h" -#include "cfb8_32.h" - #ifdef XF86DRI #include "dri.h" #endif @@ -357,12 +355,6 @@ static const char *fbSymbols[] = { NULL }; -static const char *xf8_32bppSymbols[] = { - "cfb8_32ScreenInit", - "xf86Overlay8Plus32Init", - NULL -}; - #ifdef USE_EXA static const char *exaSymbols[] = { "exaDriverInit", @@ -559,9 +551,8 @@ mgaSetup(pointer module, pointer opts, int *errmaj, int *errmin) #ifdef USE_EXA exaSymbols, #endif - xf8_32bppSymbols, ramdacSymbols, - ddcSymbols, i2cSymbols, shadowSymbols, - fbdevHWSymbols, vbeSymbols, + ramdacSymbols, ddcSymbols, i2cSymbols, + shadowSymbols, fbdevHWSymbols, vbeSymbols, fbSymbols, int10Symbols, #ifdef XF86DRI drmSymbols, driSymbols, @@ -1874,27 +1865,6 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) if (xf86GetOptValFreq(pMga->Options, OPTION_SET_MCLK, OPTUNITS_MHZ, &real)) { pMga->MemClk = (int)(real * 1000.0); } - if ((s = xf86GetOptValString(pMga->Options, OPTION_OVERLAY))) { - if (!*s || !xf86NameCmp(s, "8,24") || !xf86NameCmp(s, "24,8")) { - if(pScrn->bitsPerPixel == 32 && pMga->SecondCrtc == FALSE) { - pMga->Overlay8Plus24 = TRUE; - if(!xf86GetOptValInteger( - pMga->Options, OPTION_COLOR_KEY,&(pMga->colorKey))) - pMga->colorKey = TRANSPARENCY_KEY; - pScrn->colorKey = pMga->colorKey; - pScrn->overlayFlags = OVERLAY_8_32_PLANAR; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, - "PseudoColor overlay enabled\n"); - } else { - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, - "Option \"Overlay\" is only supported in 32 bits per pixel on" - "the first CRTC\n"); - } - } else { - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, - "\"%s\" is not a valid value for Option \"Overlay\"\n", s); - } - } if(xf86GetOptValInteger(pMga->Options, OPTION_VIDEO_KEY, &(pMga->videoKey))) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "video key set to 0x%x\n", @@ -2667,19 +2637,11 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) /* Load the required framebuffer */ - if (pMga->Overlay8Plus24) { - if (!xf86LoadSubModule(pScrn, "xf8_32bpp")) { - MGAFreeRec(pScrn); - return FALSE; - } - xf86LoaderReqSymLists(xf8_32bppSymbols, NULL); - } else { - if (!xf86LoadSubModule(pScrn, "fb")) { - MGAFreeRec(pScrn); - return FALSE; - } - xf86LoaderReqSymLists(fbSymbols, NULL); + if (!xf86LoadSubModule(pScrn, "fb")) { + MGAFreeRec(pScrn); + return FALSE; } + xf86LoaderReqSymLists(fbSymbols, NULL); /* Load XAA if needed */ @@ -2735,7 +2697,6 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) pMga->CurrentLayout.weight.red = pScrn->weight.red; pMga->CurrentLayout.weight.green = pScrn->weight.green; pMga->CurrentLayout.weight.blue = pScrn->weight.blue; - pMga->CurrentLayout.Overlay8Plus24 = pMga->Overlay8Plus24; pMga->CurrentLayout.mode = pScrn->currentMode; @@ -3215,13 +3176,6 @@ MGA_HAL( pMga->FbCursorOffset >> 18); outMGAdac(MGA1064_CURSOR_CTL, 0x00); } - if (pMga->Overlay8Plus24 == TRUE) { - outMGAdac(MGA1064_MUL_CTL, MGA1064_MUL_CTL_32bits); - outMGAdac(MGA1064_COL_KEY_MSK_LSB,0xFF); - outMGAdac(MGA1064_COL_KEY_LSB,pMga->colorKey); - outMGAdac(MGA1064_COL_KEY_MSK_MSB,0xFF); - outMGAdac(MGA1064_COL_KEY_MSB,0xFF); - } } ); /* MGA_HAL */ #endif @@ -3612,14 +3566,8 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) /* Setup the visuals we support. */ - /* All MGA support DirectColor and can do overlays in 32bpp */ - if(pMga->Overlay8Plus24 && (pScrn->bitsPerPixel == 32)) { - if (!miSetVisualTypes(8, PseudoColorMask | GrayScaleMask, - pScrn->rgbBits, PseudoColor)) - return FALSE; - if (!miSetVisualTypes(24, TrueColorMask, pScrn->rgbBits, TrueColor)) - return FALSE; - } else if (pMga->SecondCrtc) { + /* All MGA support DirectColor */ + if (pMga->SecondCrtc) { /* No DirectColor on the second head */ if (!miSetVisualTypes(pScrn->depth, TrueColorMask, pScrn->rgbBits, TrueColor)) @@ -3665,9 +3613,8 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) #ifdef XF86DRI /* - * Setup DRI after visuals have been established, but before cfbScreenInit - * is called. cfbScreenInit will eventually call into the drivers - * InitGLXVisuals call back. + * Setup DRI after visuals have been established. + * * The DRI does not work when textured video is enabled at this time. */ if (pMga->is_G200SE) { @@ -3710,19 +3657,10 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) #endif - if (pMga->Overlay8Plus24) { - ret = cfb8_32ScreenInit(pScreen, FBStart, - width, height, - pScrn->xDpi, pScrn->yDpi, - displayWidth); - } else { - ret = fbScreenInit(pScreen, FBStart, width, height, - pScrn->xDpi, pScrn->yDpi, - displayWidth, pScrn->bitsPerPixel); - } - - if (!ret) + if (!fbScreenInit(pScreen, FBStart, width, height, pScrn->xDpi, + pScrn->yDpi, displayWidth, pScrn->bitsPerPixel)) { return FALSE; + } if (pScrn->bitsPerPixel > 8) { @@ -3741,9 +3679,8 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) } /* must be after RGB ordering fixed */ - if (!pMga->Overlay8Plus24) - fbPictureInit (pScreen, 0, 0); - + fbPictureInit (pScreen, 0, 0); + xf86SetBlackWhitePixels(pScreen); pMga->BlockHandler = pScreen->BlockHandler; @@ -3803,11 +3740,6 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) NULL, f)) return FALSE; - if(pMga->Overlay8Plus24) { /* Must come after colormap initialization */ - if(!xf86Overlay8Plus32Init(pScreen)) - return FALSE; - } - if(pMga->ShadowFB) { RefreshAreaFuncPtr refreshArea = MGARefreshArea; @@ -3837,7 +3769,7 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) #ifdef XF86DRI if (pMga->directRenderingEnabled) { - /* Now that mi, cfb, drm and others have done their thing, + /* Now that mi, drm and others have done their thing, * complete the DRI setup. */ pMga->directRenderingEnabled = MGADRIFinishScreenInit(pScreen); diff --git a/src/mga_esc.c b/src/mga_esc.c index 8beffa8..def0417 100644 --- a/src/mga_esc.c +++ b/src/mga_esc.c @@ -41,7 +41,6 @@ #include "vbe.h" #include "fb.h" -#include "cfb8_32.h" #include "dixstruct.h" #include "mga_reg.h" diff --git a/src/mga_merge.c b/src/mga_merge.c index 359cdcf..6ebbebb 100644 --- a/src/mga_merge.c +++ b/src/mga_merge.c @@ -335,7 +335,6 @@ MGAPreInitMergedFB(ScrnInfoPtr pScrn1, int flags) pMga->ShowCache = pMga1->ShowCache; pMga->HasSDRAM = pMga1->HasSDRAM; pMga->MemClk = pMga1->MemClk; - pMga->Overlay8Plus24 = pMga1->Overlay8Plus24; pMga->colorKey = pMga1->colorKey; pScrn->colorKey = pScrn1->colorKey; pScrn->overlayFlags = pScrn1->overlayFlags; @@ -626,7 +625,6 @@ MGAPreInitMergedFB(ScrnInfoPtr pScrn1, int flags) pMga->CurrentLayout.weight.red = pScrn->weight.red; pMga->CurrentLayout.weight.green = pScrn->weight.green; pMga->CurrentLayout.weight.blue = pScrn->weight.blue; - pMga->CurrentLayout.Overlay8Plus24 = pMga->Overlay8Plus24; pMga->CurrentLayout.mode = pScrn->currentMode; diff --git a/src/mga_storm.c b/src/mga_storm.c index dfdebeb..fa2a6ba 100644 --- a/src/mga_storm.c +++ b/src/mga_storm.c @@ -27,7 +27,6 @@ #include "servermd.h" #ifdef XF86DRI -#include "cfb.h" #include "GL/glxtokens.h" #endif @@ -312,11 +311,6 @@ Bool MGASetupForCPUToScreenAlphaTextureFaked( ScrnInfoPtr pScrn, int op, CHECK_DMA_QUIESCENT(pMga, pScrn); - if(pMga->Overlay8Plus24) { - WAITFIFO(1); - SET_PLANEMASK_REPLICATED( 0x00ffffff, 0xffffffff, 32 ); - } - pitch = (width + 15) & ~15; sizeNeeded = pitch * height; if(pScrn->bitsPerPixel == 16) @@ -401,11 +395,6 @@ MGASetupForCPUToScreenAlphaTexture ( CHECK_DMA_QUIESCENT(pMga, pScrn); - if(pMga->Overlay8Plus24) { - WAITFIFO(1); - SET_PLANEMASK_REPLICATED( 0x00ffffff, 0xffffffff, 32 ); - } - pitch = (width + 15) & ~15; sizeNeeded = (pitch * height) >> 1; if(pScrn->bitsPerPixel == 32) @@ -505,11 +494,6 @@ MGASetupForCPUToScreenTexture ( CHECK_DMA_QUIESCENT(pMga, pScrn); - if(pMga->Overlay8Plus24) { - WAITFIFO(1); - SET_PLANEMASK_REPLICATED( 0x00ffffff, 0xffffffff, 32 ); - } - pitch = (width + 15) & ~15; sizeNeeded = pitch * height; if(pScrn->bitsPerPixel == 16) diff --git a/src/mga_video.c b/src/mga_video.c index a2d7979..15164e1 100644 --- a/src/mga_video.c +++ b/src/mga_video.c @@ -93,31 +93,28 @@ void MGAInitVideo(ScreenPtr pScreen) MGAPtr pMga = MGAPTR(pScrn); int num_adaptors; - if((pScrn->bitsPerPixel != 8) && !pMga->NoAccel && - (pMga->SecondCrtc == FALSE) && - ((pMga->Chipset == PCI_CHIP_MGA2164) || - (pMga->Chipset == PCI_CHIP_MGA2164_AGP) || -/* (pMga->Chipset == PCI_CHIP_MGA2064) || */ - (pMga->Chipset == PCI_CHIP_MGAG200) || - (pMga->Chipset == PCI_CHIP_MGAG200_PCI) || - (pMga->Chipset == PCI_CHIP_MGAG400) || - (pMga->Chipset == PCI_CHIP_MGAG550))) - { - if( (pMga->Chipset == PCI_CHIP_MGA2164) || -/* (pMga->Chipset == PCI_CHIP_MGA2064) || */ - (pMga->Chipset == PCI_CHIP_MGA2164_AGP) - ) { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using MGA 2164W ILOAD video\n"); - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "This is an experimental driver and may not work on your machine.\n"); - - newAdaptor = MGASetupImageVideoILOAD(pScreen); - pMga->TexturedVideo = TRUE; - /* ^^^ this is not really true but the ILOAD scaler shares - much more code with the textured video than the overlay */ - } else if((pMga->Overlay8Plus24 || pMga->TexturedVideo) && - (pScrn->bitsPerPixel != 24)) - { + if ((pScrn->bitsPerPixel != 8) && !pMga->NoAccel && + (pMga->SecondCrtc == FALSE) && + ((pMga->Chipset == PCI_CHIP_MGA2164) || + (pMga->Chipset == PCI_CHIP_MGA2164_AGP) || +/* (pMga->Chipset == PCI_CHIP_MGA2064) || */ + (pMga->Chipset == PCI_CHIP_MGAG200) || + (pMga->Chipset == PCI_CHIP_MGAG200_PCI) || + (pMga->Chipset == PCI_CHIP_MGAG400) || + (pMga->Chipset == PCI_CHIP_MGAG550))) { + if ((pMga->Chipset == PCI_CHIP_MGA2164) || +/* (pMga->Chipset == PCI_CHIP_MGA2064) || */ + (pMga->Chipset == PCI_CHIP_MGA2164_AGP)) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using MGA 2164W ILOAD video\n"); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "This is an experimental driver and may not work on your machine.\n"); + + newAdaptor = MGASetupImageVideoILOAD(pScreen); + pMga->TexturedVideo = TRUE; + /* ^^^ this is not really true but the ILOAD scaler shares + * much more code with the textured video than the overlay + */ + } else if (pMga->TexturedVideo && (pScrn->bitsPerPixel != 24)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using texture video\n"); newAdaptor = MGASetupImageVideoTexture(pScreen); pMga->TexturedVideo = TRUE; @@ -126,8 +123,8 @@ void MGAInitVideo(ScreenPtr pScreen) newAdaptor = MGASetupImageVideoOverlay(pScreen); pMga->TexturedVideo = FALSE; } - if(!pMga->Overlay8Plus24) - MGAInitOffscreenImages(pScreen); + + MGAInitOffscreenImages(pScreen); } num_adaptors = xf86XVListGenericAdaptors(pScrn, &adaptors); @@ -801,11 +798,6 @@ MGADisplayVideoTexture( CHECK_DMA_QUIESCENT(pMga, pScrn); - if(pMga->Overlay8Plus24) { - WAITFIFO(1); - SET_PLANEMASK_REPLICATED( 0x00ffffff, 0xffffffff, 32 ); - } - WAITFIFO(15); OUTREG(MGAREG_TMR0, incx); /* sx inc */ OUTREG(MGAREG_TMR1, 0); /* sy inc */ |