diff options
Diffstat (limited to 'src/vmware.c')
-rw-r--r-- | src/vmware.c | 41 |
1 files changed, 36 insertions, 5 deletions
diff --git a/src/vmware.c b/src/vmware.c index 587a51e..1359143 100644 --- a/src/vmware.c +++ b/src/vmware.c @@ -63,8 +63,8 @@ char rcsId_vmware[] = #define VMWARE_NAME "VMWARE" #define VMWARE_DRIVER_NAME "vmware" #define VMWARE_MAJOR_VERSION 10 -#define VMWARE_MINOR_VERSION 10 -#define VMWARE_PATCHLEVEL 2 +#define VMWARE_MINOR_VERSION 11 +#define VMWARE_PATCHLEVEL 0 #define VERSION (VMWARE_MAJOR_VERSION * 65536 + VMWARE_MINOR_VERSION * 256 + VMWARE_PATCHLEVEL) static const char VMWAREBuildStr[] = "VMware Guest X Server " @@ -257,6 +257,17 @@ vmwareSendSVGACmdUpdateFullScreen(VMWAREPtr pVMWARE) vmwareSendSVGACmdUpdate(pVMWARE, &BB); } +static void +vmwareSendSVGACmdPitchLock(VMWAREPtr pVMWARE, unsigned long fbPitch) +{ + CARD32 *vmwareFIFO = pVMWARE->vmwareFIFO; + + if (pVMWARE->canPitchLock && vmwareFIFO[SVGA_FIFO_MIN] >= + (vmwareReadReg(pVMWARE, SVGA_REG_MEM_REGS) << 2)) { + vmwareFIFO[SVGA_FIFO_PITCHLOCK] = fbPitch; + } +} + static CARD32 vmwareCalculateWeight(CARD32 mask) { @@ -967,6 +978,8 @@ VMWAREInitFIFO(ScrnInfoPtr pScrn) { VMWAREPtr pVMWARE = VMWAREPTR(pScrn); CARD32* vmwareFIFO; + Bool extendedFifo; + int min; TRACEPOINT @@ -977,11 +990,18 @@ VMWAREInitFIFO(ScrnInfoPtr pScrn) pVMWARE->mmioPhysBase, pVMWARE->mmioSize); vmwareFIFO = pVMWARE->vmwareFIFO = (CARD32*)pVMWARE->mmioVirtBase; - vmwareFIFO[SVGA_FIFO_MIN] = 4 * sizeof(CARD32); + + extendedFifo = pVMWARE->vmwareCapability & SVGA_CAP_EXTENDED_FIFO; + min = extendedFifo ? vmwareReadReg(pVMWARE, SVGA_REG_MEM_REGS) : 4; + + vmwareFIFO[SVGA_FIFO_MIN] = min * sizeof(CARD32); vmwareFIFO[SVGA_FIFO_MAX] = pVMWARE->mmioSize; - vmwareFIFO[SVGA_FIFO_NEXT_CMD] = 4 * sizeof(CARD32); - vmwareFIFO[SVGA_FIFO_STOP] = 4 * sizeof(CARD32); + vmwareFIFO[SVGA_FIFO_NEXT_CMD] = min * sizeof(CARD32); + vmwareFIFO[SVGA_FIFO_STOP] = min * sizeof(CARD32); vmwareWriteReg(pVMWARE, SVGA_REG_CONFIG_DONE, 1); + + pVMWARE->canPitchLock = + extendedFifo && (vmwareFIFO[SVGA_FIFO_CAPABILITIES] & SVGA_FIFO_CAP_PITCHLOCK); } static void @@ -1013,6 +1033,8 @@ VMWARECloseScreen(int scrnIndex, ScreenPtr pScreen) vmwareXAACloseScreen(pScreen); } + vmwareSendSVGACmdPitchLock(pVMWARE, 0); + VMWARERestore(pScrn); VMWAREUnmapMem(pScrn); @@ -1140,6 +1162,8 @@ VMWAREScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) /* Initialise the first mode */ VMWAREModeInit(pScrn, pScrn->currentMode); + vmwareSendSVGACmdPitchLock(pVMWARE, pVMWARE->fbPitch); + /* Set the viewport if supported */ VMWAREAdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); @@ -1319,6 +1343,9 @@ VMWAREEnterVT(int scrnIndex, int flags) if (!pVMWARE->SavedReg.svga_fifo_enabled) { VMWAREInitFIFO(pScrn); } + + vmwareSendSVGACmdPitchLock(pVMWARE, pVMWARE->fbPitch); + return VMWAREModeInit(pScrn, pScrn->currentMode); } @@ -1326,6 +1353,10 @@ static void VMWARELeaveVT(int scrnIndex, int flags) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + VMWAREPtr pVMWARE = VMWAREPTR(pScrn); + + vmwareSendSVGACmdPitchLock(pVMWARE, 0); + VMWARERestore(pScrn); } |