VirtualBox

Changeset 82047 in vbox


Ignore:
Timestamp:
Nov 20, 2019 7:58:23 PM (5 years ago)
Author:
vboxsync
Message:

DevVGA: SSMR3 -> pHlp->pfnSSM. bugref:9218

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.cpp

    r82043 r82047  
    545545
    546546static void vmsvgaSetTraces(PVGASTATE pThis, bool fTraces);
    547 static int vmsvgaLoadExecFifo(PVGASTATE pThis, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
    548 static int vmsvgaSaveExecFifo(PVGASTATE pThis, PSSMHANDLE pSSM);
     547static int vmsvgaLoadExecFifo(PCPDMDEVHLPR3 pHlp, PVGASTATE pThis, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
     548static int vmsvgaSaveExecFifo(PCPDMDEVHLPR3 pHlp, PVGASTATE pThis, PSSMHANDLE pSSM);
    549549
    550550VMSVGASCREENOBJECT *vmsvgaGetScreenObject(PVGASTATE pThis, uint32_t idScreen)
     
    29482948            PSSMHANDLE pSSM = (PSSMHANDLE)pThis->svga.pvFIFOExtCmdParam;
    29492949            AssertLogRelMsgBreak(RT_VALID_PTR(pSSM), ("pSSM=%p\n", pSSM));
    2950             vmsvgaSaveExecFifo(pThis, pSSM);
     2950            vmsvgaSaveExecFifo(pThis->pDevInsR3->pHlpR3, pThis, pSSM);
    29512951# ifdef VBOX_WITH_VMSVGA3D
    29522952            if (pThis->svga.f3DEnabled)
     
    29612961            PVMSVGA_STATE_LOAD pLoadState = (PVMSVGA_STATE_LOAD)pThis->svga.pvFIFOExtCmdParam;
    29622962            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);
    29642964# ifdef VBOX_WITH_VMSVGA3D
    29652965            if (pThis->svga.f3DEnabled)
     
    55225522/** Portion of VMSVGA state which must be loaded oin the FIFO thread.
    55235523 */
    5524 static int vmsvgaLoadExecFifo(PVGASTATE pThis, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)
     5524static int vmsvgaLoadExecFifo(PCPDMDEVHLPR3 pHlp, PVGASTATE pThis, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass)
    55255525{
    55265526    RT_NOREF(uPass);
     
    55325532    {
    55335533        uint32_t cScreens = 0;
    5534         rc = SSMR3GetU32(pSSM, &cScreens);
     5534        rc = pHlp->pfnSSMGetU32(pSSM, &cScreens);
    55355535        AssertRCReturn(rc, rc);
    55365536        AssertLogRelMsgReturn(cScreens <= _64K, /* big enough */
     
    55435543            RT_ZERO(screen);
    55445544
    5545             rc = SSMR3GetStructEx(pSSM, &screen, sizeof(screen), 0, g_aVMSVGASCREENOBJECTFields, NULL);
     5545            rc = pHlp->pfnSSMGetStructEx(pSSM, &screen, sizeof(screen), 0, g_aVMSVGASCREENOBJECTFields, NULL);
    55465546            AssertLogRelRCReturn(rc, rc);
    55475547
     
    55845584{
    55855585    RT_NOREF(uPass);
    5586     PVGASTATE       pThis = PDMINS_2_DATA(pDevIns, PVGASTATE);
     5586    PVGASTATE       pThis      = PDMINS_2_DATA(pDevIns, PVGASTATE);
    55875587    PVMSVGAR3STATE  pSVGAState = pThis->svga.pSvgaR3State;
     5588    PCPDMDEVHLPR3   pHlp       = pDevIns->pHlpR3;
    55885589    int             rc;
    55895590
    55905591    /* 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);
    55925593    AssertRCReturn(rc, rc);
    55935594
     
    55975598    if (uVersion >= VGA_SAVEDSTATE_VERSION_VMSVGA_VGA_FB_FIX)
    55985599    {
    5599         rc = SSMR3GetU32(pSSM, &cbVgaFramebuffer);
     5600        rc = pHlp->pfnSSMGetU32(pSSM, &cbVgaFramebuffer);
    56005601        AssertRCReturn(rc, rc);
    56015602        AssertLogRelMsgReturn(cbVgaFramebuffer <= _4M && cbVgaFramebuffer >= _32K && RT_IS_POWER_OF_TWO(cbVgaFramebuffer),
     
    56055606        AssertCompile(RT_IS_POWER_OF_TWO(VMSVGA_VGA_FB_BACKUP_SIZE));
    56065607    }
    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));
    56085609    AssertRCReturn(rc, rc);
    56095610    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);
    56115612    else if (cbVgaFramebuffer < VMSVGA_VGA_FB_BACKUP_SIZE)
    56125613        RT_BZERO(&pThis->svga.pbVgaFrameBufferR3[cbVgaFramebuffer], VMSVGA_VGA_FB_BACKUP_SIZE - cbVgaFramebuffer);
    56135614
    56145615    /* 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);
    56165617    AssertRCReturn(rc, rc);
    56175618
     
    56225623        AssertReturn(pSVGAState->Cursor.pData, VERR_NO_MEMORY);
    56235624
    5624         rc = SSMR3GetMem(pSSM, pSVGAState->Cursor.pData, pSVGAState->Cursor.cbData);
     5625        rc = pHlp->pfnSSMGetMem(pSSM, pSVGAState->Cursor.pData, pSVGAState->Cursor.cbData);
    56255626        AssertRCReturn(rc, rc);
    56265627    }
     
    56305631    if (uVersion >= VGA_SAVEDSTATE_VERSION_VMSVGA_GMR_COUNT)
    56315632    {
    5632         rc = SSMR3GetU32(pSSM, &cGMR);
     5633        rc = pHlp->pfnSSMGetU32(pSSM, &cGMR);
    56335634        AssertRCReturn(rc, rc);
    56345635        /* Numbers of GMRs was never less than 256. 1MB is a large arbitrary limit. */
     
    56525653        PGMR pGMR = &pSVGAState->paGMR[i];
    56535654
    5654         rc = SSMR3GetStructEx(pSSM, pGMR, sizeof(*pGMR), 0, g_aGMRFields, NULL);
     5655        rc = pHlp->pfnSSMGetStructEx(pSSM, pGMR, sizeof(*pGMR), 0, g_aGMRFields, NULL);
    56555656        AssertRCReturn(rc, rc);
    56565657
     
    56635664            for (uint32_t j = 0; j < pGMR->numDescriptors; ++j)
    56645665            {
    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);
    56665667                AssertRCReturn(rc, rc);
    56675668            }
     
    56885689int vmsvgaLoadDone(PPDMDEVINS pDevIns)
    56895690{
    5690     PVGASTATE       pThis = PDMINS_2_DATA(pDevIns, PVGASTATE);
     5691    PVGASTATE       pThis      = PDMINS_2_DATA(pDevIns, PVGASTATE);
    56915692    PVMSVGAR3STATE  pSVGAState = pThis->svga.pSvgaR3State;
    56925693
     
    57145715 * Portion of SVGA state which must be saved in the FIFO thread.
    57155716 */
    5716 static int vmsvgaSaveExecFifo(PVGASTATE pThis, PSSMHANDLE pSSM)
     5717static int vmsvgaSaveExecFifo(PCPDMDEVHLPR3 pHlp, PVGASTATE pThis, PSSMHANDLE pSSM)
    57175718{
    57185719    PVMSVGAR3STATE  pSVGAState = pThis->svga.pSvgaR3State;
     
    57285729    }
    57295730
    5730     rc = SSMR3PutU32(pSSM, cScreens);
     5731    rc = pHlp->pfnSSMPutU32(pSSM, cScreens);
    57315732    AssertLogRelRCReturn(rc, rc);
    57325733
     
    57355736        VMSVGASCREENOBJECT *pScreen = &pSVGAState->aScreens[i];
    57365737
    5737         rc = SSMR3PutStructEx(pSSM, pScreen, sizeof(*pScreen), 0, g_aVMSVGASCREENOBJECTFields, NULL);
     5738        rc = pHlp->pfnSSMPutStructEx(pSSM, pScreen, sizeof(*pScreen), 0, g_aVMSVGASCREENOBJECTFields, NULL);
    57385739        AssertLogRelRCReturn(rc, rc);
    57395740    }
     
    57465747int vmsvgaSaveExec(PPDMDEVINS pDevIns, PSSMHANDLE pSSM)
    57475748{
    5748     PVGASTATE       pThis = PDMINS_2_DATA(pDevIns, PVGASTATE);
     5749    PVGASTATE       pThis      = PDMINS_2_DATA(pDevIns, PVGASTATE);
    57495750    PVMSVGAR3STATE  pSVGAState = pThis->svga.pSvgaR3State;
     5751    PCPDMDEVHLPR3   pHlp       = pDevIns->pHlpR3;
    57505752    int             rc;
    57515753
    57525754    /* 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);
    57545756    AssertLogRelRCReturn(rc, rc);
    57555757
    57565758    /* 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);
    57595761    AssertLogRelRCReturn(rc, rc);
    57605762
    57615763    /* 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);
    57635765    AssertLogRelRCReturn(rc, rc);
    57645766
     
    57665768    if (pSVGAState->Cursor.fActive)
    57675769    {
    5768         rc = SSMR3PutMem(pSSM, pSVGAState->Cursor.pData, pSVGAState->Cursor.cbData);
     5770        rc = pHlp->pfnSSMPutMem(pSSM, pSVGAState->Cursor.pData, pSVGAState->Cursor.cbData);
    57695771        AssertLogRelRCReturn(rc, rc);
    57705772    }
    57715773
    57725774    /* Save the GMR state */
    5773     rc = SSMR3PutU32(pSSM, pThis->svga.cGMR);
     5775    rc = pHlp->pfnSSMPutU32(pSSM, pThis->svga.cGMR);
    57745776    AssertLogRelRCReturn(rc, rc);
    57755777    for (uint32_t i = 0; i < pThis->svga.cGMR; ++i)
     
    57775779        PGMR pGMR = &pSVGAState->paGMR[i];
    57785780
    5779         rc = SSMR3PutStructEx(pSSM, pGMR, sizeof(*pGMR), 0, g_aGMRFields, NULL);
     5781        rc = pHlp->pfnSSMPutStructEx(pSSM, pGMR, sizeof(*pGMR), 0, g_aGMRFields, NULL);
    57805782        AssertLogRelRCReturn(rc, rc);
    57815783
    57825784        for (uint32_t j = 0; j < pGMR->numDescriptors; ++j)
    57835785        {
    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);
    57855787            AssertLogRelRCReturn(rc, rc);
    57865788        }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette