diff options
Diffstat (limited to 'src/gx_driver.c')
-rw-r--r-- | src/gx_driver.c | 100 |
1 files changed, 17 insertions, 83 deletions
diff --git a/src/gx_driver.c b/src/gx_driver.c index 0471389..1850deb 100644 --- a/src/gx_driver.c +++ b/src/gx_driver.c @@ -38,9 +38,6 @@ #include "xf86.h" #include "xf86_OSproc.h" -#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6 -#include "xf86Resources.h" -#endif #include "xf86cmap.h" #include "compiler.h" #include "mipointer.h" @@ -258,50 +255,6 @@ GXAllocateMemory(ScreenPtr pScrn, ScrnInfoPtr pScrni, int rotate) pExa->offScreenBase = fboffset; pExa->memorySize = fboffset + fbavail; } - - if (!pGeode->useEXA) { - -#if XF86XAA - if (!xf86FBManagerRunning(pScrn)) { - - unsigned int offset = fboffset; - unsigned int avail = fbavail; - RegionRec OffscreenRegion; - BoxRec AvailBox; - - /* Assume the shadow FB exists even if it doesn't */ - - if (pGeode->shadowSize == 0) { - size = (pScrn->width * bytpp) * pScrni->virtualX; - offset += size; - avail -= size; - } - - AvailBox.x1 = 0; - AvailBox.y1 = - (offset + pGeode->displayPitch - 1) / pGeode->displayPitch; - - AvailBox.x2 = pGeode->displayWidth; - AvailBox.y2 = (offset + avail) / pGeode->displayPitch; - - if (AvailBox.y1 < AvailBox.y2) { - REGION_INIT(pScrn, &OffscreenRegion, &AvailBox, 2); - - if (!xf86InitFBManagerRegion(pScrn, &OffscreenRegion)) - xf86DrvMsg(pScrni->scrnIndex, X_ERROR, - "Memory manager initialization failed.\n"); - - REGION_UNINIT(pScrn, &OffscreenRegion); - } - else - xf86DrvMsg(pScrni->scrnIndex, X_INFO, - "Cache disabled - no offscreen memory available.\n"); - } - else - xf86DrvMsg(pScrni->scrnIndex, X_INFO, - "XAA offscreen memory has already been allocated.\n"); -#endif - } } return ret; } @@ -450,7 +403,7 @@ GXPreInit(ScrnInfoPtr pScrni, int flags) EntityInfoPtr pEnt; rgb defaultWeight = { 0, 0, 0 }; int modecnt; - char *s, *panelgeo; + const char *s, *panelgeo; Bool useVGA; if (pScrni->numEntities != 1) @@ -462,7 +415,7 @@ GXPreInit(ScrnInfoPtr pScrni, int flags) return FALSE; #endif - pGeode = pScrni->driverPrivate = xnfcalloc(1, sizeof(GeodeRec)); + pGeode = pScrni->driverPrivate = XNFcallocarray(1, sizeof(GeodeRec)); if (pGeode == NULL) return FALSE; @@ -615,14 +568,7 @@ GXPreInit(ScrnInfoPtr pScrni, int flags) panelgeo = xf86GetOptValString(GeodeOptions, GX_OPTION_PANEL_GEOMETRY); if ((s = xf86GetOptValString(GeodeOptions, GX_OPTION_ACCEL_METHOD))) { -#if defined(XF86XAA) && defined(XF86EXA) - if (!xf86NameCmp(s, "XAA")) - pGeode->useEXA = FALSE; - else if (xf86NameCmp(s, "EXA")) - xf86DrvMsg(pScrni->scrnIndex, X_ERROR, - "Unknown acceleration method %s. Defaulting to XAA.\n", - s); -#elif defined(XF86EXA) +#if defined(XF86EXA) pGeode->useEXA = TRUE; #else pGeode->useEXA = FALSE; @@ -631,7 +577,7 @@ GXPreInit(ScrnInfoPtr pScrni, int flags) xf86DrvMsg(pScrni->scrnIndex, X_INFO, "Using %s acceleration architecture\n", - pGeode->useEXA ? "EXA" : "XAA"); + pGeode->useEXA ? "EXA" : "none"); /* Set up the panel */ @@ -692,7 +638,7 @@ GXPreInit(ScrnInfoPtr pScrni, int flags) else pScrni->videoRam = pGeode->pEnt->device->videoRam; - GeodeClockRange = (ClockRangePtr) xnfcalloc(1, sizeof(ClockRange)); + GeodeClockRange = (ClockRangePtr) XNFcallocarray(1, sizeof(ClockRange)); GeodeClockRange->next = NULL; GeodeClockRange->minClock = 25175; GeodeClockRange->maxClock = 229500; @@ -824,9 +770,8 @@ GXSetDvLineSize(unsigned int pitch) /* XXX - this is nothing like the original function - not sure exactly what the purpose is for this quite yet */ static void -GXAdjustFrame(ADJUST_FRAME_ARGS_DECL) +GXAdjustFrame(ScrnInfoPtr pScrni, int x, int y) { - SCRN_INFO_PTR(arg); GeodeRec *pGeode = GEODEPTR(pScrni); unsigned long offset; @@ -908,16 +853,15 @@ GXSetVideoMode(ScrnInfoPtr pScrni, DisplayModePtr pMode) pGeode->HWCursor = FALSE; } - GXAdjustFrame(ADJUST_FRAME_ARGS(pScrni->frameX0, pScrni->frameY0)); + GXAdjustFrame(pScrni, pScrni->frameX0, pScrni->frameY0); gx_enable_dac_power(); return TRUE; } static Bool -GXSwitchMode(SWITCH_MODE_ARGS_DECL) +GXSwitchMode(ScrnInfoPtr pScrni, DisplayModePtr pMode) { - SCRN_INFO_PTR(arg); GeodeRec *pGeode = GEODEPTR(pScrni); int ret = TRUE; int rotate; @@ -1006,7 +950,7 @@ GXLeaveGraphics(ScrnInfoPtr pScrni) } static Bool -GXCloseScreen(CLOSE_SCREEN_ARGS_DECL) +GXCloseScreen(ScreenPtr pScrn) { ScrnInfoPtr pScrni = xf86ScreenToScrn(pScrn); GeodeRec *pGeode = GEODEPTR(pScrni); @@ -1014,11 +958,6 @@ GXCloseScreen(CLOSE_SCREEN_ARGS_DECL) if (pScrni->vtSema) GXLeaveGraphics(pScrni); -#ifdef XF86XAA - if (pGeode->AccelInfoRec) - XAADestroyInfoRec(pGeode->AccelInfoRec); -#endif - if (pGeode->AccelImageWriteBuffers) { free(pGeode->AccelImageWriteBuffers[0]); free(pGeode->AccelImageWriteBuffers); @@ -1044,7 +983,7 @@ GXCloseScreen(CLOSE_SCREEN_ARGS_DECL) pScrn->CloseScreen = pGeode->CloseScreen; if (pScrn->CloseScreen) - return (*pScrn->CloseScreen) (CLOSE_SCREEN_ARGS); + return (*pScrn->CloseScreen) (pScrn); return TRUE; } @@ -1275,7 +1214,7 @@ GXCreateScreenResources(ScreenPtr pScreen) } static Bool -GXScreenInit(SCREEN_INIT_ARGS_DECL) +GXScreenInit(ScreenPtr pScrn, int argc, char **argv) { ScrnInfoPtr pScrni = xf86ScreenToScrn(pScrn); GeodeRec *pGeode = GEODEPTR(pScrni); @@ -1475,9 +1414,8 @@ GXScreenInit(SCREEN_INIT_ARGS_DECL) } static int -GXValidMode(VALID_MODE_ARGS_DECL) +GXValidMode(ScrnInfoPtr pScrni, DisplayModePtr pMode, Bool Verbose, int flags) { - SCRN_INFO_PTR(arg); GeodeRec *pGeode = GEODEPTR(pScrni); int p; int custom = 0; @@ -1526,16 +1464,14 @@ GXValidMode(VALID_MODE_ARGS_DECL) /* XXX - Way more to do here */ static Bool -GXEnterVT(VT_FUNC_ARGS_DECL) +GXEnterVT(ScrnInfoPtr pScrni) { - SCRN_INFO_PTR(arg); return GXEnterGraphics(NULL, pScrni); } static void -GXLeaveVT(VT_FUNC_ARGS_DECL) +GXLeaveVT(ScrnInfoPtr pScrni) { - SCRN_INFO_PTR(arg); GeodeRec *pGeode = GEODEPTR(pScrni); pGeode->PrevDisplayOffset = gfx_get_display_offset(); @@ -1562,9 +1498,8 @@ GXSetupChipsetFPtr(ScrnInfoPtr pScrn) * ============================== */ void -GeodePointerMoved(POINTER_MOVED_ARGS_DECL) +GeodePointerMoved(ScrnInfoPtr pScrni, int x, int y) { - SCRN_INFO_PTR(arg); GeodeRec *pGeode = GEODEPTR(pScrni); int newX = x, newY = y; @@ -1586,7 +1521,7 @@ GeodePointerMoved(POINTER_MOVED_ARGS_DECL) break; } - (*pGeode->PointerMoved) (POINTER_MOVED_ARGS(newX, newY)); + (*pGeode->PointerMoved) (pScrni, newX, newY); } int @@ -1608,9 +1543,8 @@ GeodeFreeRec(ScrnInfoPtr pScrni) } void -GeodeFreeScreen(FREE_SCREEN_ARGS_DECL) +GeodeFreeScreen(ScrnInfoPtr pScrni) { - SCRN_INFO_PTR(arg); GeodeRec *pGeode = GEODEPTR(pScrni); if (pGeode == NULL) |