VirtualBox

Changeset 52667 in vbox


Ignore:
Timestamp:
Sep 10, 2014 8:40:37 AM (10 years ago)
Author:
vboxsync
Message:

DisplayImpl,VMMDev: cleaned up reenabling of the legacy video acceleration when VM is restored from saved state.

Location:
trunk/src/VBox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/VMMDev/VMMDev.cpp

    r51599 r52667  
    34443444    }
    34453445
    3446     /* Reestablish the acceleration status. */
    3447     if (    pThis->u32VideoAccelEnabled
    3448         &&  pThis->pDrv)
    3449     {
    3450         pThis->pDrv->pfnVideoAccelEnable(pThis->pDrv, !!pThis->u32VideoAccelEnabled, &pThis->pVMMDevRAMR3->vbvaMemory);
    3451     }
    3452 
    34533446    if (pThis->fu32AdditionsOk)
    34543447    {
     
    34973490    AssertLogRelRCReturn(rc, rc);
    34983491#endif /* VBOX_WITH_HGCM */
     3492
     3493    /* Reestablish the acceleration status. */
     3494    if (    pThis->u32VideoAccelEnabled
     3495        &&  pThis->pDrv)
     3496    {
     3497        pThis->pDrv->pfnVideoAccelEnable(pThis->pDrv, !!pThis->u32VideoAccelEnabled, &pThis->pVMMDevRAMR3->vbvaMemory);
     3498    }
    34993499
    35003500    VMMDevNotifyGuest(pThis, VMMDEV_EVENT_RESTORED);
  • trunk/src/VBox/Main/include/DisplayImpl.h

    r52652 r52667  
    355355    int32_t volatile mcVideoAccelVRDPRefs;
    356356
    357     VBVAMEMORY *mpPendingVbvaMemory;
    358     bool        mfPendingVideoAccelEnable;
    359     bool        mfMachineRunning;
    360357#ifdef VBOX_WITH_CROGL
    361358    bool        mfCrOglDataHidden;
  • trunk/src/VBox/Main/src-client/DisplayImpl.cpp

    r52652 r52667  
    108108    mcVideoAccelVRDPRefs = 0;
    109109
    110     mpPendingVbvaMemory = NULL;
    111     mfPendingVideoAccelEnable = false;
    112 
    113     mfMachineRunning = false;
    114110#ifdef VBOX_WITH_CROGL
    115111    mfCrOglDataHidden = false;
     
    16171613        return VERR_NOT_SUPPORTED;
    16181614
    1619     /*
    1620      * Verify that the VM is in running state. If it is not,
    1621      * then this must be postponed until it goes to running.
    1622      */
    1623     if (!mfMachineRunning)
    1624     {
    1625         Assert (!mfVideoAccelEnabled);
    1626 
    1627         LogRelFlowFunc(("Machine is not yet running.\n"));
    1628 
    1629         if (fEnable)
    1630         {
    1631             mfPendingVideoAccelEnable = fEnable;
    1632             mpPendingVbvaMemory = pVbvaMemory;
    1633         }
    1634 
    1635         return rc;
    1636     }
    1637 
    16381615    /* Check that current status is not being changed */
    16391616    if (mfVideoAccelEnabled == fEnable)
     
    21712148    videoAccelEnterVGA();
    21722149
    2173     if (mfPendingVideoAccelEnable)
    2174     {
    2175         /* Acceleration was enabled while machine was not yet running
    2176          * due to restoring from saved state. Actually enable acceleration.
    2177          */
    2178         Assert(mpPendingVbvaMemory);
    2179 
    2180         /* Acceleration can not be yet enabled.*/
    2181         Assert(mpVbvaMemory == NULL);
    2182         Assert(!mfVideoAccelEnabled);
    2183 
    2184         if (mfMachineRunning)
    2185         {
    2186             i_videoAccelEnable(mfPendingVideoAccelEnable,
    2187                                mpPendingVbvaMemory);
    2188 
    2189             /* Reset the pending state. */
    2190             mfPendingVideoAccelEnable = false;
    2191             mpPendingVbvaMemory = NULL;
    2192         }
    2193 
    2194         rc = VINF_TRY_AGAIN;
    2195     }
    2196     else
    2197     {
    2198         Assert(mpPendingVbvaMemory == NULL);
    2199 
    2200         if (mfVideoAccelEnabled)
    2201         {
    2202             Assert(mpVbvaMemory);
    2203             rc = i_videoAccelFlush();
    2204             if (RT_FAILURE(rc))
    2205             {
    2206                 /* Disable on errors. */
    2207                 i_videoAccelEnable(false, NULL);
    2208                 rc = VWRN_INVALID_STATE; /* Do a display update in VGA device. */
    2209             }
    2210             else
    2211             {
    2212                 rc = VINF_SUCCESS;
    2213             }
     2150    if (mfVideoAccelEnabled)
     2151    {
     2152        Assert(mpVbvaMemory);
     2153        rc = i_videoAccelFlush();
     2154        if (RT_FAILURE(rc))
     2155        {
     2156            /* Disable on errors. */
     2157            i_videoAccelEnable(false, NULL);
     2158            rc = VWRN_INVALID_STATE; /* Do a display update in VGA device. */
     2159        }
     2160        else
     2161        {
     2162            rc = VINF_SUCCESS;
    22142163        }
    22152164    }
     
    35243473                LogRelFlowFunc(("Machine is running.\n"));
    35253474
    3526                 mfMachineRunning = true;
    3527 
    35283475#ifdef VBOX_WITH_CROGL
    35293476                i_crOglWindowsShow(true);
     
    35323479            else
    35333480            {
    3534                 mfMachineRunning = false;
    3535 
    35363481#ifdef VBOX_WITH_CROGL
    35373482                if (machineState == MachineState_Paused)
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