diff options
-rw-r--r-- | src/vmware.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/vmware.c b/src/vmware.c index baa302d..15363e4 100644 --- a/src/vmware.c +++ b/src/vmware.c @@ -151,6 +151,7 @@ static const OptionInfoRec VMWAREOptions[] = { }; static void VMWAREStopFIFO(ScrnInfoPtr pScrn); +static void VMWARESave(ScrnInfoPtr pScrn); static Bool VMWAREGetRec(ScrnInfoPtr pScrn) @@ -435,13 +436,6 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int flags) "VMware SVGA regs at (0x%04lx, 0x%04lx)\n", pVMWARE->indexReg, pVMWARE->valueReg); - id = VMXGetVMwareSvgaId(pVMWARE); - if (id == SVGA_ID_0 || id == SVGA_ID_INVALID) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "No supported VMware SVGA found (read ID 0x%08x).\n", id); - return FALSE; - } - if (!xf86LoadSubModule(pScrn, "vgahw")) { return FALSE; } @@ -452,6 +446,19 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int flags) return FALSE; } + /* + * Save the current video state. Do it here before VMXGetVMwareSvgaId + * writes to any registers. + */ + VMWARESave(pScrn); + + id = VMXGetVMwareSvgaId(pVMWARE); + if (id == SVGA_ID_0 || id == SVGA_ID_INVALID) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "No supported VMware SVGA found (read ID 0x%08x).\n", id); + return FALSE; + } + pVMWARE->PciTag = pciTag(pVMWARE->PciInfo->bus, pVMWARE->PciInfo->device, pVMWARE->PciInfo->func); pVMWARE->Primary = xf86IsPrimaryPci(pVMWARE->PciInfo); @@ -1124,9 +1131,6 @@ VMWAREScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) hwp = VGAHWPTR(pScrn); vgaHWGetIOBase(hwp); - /* Save the current video state */ - VMWARESave(pScrn); - VMWAREInitFIFO(pScrn); /* Initialise the first mode */ |