Changeset 82047 in vbox
- Timestamp:
- Nov 20, 2019 7:58:23 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.cpp
r82043 r82047 545 545 546 546 static void vmsvgaSetTraces(PVGASTATE pThis, bool fTraces); 547 static int vmsvgaLoadExecFifo(P VGASTATE pThis, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);548 static int vmsvgaSaveExecFifo(P VGASTATE pThis, PSSMHANDLE pSSM);547 static int vmsvgaLoadExecFifo(PCPDMDEVHLPR3 pHlp, PVGASTATE pThis, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass); 548 static int vmsvgaSaveExecFifo(PCPDMDEVHLPR3 pHlp, PVGASTATE pThis, PSSMHANDLE pSSM); 549 549 550 550 VMSVGASCREENOBJECT *vmsvgaGetScreenObject(PVGASTATE pThis, uint32_t idScreen) … … 2948 2948 PSSMHANDLE pSSM = (PSSMHANDLE)pThis->svga.pvFIFOExtCmdParam; 2949 2949 AssertLogRelMsgBreak(RT_VALID_PTR(pSSM), ("pSSM=%p\n", pSSM)); 2950 vmsvgaSaveExecFifo(pThis , pSSM);2950 vmsvgaSaveExecFifo(pThis->pDevInsR3->pHlpR3, pThis, pSSM); 2951 2951 # ifdef VBOX_WITH_VMSVGA3D 2952 2952 if (pThis->svga.f3DEnabled) … … 2961 2961 PVMSVGA_STATE_LOAD pLoadState = (PVMSVGA_STATE_LOAD)pThis->svga.pvFIFOExtCmdParam; 2962 2962 AssertLogRelMsgBreak(RT_VALID_PTR(pLoadState), ("pLoadState=%p\n", pLoadState)); 2963 vmsvgaLoadExecFifo(pThis , pLoadState->pSSM, pLoadState->uVersion, pLoadState->uPass);2963 vmsvgaLoadExecFifo(pThis->pDevInsR3->pHlpR3, pThis, pLoadState->pSSM, pLoadState->uVersion, pLoadState->uPass); 2964 2964 # ifdef VBOX_WITH_VMSVGA3D 2965 2965 if (pThis->svga.f3DEnabled) … … 5522 5522 /** Portion of VMSVGA state which must be loaded oin the FIFO thread. 5523 5523 */ 5524 static int vmsvgaLoadExecFifo(P VGASTATE pThis, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)5524 static int vmsvgaLoadExecFifo(PCPDMDEVHLPR3 pHlp, PVGASTATE pThis, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass) 5525 5525 { 5526 5526 RT_NOREF(uPass); … … 5532 5532 { 5533 5533 uint32_t cScreens = 0; 5534 rc = SSMR3GetU32(pSSM, &cScreens);5534 rc = pHlp->pfnSSMGetU32(pSSM, &cScreens); 5535 5535 AssertRCReturn(rc, rc); 5536 5536 AssertLogRelMsgReturn(cScreens <= _64K, /* big enough */ … … 5543 5543 RT_ZERO(screen); 5544 5544 5545 rc = SSMR3GetStructEx(pSSM, &screen, sizeof(screen), 0, g_aVMSVGASCREENOBJECTFields, NULL);5545 rc = pHlp->pfnSSMGetStructEx(pSSM, &screen, sizeof(screen), 0, g_aVMSVGASCREENOBJECTFields, NULL); 5546 5546 AssertLogRelRCReturn(rc, rc); 5547 5547 … … 5584 5584 { 5585 5585 RT_NOREF(uPass); 5586 PVGASTATE pThis = PDMINS_2_DATA(pDevIns, PVGASTATE);5586 PVGASTATE pThis = PDMINS_2_DATA(pDevIns, PVGASTATE); 5587 5587 PVMSVGAR3STATE pSVGAState = pThis->svga.pSvgaR3State; 5588 PCPDMDEVHLPR3 pHlp = pDevIns->pHlpR3; 5588 5589 int rc; 5589 5590 5590 5591 /* Load our part of the VGAState */ 5591 rc = SSMR3GetStructEx(pSSM, &pThis->svga, sizeof(pThis->svga), 0, g_aVGAStateSVGAFields, NULL);5592 rc = pHlp->pfnSSMGetStructEx(pSSM, &pThis->svga, sizeof(pThis->svga), 0, g_aVGAStateSVGAFields, NULL); 5592 5593 AssertRCReturn(rc, rc); 5593 5594 … … 5597 5598 if (uVersion >= VGA_SAVEDSTATE_VERSION_VMSVGA_VGA_FB_FIX) 5598 5599 { 5599 rc = SSMR3GetU32(pSSM, &cbVgaFramebuffer);5600 rc = pHlp->pfnSSMGetU32(pSSM, &cbVgaFramebuffer); 5600 5601 AssertRCReturn(rc, rc); 5601 5602 AssertLogRelMsgReturn(cbVgaFramebuffer <= _4M && cbVgaFramebuffer >= _32K && RT_IS_POWER_OF_TWO(cbVgaFramebuffer), … … 5605 5606 AssertCompile(RT_IS_POWER_OF_TWO(VMSVGA_VGA_FB_BACKUP_SIZE)); 5606 5607 } 5607 rc = SSMR3GetMem(pSSM, pThis->svga.pbVgaFrameBufferR3, RT_MIN(cbVgaFramebuffer, VMSVGA_VGA_FB_BACKUP_SIZE));5608 rc = pHlp->pfnSSMGetMem(pSSM, pThis->svga.pbVgaFrameBufferR3, RT_MIN(cbVgaFramebuffer, VMSVGA_VGA_FB_BACKUP_SIZE)); 5608 5609 AssertRCReturn(rc, rc); 5609 5610 if (cbVgaFramebuffer > VMSVGA_VGA_FB_BACKUP_SIZE) 5610 SSMR3Skip(pSSM, cbVgaFramebuffer - VMSVGA_VGA_FB_BACKUP_SIZE);5611 pHlp->pfnSSMSkip(pSSM, cbVgaFramebuffer - VMSVGA_VGA_FB_BACKUP_SIZE); 5611 5612 else if (cbVgaFramebuffer < VMSVGA_VGA_FB_BACKUP_SIZE) 5612 5613 RT_BZERO(&pThis->svga.pbVgaFrameBufferR3[cbVgaFramebuffer], VMSVGA_VGA_FB_BACKUP_SIZE - cbVgaFramebuffer); 5613 5614 5614 5615 /* Load the VMSVGA state. */ 5615 rc = SSMR3GetStructEx(pSSM, pSVGAState, sizeof(*pSVGAState), 0, g_aVMSVGAR3STATEFields, NULL);5616 rc = pHlp->pfnSSMGetStructEx(pSSM, pSVGAState, sizeof(*pSVGAState), 0, g_aVMSVGAR3STATEFields, NULL); 5616 5617 AssertRCReturn(rc, rc); 5617 5618 … … 5622 5623 AssertReturn(pSVGAState->Cursor.pData, VERR_NO_MEMORY); 5623 5624 5624 rc = SSMR3GetMem(pSSM, pSVGAState->Cursor.pData, pSVGAState->Cursor.cbData);5625 rc = pHlp->pfnSSMGetMem(pSSM, pSVGAState->Cursor.pData, pSVGAState->Cursor.cbData); 5625 5626 AssertRCReturn(rc, rc); 5626 5627 } … … 5630 5631 if (uVersion >= VGA_SAVEDSTATE_VERSION_VMSVGA_GMR_COUNT) 5631 5632 { 5632 rc = SSMR3GetU32(pSSM, &cGMR);5633 rc = pHlp->pfnSSMGetU32(pSSM, &cGMR); 5633 5634 AssertRCReturn(rc, rc); 5634 5635 /* Numbers of GMRs was never less than 256. 1MB is a large arbitrary limit. */ … … 5652 5653 PGMR pGMR = &pSVGAState->paGMR[i]; 5653 5654 5654 rc = SSMR3GetStructEx(pSSM, pGMR, sizeof(*pGMR), 0, g_aGMRFields, NULL);5655 rc = pHlp->pfnSSMGetStructEx(pSSM, pGMR, sizeof(*pGMR), 0, g_aGMRFields, NULL); 5655 5656 AssertRCReturn(rc, rc); 5656 5657 … … 5663 5664 for (uint32_t j = 0; j < pGMR->numDescriptors; ++j) 5664 5665 { 5665 rc = SSMR3GetStructEx(pSSM, &pGMR->paDesc[j], sizeof(pGMR->paDesc[j]), 0, g_aVMSVGAGMRDESCRIPTORFields, NULL);5666 rc = pHlp->pfnSSMGetStructEx(pSSM, &pGMR->paDesc[j], sizeof(pGMR->paDesc[j]), 0, g_aVMSVGAGMRDESCRIPTORFields, NULL); 5666 5667 AssertRCReturn(rc, rc); 5667 5668 } … … 5688 5689 int vmsvgaLoadDone(PPDMDEVINS pDevIns) 5689 5690 { 5690 PVGASTATE pThis = PDMINS_2_DATA(pDevIns, PVGASTATE);5691 PVGASTATE pThis = PDMINS_2_DATA(pDevIns, PVGASTATE); 5691 5692 PVMSVGAR3STATE pSVGAState = pThis->svga.pSvgaR3State; 5692 5693 … … 5714 5715 * Portion of SVGA state which must be saved in the FIFO thread. 5715 5716 */ 5716 static int vmsvgaSaveExecFifo(P VGASTATE pThis, PSSMHANDLE pSSM)5717 static int vmsvgaSaveExecFifo(PCPDMDEVHLPR3 pHlp, PVGASTATE pThis, PSSMHANDLE pSSM) 5717 5718 { 5718 5719 PVMSVGAR3STATE pSVGAState = pThis->svga.pSvgaR3State; … … 5728 5729 } 5729 5730 5730 rc = SSMR3PutU32(pSSM, cScreens);5731 rc = pHlp->pfnSSMPutU32(pSSM, cScreens); 5731 5732 AssertLogRelRCReturn(rc, rc); 5732 5733 … … 5735 5736 VMSVGASCREENOBJECT *pScreen = &pSVGAState->aScreens[i]; 5736 5737 5737 rc = SSMR3PutStructEx(pSSM, pScreen, sizeof(*pScreen), 0, g_aVMSVGASCREENOBJECTFields, NULL);5738 rc = pHlp->pfnSSMPutStructEx(pSSM, pScreen, sizeof(*pScreen), 0, g_aVMSVGASCREENOBJECTFields, NULL); 5738 5739 AssertLogRelRCReturn(rc, rc); 5739 5740 } … … 5746 5747 int vmsvgaSaveExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM) 5747 5748 { 5748 PVGASTATE pThis = PDMINS_2_DATA(pDevIns, PVGASTATE);5749 PVGASTATE pThis = PDMINS_2_DATA(pDevIns, PVGASTATE); 5749 5750 PVMSVGAR3STATE pSVGAState = pThis->svga.pSvgaR3State; 5751 PCPDMDEVHLPR3 pHlp = pDevIns->pHlpR3; 5750 5752 int rc; 5751 5753 5752 5754 /* Save our part of the VGAState */ 5753 rc = SSMR3PutStructEx(pSSM, &pThis->svga, sizeof(pThis->svga), 0, g_aVGAStateSVGAFields, NULL);5755 rc = pHlp->pfnSSMPutStructEx(pSSM, &pThis->svga, sizeof(pThis->svga), 0, g_aVGAStateSVGAFields, NULL); 5754 5756 AssertLogRelRCReturn(rc, rc); 5755 5757 5756 5758 /* Save the framebuffer backup. */ 5757 rc = SSMR3PutU32(pSSM, VMSVGA_VGA_FB_BACKUP_SIZE);5758 rc = SSMR3PutMem(pSSM, pThis->svga.pbVgaFrameBufferR3, VMSVGA_VGA_FB_BACKUP_SIZE);5759 rc = pHlp->pfnSSMPutU32(pSSM, VMSVGA_VGA_FB_BACKUP_SIZE); 5760 rc = pHlp->pfnSSMPutMem(pSSM, pThis->svga.pbVgaFrameBufferR3, VMSVGA_VGA_FB_BACKUP_SIZE); 5759 5761 AssertLogRelRCReturn(rc, rc); 5760 5762 5761 5763 /* Save the VMSVGA state. */ 5762 rc = SSMR3PutStructEx(pSSM, pSVGAState, sizeof(*pSVGAState), 0, g_aVMSVGAR3STATEFields, NULL);5764 rc = pHlp->pfnSSMPutStructEx(pSSM, pSVGAState, sizeof(*pSVGAState), 0, g_aVMSVGAR3STATEFields, NULL); 5763 5765 AssertLogRelRCReturn(rc, rc); 5764 5766 … … 5766 5768 if (pSVGAState->Cursor.fActive) 5767 5769 { 5768 rc = SSMR3PutMem(pSSM, pSVGAState->Cursor.pData, pSVGAState->Cursor.cbData);5770 rc = pHlp->pfnSSMPutMem(pSSM, pSVGAState->Cursor.pData, pSVGAState->Cursor.cbData); 5769 5771 AssertLogRelRCReturn(rc, rc); 5770 5772 } 5771 5773 5772 5774 /* Save the GMR state */ 5773 rc = SSMR3PutU32(pSSM, pThis->svga.cGMR);5775 rc = pHlp->pfnSSMPutU32(pSSM, pThis->svga.cGMR); 5774 5776 AssertLogRelRCReturn(rc, rc); 5775 5777 for (uint32_t i = 0; i < pThis->svga.cGMR; ++i) … … 5777 5779 PGMR pGMR = &pSVGAState->paGMR[i]; 5778 5780 5779 rc = SSMR3PutStructEx(pSSM, pGMR, sizeof(*pGMR), 0, g_aGMRFields, NULL);5781 rc = pHlp->pfnSSMPutStructEx(pSSM, pGMR, sizeof(*pGMR), 0, g_aGMRFields, NULL); 5780 5782 AssertLogRelRCReturn(rc, rc); 5781 5783 5782 5784 for (uint32_t j = 0; j < pGMR->numDescriptors; ++j) 5783 5785 { 5784 rc = SSMR3PutStructEx(pSSM, &pGMR->paDesc[j], sizeof(pGMR->paDesc[j]), 0, g_aVMSVGAGMRDESCRIPTORFields, NULL);5786 rc = pHlp->pfnSSMPutStructEx(pSSM, &pGMR->paDesc[j], sizeof(pGMR->paDesc[j]), 0, g_aVMSVGAGMRDESCRIPTORFields, NULL); 5785 5787 AssertLogRelRCReturn(rc, rc); 5786 5788 }
Note:
See TracChangeset
for help on using the changeset viewer.