diff -Naur xc/programs/Xserver/hw/xfree86/drivers/neomagic.orig/neo_2070.c xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_2070.c --- xc/programs/Xserver/hw/xfree86/drivers/neomagic.orig/neo_2070.c 2004-07-31 02:21:32 +0400 +++ xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_2070.c 2005-06-25 18:32:57 +0400 @@ -157,7 +157,7 @@ return FALSE; } - return (xaaSetupWrapper(pScreen, infoPtr, pScrn->depth, &nPtr->accelSync)); + return(XAAInit(pScreen, infoPtr)); } diff -Naur xc/programs/Xserver/hw/xfree86/drivers/neomagic.orig/neo_2097.c xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_2097.c --- xc/programs/Xserver/hw/xfree86/drivers/neomagic.orig/neo_2097.c 2004-07-31 02:21:32 +0400 +++ xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_2097.c 2005-06-25 18:32:57 +0400 @@ -246,7 +246,7 @@ return FALSE; } - return (xaaSetupWrapper(pScreen, infoPtr, pScrn->depth, &nPtr->accelSync)); + return(XAAInit(pScreen, infoPtr)); } static void diff -Naur xc/programs/Xserver/hw/xfree86/drivers/neomagic.orig/neo_2200.c xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_2200.c --- xc/programs/Xserver/hw/xfree86/drivers/neomagic.orig/neo_2200.c 2004-07-31 02:21:32 +0400 +++ xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_2200.c 2005-06-25 18:32:57 +0400 @@ -113,6 +113,7 @@ 0x0f0000 /* 0x1111 - GXset */ }; + Bool Neo2200AccelInit(ScreenPtr pScreen) { @@ -251,7 +252,8 @@ return FALSE; } - return (xaaSetupWrapper(pScreen, infoPtr, pScrn->depth, &nPtr->accelSync)); + + return(XAAInit(pScreen, infoPtr)); } static void diff -Naur xc/programs/Xserver/hw/xfree86/drivers/neomagic.orig/neo_driver.c xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_driver.c --- xc/programs/Xserver/hw/xfree86/drivers/neomagic.orig/neo_driver.c 2004-08-16 13:13:14 +0400 +++ xc/programs/Xserver/hw/xfree86/drivers/neomagic/neo_driver.c 2005-06-25 18:33:28 +0400 @@ -81,7 +81,6 @@ #include "xf86cmap.h" #include "fb.h" -#include "fbpseudocolor.h" /* Needed by Resources Access Control (RAC) */ #include "xf86RAC.h" @@ -430,10 +429,10 @@ "vgaHWProtect", "vgaHWRestore", "vgaHWSave", - "vgaHWSaveScreenWeak", + "vgaHWSaveScreen", "vgaHWSetStdFuncs", "vgaHWUnlock", - "vgaHWddc1SetSpeedWeak", + "vgaHWddc1SetSpeed", NULL }; @@ -1307,12 +1306,9 @@ clockRanges = (ClockRangePtr)xnfcalloc(sizeof(ClockRange), 1); clockRanges->next = NULL; clockRanges->ClockMulFactor = 1; - clockRanges->minClock = 11000; /* guessed §§§ */ + clockRanges->minClock = 11000; /* guessed §§§ */ clockRanges->maxClock = maxClock; clockRanges->clockIndex = -1; /* programmable */ - if (!nPtr->internDisp && nPtr->externDisp) - clockRanges->interlaceAllowed = TRUE; - else clockRanges->interlaceAllowed = FALSE; clockRanges->doubleScanAllowed = TRUE; @@ -1364,7 +1360,7 @@ { i = xf86ValidateModes(pScrn, pScrn->monitor->Modes, pScrn->display->modes, clockRanges, - NULL, 256, maxWidth,(8 * pScrn->bitsPerPixel),/*§§§*/ + NULL, 256, maxWidth,(8 * pScrn->bitsPerPixel),/*§§§*/ 128, maxHeight, pScrn->display->virtualX, pScrn->display->virtualY, apertureSize, LOOKUP_BEST_REFRESH); @@ -1396,7 +1392,7 @@ /* Print the list of modes being used */ xf86PrintModes(pScrn); - + /* If monitor resolution is set on the command line, use it */ xf86SetDpi(pScrn, 0, 0); @@ -1550,22 +1546,12 @@ miClearVisualTypes(); /* Setup the visuals we support. */ -#if 0 - if (!miSetVisualTypes(pScrn->depth, - miGetDefaultVisualMask(pScrn->depth), - pScrn->rgbBits, pScrn->defaultVisual)) - return FALSE; -#else + if (!miSetVisualTypes(pScrn->depth, miGetDefaultVisualMask(pScrn->depth), pScrn->rgbBits, pScrn->defaultVisual)) return FALSE; - if (pScrn->depth > 8) { - if (!miSetVisualTypes(8, miGetDefaultVisualMask(8), 6, - pScrn->defaultVisual)) - return FALSE; - } -#endif + if (!miSetPixmapDepths ()) return FALSE; /* @@ -1590,19 +1576,19 @@ nPtr->ShadowPtr = NULL; FBStart = nPtr->NeoFbBase; } - + ret = fbScreenInit(pScreen, FBStart, width, height, pScrn->xDpi, pScrn->yDpi, displayWidth, pScrn->bitsPerPixel); if (!ret) return FALSE; + if (pScrn->depth > 8) { /* Fixup RGB ordering */ visual = pScreen->visuals + pScreen->numVisuals; while (--visual >= pScreen->visuals) { - if ((visual->class | DynamicClass) == DirectColor - && visual->nplanes > 8) { + if ((visual->class | DynamicClass) == DirectColor) { visual->offsetRed = pScrn->offset.red; visual->offsetGreen = pScrn->offset.green; visual->offsetBlue = pScrn->offset.blue; @@ -1653,6 +1639,13 @@ xf86DrvMsg(pScrn->scrnIndex,X_INFO, "Using nonlinear mode\n"); xf86DrvMsg(pScrn->scrnIndex,X_INFO, "Using software cursor in " "nonlinear mode\n"); + miInitializeBackingStore(pScreen); + xf86SetBackingStore(pScreen); + xf86SetSilkenMouse(pScreen); + + /* Initialise cursor functions */ + miDCInitialize (pScreen, xf86GetPointerScreenFuncs()); + } else { nAcl->cacheStart = -1; nAcl->cacheEnd = -1; @@ -1753,13 +1746,14 @@ "Acceleration %s Initialized\n",ret ? "" : "not"); } - } - miInitializeBackingStore(pScreen); - xf86SetBackingStore(pScreen); - xf86SetSilkenMouse(pScreen); + miInitializeBackingStore(pScreen); + xf86SetBackingStore(pScreen); + xf86SetSilkenMouse(pScreen); + + /* Initialise cursor functions */ + miDCInitialize (pScreen, xf86GetPointerScreenFuncs()); - /* Initialise cursor functions */ - miDCInitialize (pScreen, xf86GetPointerScreenFuncs()); + } if (nAcl->CursorAddress != -1) { /* HW cursor functions */ @@ -1804,9 +1798,6 @@ CMAP_PALETTED_TRUECOLOR | CMAP_RELOAD_ON_MODE_SWITCH)) return FALSE; - if (pScrn->depth == 16) - xxSetup(pScreen,8, pScrn->depth, NULL, nPtr->accelSync); /*@!@*/ - racflag |= RAC_COLORMAP; if (nPtr->NeoHWCursorInitialized) racflag |= RAC_CURSOR; @@ -1815,7 +1806,7 @@ NEOInitVideo(pScreen); - pScreen->SaveScreen = vgaHWSaveScreenWeak(); + pScreen->SaveScreen = vgaHWSaveScreen; /* Setup DPMS mode */ if (nPtr->NeoChipset != NM2070) @@ -1823,7 +1814,7 @@ 0); if (!nPtr->noLinear) { - pScrn->memPhysBase = (unsigned long)nPtr->NeoLinearAddr; + pScrn->memPhysBase = (unsigned long)nPtr->NeoFbBase; pScrn->fbOffset = 0; } @@ -1903,7 +1894,7 @@ * This is a workaround for a higher level bug that causes the cursor * to be at the wrong position after a virtual screen resolution change */ - if (nPtr->NeoHWCursorInitialized) { /*§§§ do we still need this?*/ + if (nPtr->NeoHWCursorInitialized) { /*§§§ do we still need this?*/ NeoRepositionCursor(); } #endif @@ -1951,8 +1942,14 @@ { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; NEOPtr nPtr = NEOPTR(pScrn); - int vDisplay = mode->VDisplay * ((mode->Flags & V_DBLSCAN) ? 2 : 1); - + int vDisplay = mode->VDisplay * ((mode->Flags & V_DBLSCAN) ? 2 : 1); + + /* Is there any LineCompare Bit 10? Where? + * The 9 well known VGA bits give us a maximum height of 1024 + */ + if (vDisplay > 1024) + return MODE_BAD; + /* * Limit the modes to just those allowed by the various NeoMagic * chips. @@ -1969,7 +1966,7 @@ if (nPtr->internDisp || !nPtr->externDisp) { /* Is the mode larger than the LCD panel? */ if ((mode->HDisplay > nPtr->NeoPanelWidth) || - (vDisplay > nPtr->NeoPanelHeight)) { + (mode->VDisplay > nPtr->NeoPanelHeight)) { xf86DrvMsg(scrnIndex,X_INFO, "Removing mode (%dx%d) " "larger than the LCD panel (%dx%d)\n", mode->HDisplay, @@ -2643,7 +2640,6 @@ } vgaHWProtect(pScrn, FALSE); /* Turn on screen */ - } static Bool @@ -2680,7 +2676,7 @@ */ NeoStd->Attribute[16] = 0x01; - switch (pScrn->depth) { /*@!@*/ + switch (pScrn->depth) { case 8 : NeoStd->CRTC[0x13] = pScrn->displayWidth >> 3; NeoNew->ExtCRTOffset = pScrn->displayWidth >> 11; @@ -2711,7 +2707,7 @@ NeoNew->VerticalExt = (((mode->CrtcVTotal -2) & 0x400) >> 10 ) | (((mode->CrtcVDisplay -1) & 0x400) >> 9 ) | (((mode->CrtcVSyncStart) & 0x400) >> 8 ) - | (((mode->CrtcVSyncStart) & 0x400) >> 7 ); + | (((mode->CrtcVBlankStart - 1) & 0x400) >> 7 ); /* Fast write bursts on unless disabled. */ if (nPtr->onPciBurst) { @@ -2933,7 +2929,7 @@ nPtr->videoHZoom = 1.0; nPtr->videoVZoom = 1.0; } - + /* Do double scan */ if (mode->VDisplay < 480) { NeoStd->Sequencer[1] |= 0x8; clockMul = 2; @@ -2984,13 +2980,13 @@ int n, d, f; double f_out; double f_diff; - int n_best = 0, d_best = 0, f_best = 0; + int n_best = 0, d_best = 1, f_best = 0; double f_best_diff = 999999.0; double f_target = freq/1000.0; for (f = 0; f <= MAX_F; f++) for (n = 0; n <= MAX_N; n++) - for (d = 0; d <= MAX_D; d++) { + for (d = 1; d <= MAX_D; d++) { f_out = (n+1.0)/((d+1.0)*(1<NeoChipset > NM2070 + if (nPtr->NeoChipset >= NM2160 && !nPtr->noLinear && nPtr->NeoMMIOBase2 != NULL){ nPtr->video = TRUE; @@ -397,9 +397,6 @@ switch (nPtr->NeoChipset) { default: - case NM2090: - case NM2093: - case NM2097: case NM2160: offset/=2; OUTGR(0xbc, 0x4f); @@ -853,9 +850,6 @@ switch (nPtr->NeoChipset) { default: - case NM2090: - case NM2093: - case NM2097: case NM2160: offset/=2; pitch/=2;