Changeset 44000 in vbox
- Timestamp:
- Nov 30, 2012 10:03:19 AM (12 years ago)
- Location:
- trunk/src/VBox/Devices/Graphics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGASavedState.h
r37770 r44000 23 23 #define Graphics_DevVGASavedState_h 24 24 25 #define VGA_SAVEDSTATE_VERSION 8 25 #define VGA_SAVEDSTATE_VERSION 9 26 #define VGA_SAVEDSTATE_VERSION_INV_GCMDFIFO 8 /* <- states upto and including this version may contain invalid completed Guest Commands fifo entries */ 26 27 #define VGA_SAVEDSTATE_VERSION_INV_VHEIGHT 8 /* <- states upto and including this version may contain invalid vbe_regs[VBE_DISPI_INDEX_VIRT_HEIGHT] value */ 27 28 #define VGA_SAVEDSTATE_VERSION_WDDM 7 -
trunk/src/VBox/Devices/Graphics/HGSMI/HGSMIHost.cpp
r43086 r44000 1193 1193 } 1194 1194 1195 static int hgsmiHostSaveGuestCmdCompletedFifoEntryLocked (HGSMIGUESTCOMPLENTRY *pEntry, PSSMHANDLE pSSM) 1196 { 1197 return SSMR3PutU32 (pSSM, pEntry->offBuffer); 1198 } 1199 1200 static int hgsmiHostSaveGuestCmdCompletedFifoLocked (HGSMILIST * pFifo, PSSMHANDLE pSSM) 1201 { 1202 VBOXHGSMI_SAVE_FIFOSTART(pSSM); 1203 uint32_t size = 0; 1204 for(HGSMILISTENTRY * pEntry = pFifo->pHead; pEntry; pEntry = pEntry->pNext) 1205 { 1206 ++size; 1207 } 1208 int rc = SSMR3PutU32 (pSSM, size); 1209 1210 for(HGSMILISTENTRY * pEntry = pFifo->pHead; pEntry && RT_SUCCESS(rc); pEntry = pEntry->pNext) 1211 { 1212 HGSMIGUESTCOMPLENTRY *pFifoEntry = HGSMILISTENTRY_2_HGSMIGUESTCOMPLENTRY(pEntry); 1213 rc = hgsmiHostSaveGuestCmdCompletedFifoEntryLocked (pFifoEntry, pSSM); 1214 } 1215 1216 VBOXHGSMI_SAVE_FIFOSTOP(pSSM); 1217 1218 return rc; 1219 } 1220 1195 1221 static int hgsmiHostLoadFifoEntryLocked (PHGSMIINSTANCE pIns, HGSMIHOSTFIFOENTRY **ppEntry, PSSMHANDLE pSSM) 1196 1222 { … … 1235 1261 } 1236 1262 1263 static int hgsmiHostLoadGuestCmdCompletedFifoEntryLocked (PHGSMIINSTANCE pIns, HGSMIGUESTCOMPLENTRY **ppEntry, PSSMHANDLE pSSM) 1264 { 1265 HGSMIGUESTCOMPLENTRY *pEntry; 1266 int rc = hgsmiGuestCompletionFIFOAlloc (pIns, &pEntry); AssertRC(rc); 1267 if (RT_SUCCESS (rc)) 1268 { 1269 rc = SSMR3GetU32 (pSSM, &pEntry->offBuffer); AssertRC(rc); 1270 if (RT_SUCCESS (rc)) 1271 *ppEntry = pEntry; 1272 else 1273 hgsmiGuestCompletionFIFOFree (pIns, pEntry); 1274 } 1275 return rc; 1276 } 1277 1278 static int hgsmiHostLoadGuestCmdCompletedFifoLocked (PHGSMIINSTANCE pIns, HGSMILIST * pFifo, PSSMHANDLE pSSM, uint32_t u32Version) 1279 { 1280 VBOXHGSMI_LOAD_FIFOSTART(pSSM); 1281 1282 uint32_t size; 1283 int rc = SSMR3GetU32 (pSSM, &size); AssertRC(rc); 1284 if(RT_SUCCESS(rc) && size) 1285 { 1286 if (u32Version > VGA_SAVEDSTATE_VERSION_INV_GCMDFIFO) 1287 { 1288 for(uint32_t i = 0; i < size; ++i) 1289 { 1290 HGSMIGUESTCOMPLENTRY *pFifoEntry = NULL; /* initialized to shut up gcc */ 1291 rc = hgsmiHostLoadGuestCmdCompletedFifoEntryLocked (pIns, &pFifoEntry, pSSM); 1292 AssertRCBreak(rc); 1293 hgsmiListAppend (pFifo, &pFifoEntry->entry); 1294 } 1295 } 1296 else 1297 { 1298 LogRel(("WARNING: the current saved state version has some 3D support data missing, " 1299 "which may lead to some guest applications function unproperly")); 1300 /* just read out all invalid data and discard it */ 1301 for(uint32_t i = 0; i < size; ++i) 1302 { 1303 HGSMIHOSTFIFOENTRY *pFifoEntry = NULL; /* initialized to shut up gcc */ 1304 rc = hgsmiHostLoadFifoEntryLocked (pIns, &pFifoEntry, pSSM); 1305 AssertRCBreak(rc); 1306 hgsmiHostFIFOFree (pIns, pFifoEntry); 1307 } 1308 } 1309 } 1310 1311 VBOXHGSMI_LOAD_FIFOSTOP(pSSM); 1312 1313 return rc; 1314 } 1315 1237 1316 int HGSMIHostSaveStateExec (PHGSMIINSTANCE pIns, PSSMHANDLE pSSM) 1238 1317 { … … 1240 1319 1241 1320 int rc; 1242 1243 1321 1244 1322 HGSMIOFFSET off = pIns->pHGFlags ? HGSMIPointerToOffset(&pIns->area, (const HGSMIBUFFERHEADER *)pIns->pHGFlags) : HGSMIOFFSET_VOID; … … 1260 1338 rc = hgsmiHostSaveFifoLocked (&pIns->hostFIFOProcessed, pSSM); AssertRC(rc); 1261 1339 #ifdef VBOX_WITH_WDDM 1262 rc = hgsmiHostSave FifoLocked (&pIns->guestCmdCompleted, pSSM); AssertRC(rc);1340 rc = hgsmiHostSaveGuestCmdCompletedFifoLocked (&pIns->guestCmdCompleted, pSSM); AssertRC(rc); 1263 1341 #endif 1264 1342 … … 1327 1405 #ifdef VBOX_WITH_WDDM 1328 1406 if (RT_SUCCESS(rc) && u32Version > VGA_SAVEDSTATE_VERSION_PRE_WDDM) 1329 rc = hgsmiHostLoad FifoLocked (pIns, &pIns->hostFIFOProcessed, pSSM);1407 rc = hgsmiHostLoadGuestCmdCompletedFifoLocked (pIns, &pIns->guestCmdCompleted, pSSM, u32Version); 1330 1408 #endif 1331 1409
Note:
See TracChangeset
for help on using the changeset viewer.