diff options
author | Aaron Plattner <aplattner@nvidia.com> | 2007-04-24 20:45:52 -0700 |
---|---|---|
committer | Aaron Plattner <aplattner@nvidia.com> | 2007-04-24 20:45:52 -0700 |
commit | 88d44d5e4fd0025c30e9d67b55c603c59bd1c0c1 (patch) | |
tree | a61e37c8f43f66ccfb7c88a260436277c380a8ec | |
parent | 29433b76969b73a2a22081bf965bb0cdbaad75af (diff) |
Get EXA resizing working and document it.
-rw-r--r-- | man/nv.man | 9 | ||||
-rw-r--r-- | src/g80_driver.c | 31 | ||||
-rw-r--r-- | src/g80_exa.c | 2 | ||||
-rw-r--r-- | src/g80_type.h | 1 |
4 files changed, 38 insertions, 5 deletions
@@ -143,6 +143,15 @@ Enable or disable the hardware cursor. Default: on. .TP .BI "Option \*qNoAccel\*q \*q" boolean \*q Disable or enable acceleration. Default: acceleration is enabled. +.TP +.BI "Option \*qAccelMethod\*q \*q" string \*q +Choose acceleration architecture, either \*qXAA\*q or \*qEXA\*q. +XAA is the old but stable architecture. +EXA is newer and supports resizing the desktop larger than it started out with RandR 1.2. +If you choose to use EXA, you might also consider setting +.B Option \*qMigrationHeuristic\*q \*qgreedy\*q +to improve performance. +Default: XAA. .\" ******************** end G80 section ******************** . .SH "SEE ALSO" diff --git a/src/g80_driver.c b/src/g80_driver.c index 3e93237..c81388c 100644 --- a/src/g80_driver.c +++ b/src/g80_driver.c @@ -133,6 +133,7 @@ G80FreeRec(ScrnInfoPtr pScrn) static Bool G80ResizeScreen(ScrnInfoPtr pScrn, int width, int height) { + ScreenPtr pScreen = pScrn->pScreen; G80Ptr pNv = G80PTR(pScrn); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); int pitch = width * (pScrn->bitsPerPixel / 8); @@ -143,8 +144,8 @@ G80ResizeScreen(ScrnInfoPtr pScrn, int width, int height) pScrn->virtualX = width; pScrn->virtualY = height; - /* Can resize if XAA is disabled */ - if(!pNv->xaa) { + /* Can resize if XAA is disabled or EXA is enabled */ + if(!pNv->xaa || pNv->exa) { (*pScrn->pScreen->GetScreenPixmap)(pScrn->pScreen)->devKind = pitch; pScrn->displayWidth = pitch / (pScrn->bitsPerPixel / 8); @@ -156,6 +157,23 @@ G80ResizeScreen(ScrnInfoPtr pScrn, int width, int height) } } + /* + * If EXA is enabled, use exaOffscreenAlloc to carve out a chunk of memory + * for the screen. + */ + if(pNv->exa) { + if(pNv->exaScreenArea) + exaOffscreenFree(pScreen, pNv->exaScreenArea); + pNv->exaScreenArea = exaOffscreenAlloc(pScreen, pitch * pScrn->virtualY, + 256, TRUE, NULL, NULL); + if(!pNv->exaScreenArea || pNv->exaScreenArea->offset != 0) { + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Failed to reserve EXA memory for the screen or EXA " + "returned an area with a nonzero offset. Don't be " + "surprised if your screen is corrupt.\n"); + } + } + return TRUE; } @@ -362,7 +380,7 @@ G80PreInit(ScrnInfoPtr pScrn, int flags) G80DispCreateCrtcs(pScrn); /* We can grow the desktop if XAA is disabled */ - if(!xf86InitialConfiguration(pScrn, pNv->NoAccel)) { + if(!xf86InitialConfiguration(pScrn, pNv->NoAccel || pNv->AccelMethod == EXA)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid initial configuration found\n"); goto fail; @@ -469,8 +487,13 @@ G80CloseScreen(int scrnIndex, ScreenPtr pScreen) if(pNv->xaa) XAADestroyInfoRec(pNv->xaa); - if(pNv->exa) + if(pNv->exa) { + if(pNv->exaScreenArea) { + exaOffscreenFree(pScreen, pNv->exaScreenArea); + pNv->exaScreenArea = NULL; + } exaDriverFini(pScrn->pScreen); + } xf86_cursors_fini(pScreen); if(xf86ServerIsExiting()) { diff --git a/src/g80_exa.c b/src/g80_exa.c index 8113c1a..96dbc21 100644 --- a/src/g80_exa.c +++ b/src/g80_exa.c @@ -302,7 +302,7 @@ Bool G80ExaInit(ScreenPtr pScreen, ScrnInfoPtr pScrn) exa->exa_major = EXA_VERSION_MAJOR; exa->exa_minor = EXA_VERSION_MINOR; exa->memoryBase = pNv->mem; - exa->offScreenBase = pitch * pScrn->virtualY; + exa->offScreenBase = 0; exa->memorySize = pitch * pNv->offscreenHeight; exa->pixmapOffsetAlign = 256; exa->pixmapPitchAlign = 256; diff --git a/src/g80_type.h b/src/g80_type.h index 17acf93..15b8792 100644 --- a/src/g80_type.h +++ b/src/g80_type.h @@ -60,6 +60,7 @@ typedef struct G80Rec { /* EXA */ ExaDriverPtr exa; + ExaOffscreenArea *exaScreenArea; /* DMA command buffer */ CARD32 dmaPut; |