Module Name: xsrc Committed By: mrg Date: Sat Jul 23 08:18:36 UTC 2011
Modified Files: xsrc/external/mit/xf86-video-chips/dist/src: ct_driver.c Log Message: merge xf86-video-chips 1.2.4 To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 \ xsrc/external/mit/xf86-video-chips/dist/src/ct_driver.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: xsrc/external/mit/xf86-video-chips/dist/src/ct_driver.c diff -u xsrc/external/mit/xf86-video-chips/dist/src/ct_driver.c:1.8 xsrc/external/mit/xf86-video-chips/dist/src/ct_driver.c:1.9 --- xsrc/external/mit/xf86-video-chips/dist/src/ct_driver.c:1.8 Sat May 21 15:08:36 2011 +++ xsrc/external/mit/xf86-video-chips/dist/src/ct_driver.c Sat Jul 23 08:18:36 2011 @@ -107,7 +107,7 @@ #define USE_MIBANK #endif -#ifdef USE_MIBANK +#if defined(USE_MIBANK) || defined(HAVE_ISA) #include "mibank.h" #endif @@ -115,7 +115,7 @@ #include "micmap.h" #include "fb.h" -#include "xf86Priv.h" +#include "fboverlay.h" /* Needed for the 1 and 4 bpp framebuffers */ #ifdef HAVE_XF1BPP @@ -162,7 +162,9 @@ static Bool CHIPSSaveScreen(ScreenPtr pScreen, int mode); /* Internally used functions */ +#ifdef HAVE_ISA static int chipsFindIsaDevice(GDevPtr dev); +#endif static Bool chipsClockSelect(ScrnInfoPtr pScrn, int no); Bool chipsModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode); static void chipsSave(ScrnInfoPtr pScrn, vgaRegPtr VgaSave, @@ -752,7 +754,7 @@ { if (pScrn->driverPrivate == NULL) return; - xfree(pScrn->driverPrivate); + free(pScrn->driverPrivate); pScrn->driverPrivate = NULL; } @@ -1255,16 +1257,6 @@ } break; #endif - case 16: - if (cPtr->Flags & ChipsOverlay8plus16) { - if (xf86LoadSubModule(pScrn, "xf8_16bpp") == NULL) { - vbeFree(cPtr->pVbe); - cPtr->pVbe = NULL; - CHIPSFreeRec(pScrn); - return FALSE; - } - break; - } default: if (xf86LoadSubModule(pScrn, "fb") == NULL) { vbeFree(cPtr->pVbe); @@ -1419,7 +1411,7 @@ /* Collect all of the relevant option flags (fill in pScrn->options) */ xf86CollectOptions(pScrn, NULL); /* Process the options */ - if (!(cPtr->Options = xalloc(sizeof(ChipsHiQVOptions)))) + if (!(cPtr->Options = malloc(sizeof(ChipsHiQVOptions)))) return FALSE; memcpy(cPtr->Options, ChipsHiQVOptions, sizeof(ChipsHiQVOptions)); xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, cPtr->Options); @@ -1529,7 +1521,7 @@ #endif cPtr->IOAddress = cPtr->FbAddress + 0x400000L; xf86DrvMsg(pScrn->scrnIndex, X_DEFAULT, - "IOAddress is set at 0x%lX.\n",cPtr->IOAddress); + "IOAddress is set at 0x%lX.\n",(unsigned long)cPtr->IOAddress); } else xf86DrvMsg(pScrn->scrnIndex, from, @@ -2498,7 +2490,7 @@ xf86CollectOptions(pScrn, NULL); /* Process the options */ - if (!(cPtr->Options = xalloc(sizeof(ChipsWingineOptions)))) + if (!(cPtr->Options = malloc(sizeof(ChipsWingineOptions)))) return FALSE; memcpy(cPtr->Options, ChipsWingineOptions, sizeof(ChipsWingineOptions)); xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, cPtr->Options); @@ -2969,7 +2961,7 @@ xf86CollectOptions(pScrn, NULL); /* Process the options */ - if (!(cPtr->Options = xalloc(sizeof(Chips655xxOptions)))) + if (!(cPtr->Options = malloc(sizeof(Chips655xxOptions)))) return FALSE; memcpy(cPtr->Options, Chips655xxOptions, sizeof(Chips655xxOptions)); xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, cPtr->Options); @@ -3827,6 +3819,18 @@ hwp->disablePalette(hwp); } +static Bool +cfb8_16ScreenInit(ScreenPtr pScreen, pointer pbits16, pointer pbits8, + int xsize, int ysize, int dpix, int dpiy, + int width16, int width8) +{ + return + (fbOverlaySetupScreen(pScreen, pbits16, pbits8, xsize, ysize, + dpix, dpiy, width16, width8, 16, 8) && + fbOverlayFinishScreenInit(pScreen, pbits16, pbits8, xsize, ysize, + dpix, dpiy, width16, width8, 16, 8, 16, 8)); +} + /* Mandatory */ static Bool CHIPSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) @@ -3839,7 +3843,9 @@ int init_picture = 0; VisualPtr visual; int allocatebase, freespace, currentaddr; +#ifndef XSERVER_LIBPCIACCESS unsigned int racflag = 0; +#endif unsigned char *FBStart; int height, width, displayWidth; CHIPSEntPtr cPtrEnt = NULL; @@ -3981,7 +3987,7 @@ if(cPtr->Flags & ChipsShadowFB) { cPtr->ShadowPitch = BitmapBytePad(pScrn->bitsPerPixel * width); - cPtr->ShadowPtr = xalloc(cPtr->ShadowPitch * height); + cPtr->ShadowPtr = malloc(cPtr->ShadowPitch * height); displayWidth = cPtr->ShadowPitch / (pScrn->bitsPerPixel >> 3); FBStart = cPtr->ShadowPtr; } else { @@ -4071,7 +4077,7 @@ cPtr->HWCursorShown = FALSE; -#ifdef USE_MIBANK +#if defined(USE_MIBANK) || defined(HAVE_ISA) if (!(cPtr->Flags & ChipsLinearSupport)) { miBankInfoPtr pBankInfo; @@ -4543,10 +4549,8 @@ XAADestroyInfoRec(cPtr->AccelInfoRec); if (cPtr->CursorInfoRec) xf86DestroyCursorInfoRec(cPtr->CursorInfoRec); - if (cPtr->ShadowPtr) - xfree(cPtr->ShadowPtr); - if (cPtr->DGAModes) - xfree(cPtr->DGAModes); + free(cPtr->ShadowPtr); + free(cPtr->DGAModes); pScrn->vtSema = FALSE; if(cPtr->BlockHandler) pScreen->BlockHandler = cPtr->BlockHandler; @@ -7426,7 +7430,7 @@ hwp->writeDacWriteAddr(hwp, 0x00); while ((hwp->readST01(hwp)) & 0x08){}; /* wait for vsync to end */ - while (!(hwp->readST01(hwp)) & 0x08){}; /* wait for new vsync */ + while (!((hwp->readST01(hwp)) & 0x08)){}; /* wait for new vsync */ hwp->writeDacData(hwp, a); /* set pattern */ hwp->writeDacData(hwp, b); hwp->writeDacData(hwp, c);