Get EXA resizing working and document it.

This commit is contained in:
Aaron Plattner
2007-04-24 20:45:52 -07:00
parent 29433b7696
commit 88d44d5e4f
4 changed files with 38 additions and 5 deletions

View File

@@ -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"

View File

@@ -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()) {

View File

@@ -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;

View File

@@ -60,6 +60,7 @@ typedef struct G80Rec {
/* EXA */
ExaDriverPtr exa;
ExaOffscreenArea *exaScreenArea;
/* DMA command buffer */
CARD32 dmaPut;