Changeset 51356 in vbox
- Timestamp:
- May 22, 2014 1:08:14 PM (11 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/include/cr_version.h
r51349 r51356 44 44 #define SHCROGL_SSM_VERSION_WITH_SCREEN_MAP 45 45 45 #define SHCROGL_SSM_VERSION_WITH_SCREEN_MAP_REORDERED 46 46 #define SHCROGL_SSM_VERSION 46 46 #define SHCROGL_SSM_VERSION_WITH_PEND_CMD_INFO 47 47 #define SHCROGL_SSM_VERSION 47 47 48 48 49 /* These define the Chromium release number. -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server.h
r51320 r51356 476 476 int8_t crVBoxServerCrCmdFlipProcess(const VBOXCMDVBVA_FLIP *pFlip); 477 477 478 479 int32_t crVBoxServerClientGet(uint32_t u32ClientID, CRClient **ppClient); 480 481 int crServerPendSaveState(PSSMHANDLE pSSM); 482 int crServerPendLoadState(PSSMHANDLE pSSM, uint32_t u32Version); 483 478 484 //#define VBOX_WITH_CRSERVER_DUMPER 479 485 #ifdef VBOX_WITH_CRSERVER_DUMPER -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
r51330 r51356 83 83 } 84 84 85 DECLINLINE(int32_t)crVBoxServerClientGet(uint32_t u32ClientID, CRClient **ppClient)85 int32_t crVBoxServerClientGet(uint32_t u32ClientID, CRClient **ppClient) 86 86 { 87 87 CRClient *pClient = NULL; … … 1838 1838 } 1839 1839 1840 rc = crServerPendSaveState(pSSM); 1841 AssertRCReturn(rc, rc); 1842 1840 1843 rc = CrPMgrSaveState(pSSM); 1841 1844 AssertRCReturn(rc, rc); … … 2733 2736 cr_server.curClient = NULL; 2734 2737 2738 rc = crServerPendLoadState(pSSM, version); 2739 AssertRCReturn(rc, rc); 2740 2735 2741 if (version >= SHCROGL_SSM_VERSION_WITH_SCREEN_INFO) 2736 2742 { … … 3646 3652 return VINF_SUCCESS; 3647 3653 } 3648 3649 3654 3650 3655 static DECLCALLBACK(int) crVBoxCrCmdSaveState(HVBOXCRCMDSVR hSvr, PSSMHANDLE pSSM) … … 4311 4316 Assert(!cr_server.fCrCmdEnabled); 4312 4317 4313 if (cr_server.numClients)4314 { 4315 WARN(("cr_server.numClients(%d) is not NULL", cr_server.numClients));4316 return VERR_INVALID_STATE; 4317 }4318 Assert(!cr_server.numClients); 4319 4320 crVBoxServerRemoveAllClients(); 4321 4322 CRASSERT(!cr_server.numClients); 4318 4323 4319 4324 crVBoxServerDefaultContextClear(); -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_stream.c
r50973 r51356 419 419 { 420 420 RTLISTNODE Node; 421 uint32_t cbMsg; 421 422 CRMessage Msg; 422 423 } CR_SERVER_PENDING_MSG; … … 424 425 static int crServerPendMsg(CRConnection *conn, const CRMessage *msg, int cbMsg) 425 426 { 426 CR_SERVER_PENDING_MSG *pMsg = (CR_SERVER_PENDING_MSG*)RTMemAlloc(cbMsg + RT_OFFSETOF(CR_SERVER_PENDING_MSG, Msg)); 427 CR_SERVER_PENDING_MSG *pMsg; 428 429 if (!cbMsg) 430 { 431 WARN(("cbMsg is null!")); 432 return VERR_INVALID_PARAMETER; 433 } 434 435 pMsg = (CR_SERVER_PENDING_MSG*)RTMemAlloc(cbMsg + RT_OFFSETOF(CR_SERVER_PENDING_MSG, Msg)); 427 436 if (!pMsg) 428 437 { … … 431 440 } 432 441 442 pMsg->cbMsg = cbMsg; 443 433 444 memcpy(&pMsg->Msg, msg, cbMsg); 434 445 435 446 RTListAppend(&conn->PendingMsgList, &pMsg->Node); 447 448 return VINF_SUCCESS; 449 } 450 451 int crServerPendSaveState(PSSMHANDLE pSSM) 452 { 453 int i, rc; 454 455 for (i = 0; i < cr_server.numClients; i++) 456 { 457 CR_SERVER_PENDING_MSG *pIter; 458 CRClient *pClient = cr_server.clients[i]; 459 CRConnection *pConn; 460 if (!pClient || !pClient->conn) 461 { 462 WARN(("invalid client state")); 463 continue; 464 } 465 466 pConn = pClient->conn; 467 468 if (RTListIsEmpty(&pConn->PendingMsgList)) 469 continue; 470 471 CRASSERT(pConn->u32ClientID); 472 473 rc = SSMR3PutU32(pSSM, pConn->u32ClientID); 474 AssertRCReturn(rc, rc); 475 476 RTListForEach(&pConn->PendingMsgList, pIter, CR_SERVER_PENDING_MSG, Node) 477 { 478 CRASSERT(pIter->cbMsg); 479 480 rc = SSMR3PutU32(pSSM, pIter->cbMsg); 481 AssertRCReturn(rc, rc); 482 483 rc = SSMR3PutMem(pSSM, &pIter->Msg, pIter->cbMsg); 484 AssertRCReturn(rc, rc); 485 } 486 487 rc = SSMR3PutU32(pSSM, 0); 488 AssertRCReturn(rc, rc); 489 } 490 491 rc = SSMR3PutU32(pSSM, 0); 492 AssertRCReturn(rc, rc); 493 494 return VINF_SUCCESS; 495 } 496 497 int crServerPendLoadState(PSSMHANDLE pSSM, uint32_t u32Version) 498 { 499 int rc; 500 uint32_t u32; 501 CRClient *pClient; 502 503 if (u32Version < SHCROGL_SSM_VERSION_WITH_PEND_CMD_INFO) 504 return VINF_SUCCESS; 505 506 rc = SSMR3GetU32(pSSM, &u32); 507 AssertRCReturn(rc, rc); 508 509 if (!u32) 510 return VINF_SUCCESS; 511 512 do { 513 rc = crVBoxServerClientGet(u32, &pClient); 514 AssertRCReturn(rc, rc); 515 516 for(;;) 517 { 518 CR_SERVER_PENDING_MSG *pMsg; 519 520 rc = SSMR3GetU32(pSSM, &u32); 521 AssertRCReturn(rc, rc); 522 523 if (!u32) 524 break; 525 526 pMsg = (CR_SERVER_PENDING_MSG*)RTMemAlloc(u32 + RT_OFFSETOF(CR_SERVER_PENDING_MSG, Msg)); 527 if (!pMsg) 528 { 529 WARN(("RTMemAlloc failed")); 530 return VERR_NO_MEMORY; 531 } 532 533 pMsg->cbMsg = u32; 534 rc = SSMR3GetMem(pSSM, &pMsg->Msg, u32); 535 AssertRCReturn(rc, rc); 536 537 RTListAppend(&pClient->conn->PendingMsgList, &pMsg->Node); 538 } 539 540 rc = SSMR3GetU32(pSSM, &u32); 541 AssertRCReturn(rc, rc); 542 } while (u32); 543 544 rc = SSMR3GetU32(pSSM, &u32); 545 AssertRCReturn(rc, rc); 436 546 437 547 return VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.