diff options
author | Philip Langdale <philipl@fido2.homeip.net> | 2007-02-08 10:33:14 -0800 |
---|---|---|
committer | Philip Langdale <philipl@fido2.homeip.net> | 2007-02-08 10:33:14 -0800 |
commit | 3dc1ebc7c2c76f575b5150f1890ec13f8bd3e8a1 (patch) | |
tree | 10facee087470dbf8ce90ee5ebebe7793e819504 | |
parent | 188c2b44f0f47093092414f9364a52cc2d5016ad (diff) |
Make resizing work once and for all.
This change removes the limitation on resizing larger than the
initial size and removes the need for pitch-locking bu resizing
the screen pixmap. Now the only limit on the screen size is
the maximum width/height reported by the virtual hardware which
is configured on the host side.
-rw-r--r-- | src/vmware.c | 56 | ||||
-rw-r--r-- | src/vmware.h | 2 | ||||
-rw-r--r-- | src/vmwarectrl.c | 23 |
3 files changed, 35 insertions, 46 deletions
diff --git a/src/vmware.c b/src/vmware.c index 9ba73b8..9075326 100644 --- a/src/vmware.c +++ b/src/vmware.c @@ -280,23 +280,6 @@ vmwareSendSVGACmdUpdateFullScreen(VMWAREPtr pVMWARE) vmwareSendSVGACmdUpdate(pVMWARE, &BB); } -static void -vmwareSetPitchLock(VMWAREPtr pVMWARE, unsigned long fbPitch) -{ - CARD32 *vmwareFIFO = pVMWARE->vmwareFIFO; - - VmwareLog(("Attempting to set pitchlock\n")); - - if (pVMWARE->vmwareCapability & SVGA_CAP_PITCHLOCK) { - VmwareLog(("Using PitchLock register\n")); - vmwareWriteReg(pVMWARE, SVGA_REG_PITCHLOCK, fbPitch); - } else if (pVMWARE->hasPitchLockFIFOReg && - vmwareFIFO[SVGA_FIFO_MIN] >= (vmwareReadReg(pVMWARE, SVGA_REG_MEM_REGS) << 2)) { - VmwareLog(("Using PitchLock FIFO register\n")); - vmwareFIFO[SVGA_FIFO_PITCHLOCK] = fbPitch; - } -} - static CARD32 vmwareCalculateWeight(CARD32 mask) { @@ -1101,7 +1084,7 @@ VMWARERestore(ScrnInfoPtr pScrn) } static Bool -VMWAREModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) +VMWAREModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool rebuildPixmap) { vgaHWPtr hwp = VGAHWPTR(pScrn); vgaRegPtr vgaReg = &hwp->ModeReg; @@ -1140,6 +1123,20 @@ VMWAREModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) VmwareLog(("fbSize: %u\n", pVMWARE->FbSize)); VmwareLog(("New dispWidth: %u\n", pScrn->displayWidth)); + if (rebuildPixmap) { + pScrn->pScreen->ModifyPixmapHeader((*pScrn->pScreen->GetScreenPixmap)(pScrn->pScreen), + pScrn->pScreen->width, + pScrn->pScreen->height, + pScrn->pScreen->rootDepth, + pScrn->bitsPerPixel, + PixmapBytePad(pScrn->displayWidth, + pScrn->pScreen->rootDepth), + (pointer)(pVMWARE->FbBase + pScrn->fbOffset)); + + (*pScrn->EnableDisableFBAccess)(pScrn->pScreen->myNum, FALSE); + (*pScrn->EnableDisableFBAccess)(pScrn->pScreen->myNum, TRUE); + } + vgaHWProtect(pScrn, FALSE); /* @@ -1218,9 +1215,6 @@ VMWAREInitFIFO(ScrnInfoPtr pScrn) vmwareFIFO[SVGA_FIFO_NEXT_CMD] = min * sizeof(CARD32); vmwareFIFO[SVGA_FIFO_STOP] = min * sizeof(CARD32); vmwareWriteReg(pVMWARE, SVGA_REG_CONFIG_DONE, 1); - - pVMWARE->hasPitchLockFIFOReg = - extendedFifo && (vmwareFIFO[SVGA_FIFO_CAPABILITIES] & SVGA_FIFO_CAP_PITCHLOCK); } static void @@ -1252,8 +1246,6 @@ VMWARECloseScreen(int scrnIndex, ScreenPtr pScreen) vmwareXAACloseScreen(pScreen); } - vmwareSetPitchLock(pVMWARE, 0); - VMWARERestore(pScrn); VMWAREUnmapMem(pScrn); @@ -1450,9 +1442,7 @@ VMWAREScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) VMWAREInitFIFO(pScrn); /* Initialise the first mode */ - VMWAREModeInit(pScrn, pScrn->currentMode); - - vmwareSetPitchLock(pVMWARE, pVMWARE->fbPitch); + VMWAREModeInit(pScrn, pScrn->currentMode, FALSE); /* Set the viewport if supported */ VMWAREAdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); @@ -1610,12 +1600,6 @@ VMWAREScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) } /* - * The initial mode that fixes the framebuffer is the current mode - * at ScreenInit time. - */ - pVMWARE->initialMode = pScrn->currentMode; - - /* * We will lazily add the dynamic modes as the are needed when new * modes are requested through the control extension. */ @@ -1638,7 +1622,7 @@ VMWAREScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) static Bool VMWARESwitchMode(int scrnIndex, DisplayModePtr mode, int flags) { - return VMWAREModeInit(xf86Screens[scrnIndex], mode); + return VMWAREModeInit(xf86Screens[scrnIndex], mode, TRUE); } static Bool @@ -1651,9 +1635,7 @@ VMWAREEnterVT(int scrnIndex, int flags) VMWAREInitFIFO(pScrn); } - vmwareSetPitchLock(pVMWARE, pVMWARE->fbPitch); - - return VMWAREModeInit(pScrn, pScrn->currentMode); + return VMWAREModeInit(pScrn, pScrn->currentMode, TRUE); } static void @@ -1662,8 +1644,6 @@ VMWARELeaveVT(int scrnIndex, int flags) ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; VMWAREPtr pVMWARE = VMWAREPTR(pScrn); - vmwareSetPitchLock(pVMWARE, 0); - VMWARERestore(pScrn); } diff --git a/src/vmware.h b/src/vmware.h index 7f138a6..159e374 100644 --- a/src/vmware.h +++ b/src/vmware.h @@ -81,7 +81,6 @@ typedef struct { VMWARERegRec SavedReg; VMWARERegRec ModeReg; - DisplayModePtr initialMode; DisplayModePtr dynMode1; DisplayModePtr dynMode2; @@ -107,7 +106,6 @@ typedef struct { unsigned char* mmioVirtBase; CARD32* vmwareFIFO; - Bool hasPitchLockFIFOReg; xf86CursorInfoPtr CursorInfoRec; struct { diff --git a/src/vmwarectrl.c b/src/vmwarectrl.c index f57ad7e..f2c831d 100644 --- a/src/vmwarectrl.c +++ b/src/vmwarectrl.c @@ -113,18 +113,27 @@ VMwareCtrlQueryVersion(ClientPtr client) static Bool VMwareCtrlDoSetRes(ScrnInfoPtr pScrn, CARD32 x, - CARD32 y) + CARD32 y, + Bool resetXinerama) { DisplayModePtr mode; VMWAREPtr pVMWARE = VMWAREPTR(pScrn); - + if (pScrn && pScrn->modes) { + VmwareLog(("DoSetRes: %d %d\n", x, y)); + + if (resetXinerama) { + xfree(pVMWARE->xineramaNextState); + pVMWARE->xineramaNextState = NULL; + pVMWARE->xineramaNextNumOutputs = 0; + } + /* * Don't resize larger than possible but don't * return an X Error either. */ - if (x > pVMWARE->initialMode->HDisplay || - y > pVMWARE->initialMode->VDisplay) { + if (x > pVMWARE->maxWidth || + y > pVMWARE->maxHeight) { return TRUE; } @@ -191,7 +200,7 @@ VMwareCtrlSetRes(ClientPtr client) return BadMatch; } - if (!VMwareCtrlDoSetRes(pScrn, stuff->x, stuff->y)) { + if (!VMwareCtrlDoSetRes(pScrn, stuff->x, stuff->y, TRUE)) { return BadValue; } @@ -250,6 +259,8 @@ VMwareCtrlDoSetTopology(ScrnInfoPtr pScrn, maxY = MAX(maxY, extents[i].y_org + extents[i].height); } + VmwareLog(("DoSetTopology: %d %d\n", maxX, maxY)); + xineramaState = (VMWAREXineramaPtr)xcalloc(number, sizeof(VMWAREXineramaRec)); if (xineramaState) { memcpy(xineramaState, extents, number * sizeof (VMWAREXineramaRec)); @@ -258,7 +269,7 @@ VMwareCtrlDoSetTopology(ScrnInfoPtr pScrn, pVMWARE->xineramaNextState = xineramaState; pVMWARE->xineramaNextNumOutputs = number; - return VMwareCtrlDoSetRes(pScrn, maxX, maxY); + return VMwareCtrlDoSetRes(pScrn, maxX, maxY, FALSE); } else { return FALSE; } |