Changeset 62932 in vbox for trunk/src/VBox/Devices/Graphics/HGSMI
- Timestamp:
- Aug 3, 2016 4:50:15 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/HGSMI/HGSMIHost.cpp
r62514 r62932 91 91 #define VBOXHGSMI_STATE_FIFOSTOP_MAGIC 0x1fedcba9 92 92 93 #define VBOXHGSMI_SAVE_START(_pSSM) do{ int rc2 = SSMR3PutU32(_pSSM, VBOXHGSMI_STATE_START_MAGIC); AssertRC(rc2);}while(0)94 #define VBOXHGSMI_SAVE_STOP(_pSSM) do{ int rc2 = SSMR3PutU32(_pSSM, VBOXHGSMI_STATE_STOP_MAGIC); AssertRC(rc2);}while(0)95 #define VBOXHGSMI_SAVE_FIFOSTART(_pSSM) do{ int rc2 = SSMR3PutU32(_pSSM, VBOXHGSMI_STATE_FIFOSTART_MAGIC); AssertRC(rc2);}while(0)96 #define VBOXHGSMI_SAVE_FIFOSTOP(_pSSM) do{ int rc2 = SSMR3PutU32(_pSSM, VBOXHGSMI_STATE_FIFOSTOP_MAGIC); AssertRC(rc2);}while(0)93 #define VBOXHGSMI_SAVE_START(_pSSM) do{ int rc2 = SSMR3PutU32(_pSSM, VBOXHGSMI_STATE_START_MAGIC); AssertRC(rc2); }while(0) 94 #define VBOXHGSMI_SAVE_STOP(_pSSM) do{ int rc2 = SSMR3PutU32(_pSSM, VBOXHGSMI_STATE_STOP_MAGIC); AssertRC(rc2); }while(0) 95 #define VBOXHGSMI_SAVE_FIFOSTART(_pSSM) do{ int rc2 = SSMR3PutU32(_pSSM, VBOXHGSMI_STATE_FIFOSTART_MAGIC); AssertRC(rc2); }while(0) 96 #define VBOXHGSMI_SAVE_FIFOSTOP(_pSSM) do{ int rc2 = SSMR3PutU32(_pSSM, VBOXHGSMI_STATE_FIFOSTOP_MAGIC); AssertRC(rc2); }while(0) 97 97 98 98 #define VBOXHGSMI_LOAD_CHECK(_pSSM, _v) \ … … 304 304 if (RTListIsEmpty(&pIns->guestCmdCompleted)) 305 305 { 306 if(pIns->pHGFlags) 307 { 306 if (pIns->pHGFlags) 308 307 ASMAtomicAndU32(&pIns->pHGFlags->u32HostFlags, ~HGSMIHOSTFLAGS_GCOMMAND_COMPLETED); 309 }310 308 } 311 309 … … 355 353 356 354 int rc = hgsmiFIFOLock(pIns); 357 if (RT_SUCCESS(rc))355 if (RT_SUCCESS(rc)) 358 356 { 359 357 /* Search the Read list for the given buffer offset. */ … … 392 390 393 391 hgsmiFIFOUnlock(pIns); 394 if (!bCompleteFirst)392 if (!bCompleteFirst) 395 393 LogRel(("HGSMI[%s]: ignored invalid write to the host FIFO: 0x%08X!!!\n", pIns->pszName, offBuffer)); 396 394 } … … 420 418 VM_ASSERT_EMT(pIns->pVM); 421 419 422 AssertPtrReturn(pIns->pHGFlags, VERR_WRONG_ORDER);420 AssertPtrReturn(pIns->pHGFlags, HGSMIOFFSET_VOID); 423 421 int rc = hgsmiFIFOLock(pIns); 424 422 AssertRC(rc); 425 if (RT_SUCCESS(rc))423 if (RT_SUCCESS(rc)) 426 424 { 427 425 /* Get the host FIFO head entry. */ … … 454 452 return pEntry->offBuffer; 455 453 } 454 456 455 hgsmiFIFOUnlock(pIns); 457 456 } … … 723 722 HGSMIINSTANCE *pIns = pEntry->pIns; 724 723 int rc = hgsmiFIFOLock (pIns); 725 if (RT_SUCCESS(rc))724 if (RT_SUCCESS(rc)) 726 725 { 727 726 RTListNodeRemove(&pEntry->nodeEntry); … … 731 730 732 731 rc = hgsmiHostHeapLock (pIns); 733 if (RT_SUCCESS(rc))732 if (RT_SUCCESS(rc)) 734 733 { 735 734 /* Deallocate the host heap memory. */ … … 1292 1291 hgsmiHostHeapHandleLocationOffset(&pIns->hostHeap); 1293 1292 rc = SSMR3PutU32 (pSSM, off); 1294 if (off != HGSMIOFFSET_VOID)1293 if (off != HGSMIOFFSET_VOID) 1295 1294 { 1296 1295 SSMR3PutU32 (pSSM, hgsmiHostHeapOffset(&pIns->hostHeap)); … … 1299 1298 SSMR3PutU64 (pSSM, (uint64_t)(uintptr_t)pIns->area.pu8Base); 1300 1299 rc = hgsmiFIFOLock (pIns); 1301 if (RT_SUCCESS(rc))1300 if (RT_SUCCESS(rc)) 1302 1301 { 1303 1302 rc = hgsmiHostSaveFifoLocked (&pIns->hostFIFO, pSSM); AssertRC(rc); … … 1327 1326 int HGSMIHostLoadStateExec (PHGSMIINSTANCE pIns, PSSMHANDLE pSSM, uint32_t u32Version) 1328 1327 { 1329 if (u32Version < VGA_SAVEDSTATE_VERSION_HGSMI)1328 if (u32Version < VGA_SAVEDSTATE_VERSION_HGSMI) 1330 1329 return VINF_SUCCESS; 1331 1330 … … 1346 1345 pIns->pHGFlags = (off != HGSMIOFFSET_VOID) ? (HGSMIHOSTFLAGS*)HGSMIOffsetToPointer (&pIns->area, off) : NULL; 1347 1346 1348 HGSMIHOSTHEAP hHeap = pIns->hostHeap;1349 1347 rc = SSMR3GetU32(pSSM, &off); 1350 1348 AssertLogRelRCReturn(rc, rc); 1351 if (off != HGSMIOFFSET_VOID)1349 if (off != HGSMIOFFSET_VOID) 1352 1350 { 1353 1351 /* There is a saved heap. */ … … 1370 1368 { 1371 1369 rc = hgsmiFIFOLock (pIns); 1372 if (RT_SUCCESS(rc))1370 if (RT_SUCCESS(rc)) 1373 1371 { 1374 1372 rc = hgsmiHostLoadFifoLocked (pIns, &pIns->hostFIFO, pSSM); … … 1440 1438 */ 1441 1439 1442 static int hgsmiChannelMapCreate (PHGSMIINSTANCE pIns, 1443 const char *pszChannel, 1444 uint8_t *pu8Channel) 1445 { 1446 /* @todo later */ 1440 static int hgsmiChannelMapCreate(PHGSMIINSTANCE pIns, const char *pszChannel, uint8_t *pu8Channel) 1441 { 1442 RT_NOREF(pIns, pszChannel, pu8Channel); 1443 /** @todo later */ 1447 1444 return VERR_NOT_SUPPORTED; 1448 1445 } … … 1478 1475 /* Register a new HGSMI channel by name. 1479 1476 */ 1480 int HGSMIChannelRegisterName 1481 1482 1483 1484 1477 int HGSMIChannelRegisterName(PHGSMIINSTANCE pIns, 1478 const char *pszChannel, 1479 PFNHGSMICHANNELHANDLER pfnChannelHandler, 1480 void *pvChannelHandler, 1481 uint8_t *pu8Channel) 1485 1482 { 1486 1483 LogFlowFunc(("pIns %p, pszChannel %s, pfnChannelHandler %p, pvChannelHandler %p, pu8Channel %p\n", … … 1591 1588 1592 1589 HGSMIBUFFERLOCATION *pLoc = (HGSMIBUFFERLOCATION *)pvBuffer; 1593 if (pLoc->cbLocation != sizeof(HGSMIHOSTFLAGS))1590 if (pLoc->cbLocation != sizeof(HGSMIHOSTFLAGS)) 1594 1591 { 1595 1592 rc = VERR_INVALID_PARAMETER; … … 1705 1702 { 1706 1703 uint32_t flags = 0; 1707 if (pIns->pHGFlags)1704 if (pIns->pHGFlags) 1708 1705 { 1709 1706 /* treat the abandoned commands as read.. */ 1710 while(HGSMIHostRead (pIns) != HGSMIOFFSET_VOID) {} 1707 while (HGSMIHostRead(pIns) != HGSMIOFFSET_VOID) 1708 {} 1711 1709 flags = pIns->pHGFlags->u32HostFlags; 1712 1710 pIns->pHGFlags->u32HostFlags = 0; … … 1714 1712 1715 1713 /* .. and complete them */ 1716 while(hgsmiProcessHostCmdCompletion (pIns, 0, true)) {} 1714 while (hgsmiProcessHostCmdCompletion(pIns, 0, true)) 1715 {} 1717 1716 1718 1717 #ifdef VBOX_WITH_WDDM 1719 while(hgsmiProcessGuestCmdCompletion(pIns) != HGSMIOFFSET_VOID) {} 1718 while(hgsmiProcessGuestCmdCompletion(pIns) != HGSMIOFFSET_VOID) 1719 {} 1720 1720 #endif 1721 1721 … … 1794 1794 if (RT_SUCCESS (rc)) 1795 1795 { 1796 if (bDoIrq)1796 if (bDoIrq) 1797 1797 { 1798 1798 /* Now guest can read the FIFO, the notification is informational. */
Note:
See TracChangeset
for help on using the changeset viewer.