From 8183d594ea326c61efefdb335f547ec17085fbc5 Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Sat, 12 Apr 2008 22:23:43 -0300 Subject: [PATCH] Remove dependency on cfb. This also removes the 8/24 overlay code as it relies on cfb. Untested, only guaranteed to compile and not have run time unresolved symbols (other than MGAGetClientPointer that is from Matrox's libhal). --- src/mga.h | 2 - src/mga_dac3026.c | 13 +-------- src/mga_dacG.c | 10 +------ src/mga_dga.c | 1 - src/mga_dri.c | 5 --- src/mga_driver.c | 76 ++++++---------------------------------------------- src/mga_merge.c | 2 - src/mga_storm.c | 16 ----------- src/mga_video.c | 11 +------ 9 files changed, 13 insertions(+), 123 deletions(-) diff --git a/src/mga.h b/src/mga.h index 695e911..f1f4714 100644 --- a/src/mga.h +++ b/src/mga.h @@ -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_dac3026.c b/src/mga_dac3026.c index e33f914..44dd166 100644 --- a/src/mga_dac3026.c +++ b/src/mga_dac3026.c @@ -517,10 +517,7 @@ MGA3026Init(ScrnInfoPtr pScrn, DisplayModePtr mode) initDAC = MGADACbpp24; break; case 32: - if(pLayout->Overlay8Plus24) - initDAC = MGADACbpp8plus24; - else - initDAC = MGADACbpp32; + initDAC = MGADACbpp32; break; default: FatalError("MGA: unsupported bits per pixel\n"); @@ -536,11 +533,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 +1130,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..123c76b 100644 --- a/src/mga_dacG.c +++ b/src/mga_dacG.c @@ -466,12 +466,7 @@ 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; + 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 c5d27ef..5757ccb 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 @@ -1867,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", @@ -2660,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 */ @@ -2728,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; @@ -3208,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 @@ -3606,13 +3567,7 @@ 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) { + if (pMga->SecondCrtc) { /* No DirectColor on the second head */ if (!miSetVisualTypes(pScrn->depth, TrueColorMask, pScrn->rgbBits, TrueColor)) @@ -3703,16 +3658,9 @@ 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); - } + ret = fbScreenInit(pScreen, FBStart, width, height, + pScrn->xDpi, pScrn->yDpi, + displayWidth, pScrn->bitsPerPixel); if (!ret) return FALSE; @@ -3734,8 +3682,7 @@ 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); @@ -3796,11 +3743,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; 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..0ef4497 100644 --- a/src/mga_video.c +++ b/src/mga_video.c @@ -115,8 +115,7 @@ void MGAInitVideo(ScreenPtr 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)) + } else if(pMga->TexturedVideo && (pScrn->bitsPerPixel != 24)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using texture video\n"); newAdaptor = MGASetupImageVideoTexture(pScreen); @@ -126,8 +125,7 @@ void MGAInitVideo(ScreenPtr pScreen) newAdaptor = MGASetupImageVideoOverlay(pScreen); pMga->TexturedVideo = FALSE; } - if(!pMga->Overlay8Plus24) - MGAInitOffscreenImages(pScreen); + MGAInitOffscreenImages(pScreen); } num_adaptors = xf86XVListGenericAdaptors(pScrn, &adaptors); @@ -801,11 +799,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 */ -- 1.5.3.2