Changeset 22480 in vbox for trunk/src/VBox/Main/DisplayImpl.cpp
- Timestamp:
- Aug 26, 2009 5:14:13 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 51500
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/DisplayImpl.cpp
r22443 r22480 116 116 */ 117 117 DECLCALLBACK(void) 118 Display::displaySSMSave 118 Display::displaySSMSave(PSSMHANDLE pSSM, void *pvUser) 119 119 { 120 120 Display *that = static_cast<Display*>(pvUser); 121 121 122 int rc = SSMR3PutU32 (pSSM, that->mcMonitors); 123 AssertRC(rc); 124 122 SSMR3PutU32(pSSM, that->mcMonitors); 125 123 for (unsigned i = 0; i < that->mcMonitors; i++) 126 124 { 127 rc = SSMR3PutU32 (pSSM, that->maFramebuffers[i].u32Offset); 128 AssertRC(rc); 129 rc = SSMR3PutU32 (pSSM, that->maFramebuffers[i].u32MaxFramebufferSize); 130 AssertRC(rc); 131 rc = SSMR3PutU32 (pSSM, that->maFramebuffers[i].u32InformationSize); 132 AssertRC(rc); 125 SSMR3PutU32(pSSM, that->maFramebuffers[i].u32Offset); 126 SSMR3PutU32(pSSM, that->maFramebuffers[i].u32MaxFramebufferSize); 127 SSMR3PutU32(pSSM, that->maFramebuffers[i].u32InformationSize); 133 128 } 134 129 } 135 130 136 131 DECLCALLBACK(int) 137 Display::displaySSMLoad (PSSMHANDLE pSSM, void *pvUser, uint32_t u32Version)132 Display::displaySSMLoad(PSSMHANDLE pSSM, void *pvUser, uint32_t uVersion, uint32_t uPhase) 138 133 { 139 134 Display *that = static_cast<Display*>(pvUser); 135 136 if (uVersion != sSSMDisplayVer) 137 return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION; 138 140 139 uint32_t cMonitors; 141 142 if (u32Version != sSSMDisplayVer) 143 return VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION; 144 145 int rc = SSMR3GetU32 (pSSM, &cMonitors); 140 int rc = SSMR3GetU32(pSSM, &cMonitors); 146 141 if (cMonitors != that->mcMonitors) 147 142 { 148 143 LogRel(("Display: Number of monitors changed (%d->%d)!\n", 149 144 cMonitors, that->mcMonitors)); 150 145 return VERR_SSM_LOAD_CONFIG_MISMATCH; 151 146 } 152 147 153 for (unsigned i = 0; i < cMonitors; i++) 154 { 155 rc = SSMR3GetU32 (pSSM, &that->maFramebuffers[i].u32Offset); 156 AssertRC(rc); 157 rc = SSMR3GetU32 (pSSM, &that->maFramebuffers[i].u32MaxFramebufferSize); 158 AssertRC(rc); 159 rc = SSMR3GetU32 (pSSM, &that->maFramebuffers[i].u32InformationSize); 160 AssertRC(rc); 148 for (uint32_t i = 0; i < cMonitors; i++) 149 { 150 SSMR3GetU32(pSSM, &that->maFramebuffers[i].u32Offset); 151 SSMR3GetU32(pSSM, &that->maFramebuffers[i].u32MaxFramebufferSize); 152 SSMR3GetU32(pSSM, &that->maFramebuffers[i].u32InformationSize); 161 153 } 162 154 … … 262 254 int Display::registerSSM(PVM pVM) 263 255 { 264 return SSMR3RegisterExternal(pVM, "DisplayData", 3*sizeof(uint32_t*), 265 sSSMDisplayVer, 0, 266 NULL, displaySSMSave, NULL, 267 NULL, displaySSMLoad, NULL, this); 256 int rc = SSMR3RegisterExternal(pVM, "DisplayData", 0, sSSMDisplayVer, 257 mcMonitors * sizeof(uint32_t) * 3 + sizeof(uint32_t), 258 NULL, NULL, NULL, 259 NULL, displaySSMSave, NULL, 260 NULL, displaySSMLoad, NULL, this); 261 262 AssertRCReturn(rc, rc); 263 264 /* 265 * Register loaders for old saved states where iInstance was 3 * sizeof(uint32_t *). 266 */ 267 rc = SSMR3RegisterExternal(pVM, "DisplayData", 12 /*uInstance*/, sSSMDisplayVer, 0 /*cbGuess*/, 268 NULL, NULL, NULL, 269 NULL, NULL, NULL, 270 NULL, displaySSMLoad, NULL, this); 271 AssertRCReturn(rc, rc); 272 273 rc = SSMR3RegisterExternal(pVM, "DisplayData", 24 /*uInstance*/, sSSMDisplayVer, 0 /*cbGuess*/, 274 NULL, NULL, NULL, 275 NULL, NULL, NULL, 276 NULL, displaySSMLoad, NULL, this); 277 AssertRCReturn(rc, rc); 278 return VINF_SUCCESS; 268 279 } 269 280 … … 2393 2404 2394 2405 pThis->maFramebuffers[uScreenId].fVBVAEnabled = true; 2395 2406 2396 2407 return VINF_SUCCESS; 2397 2408 } … … 2547 2558 if (!CFGMR3AreValuesValid(pCfgHandle, "Object\0")) 2548 2559 return VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES; 2549 AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER, 2560 AssertMsgReturn(PDMDrvHlpNoAttach(pDrvIns) == VERR_PDM_NO_ATTACHED_DRIVER, 2550 2561 ("Configuration error: Not possible to attach anything to this driver!\n"), 2551 2562 VERR_PDM_DRVINS_NO_ATTACH); … … 2657 2668 NULL, 2658 2669 /* pfnDetach */ 2659 NULL, 2670 NULL, 2660 2671 /* pfnPowerOff */ 2661 NULL, 2672 NULL, 2662 2673 /* pfnSoftReset */ 2663 2674 NULL,
Note:
See TracChangeset
for help on using the changeset viewer.