summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/vmware.c17
-rw-r--r--src/vmware.h1
2 files changed, 17 insertions, 1 deletions
diff --git a/src/vmware.c b/src/vmware.c
index ef2dedb..069cf2c 100644
--- a/src/vmware.c
+++ b/src/vmware.c
@@ -652,6 +652,7 @@ VMWAREPreInit(ScrnInfoPtr pScrn, int flags)
"No supported VMware SVGA found (read ID 0x%08x).\n", id);
return FALSE;
}
+ pVMWARE->suspensionSavedRegId = id;
#if !XSERVER_LIBPCIACCESS
pVMWARE->PciTag = pciTag(pVMWARE->PciInfo->bus, pVMWARE->PciInfo->device,
@@ -1820,7 +1821,13 @@ VMWAREEnterVT(int scrnIndex, int flags)
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
VMWAREPtr pVMWARE = VMWAREPTR(pScrn);
- if (!pVMWARE->SavedReg.svga_fifo_enabled) {
+ /*
+ * After system resumes from hiberation, EnterVT will be called and this
+ * is a good place to restore the SVGA ID register.
+ */
+ vmwareWriteReg(pVMWARE, SVGA_REG_ID, pVMWARE->suspensionSavedRegId);
+
+ if (!pVMWARE->SavedReg.svga_fifo_enabled) {
VMWAREInitFIFO(pScrn);
}
@@ -1831,6 +1838,14 @@ static void
VMWARELeaveVT(int scrnIndex, int flags)
{
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ VMWAREPtr pVMWARE = VMWAREPTR(pScrn);
+
+ /*
+ * Before shutting down system for hibneration, LeaveVT will be called,
+ * we save the ID register value here and later restore it in EnterVT.
+ */
+ pVMWARE->suspensionSavedRegId = vmwareReadReg(pVMWARE, SVGA_REG_ID);
+
VMWARERestore(pScrn);
}
diff --git a/src/vmware.h b/src/vmware.h
index 57872b2..b906ff2 100644
--- a/src/vmware.h
+++ b/src/vmware.h
@@ -102,6 +102,7 @@ typedef struct {
VMWARERegRec SavedReg;
VMWARERegRec ModeReg;
+ CARD32 suspensionSavedRegId;
DisplayModePtr dynModes[NUM_DYN_MODES];