VirtualBox

Changeset 75448 in vbox


Ignore:
Timestamp:
Nov 14, 2018 1:44:39 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
126602
Message:

Main/DisplayImpl: Do much of the i_drvDestruct work earlier in the power off notification. This should help make sure IDisplay client calls doesn't make it into HGCM or DevVGA during VM destruction. bugref:9292

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/DisplayImpl.h

    r75352 r75448  
    322322    static DECLCALLBACK(int)   i_drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags);
    323323    static DECLCALLBACK(void)  i_drvDestruct(PPDMDRVINS pDrvIns);
     324    static DECLCALLBACK(void)  i_drvPowerOff(PPDMDRVINS pDrvIns);
    324325    static DECLCALLBACK(int)   i_displayResizeCallback(PPDMIDISPLAYCONNECTOR pInterface, uint32_t bpp, void *pvVRAM,
    325326                                                       uint32_t cbLine, uint32_t cx, uint32_t cy);
  • trunk/src/VBox/Main/src-client/DisplayImpl.cpp

    r75361 r75448  
    32373237}
    32383238#endif
    3239 
    32403239#ifdef VBOX_WITH_CRHGSMI
     3240
    32413241void Display::i_setupCrHgsmiData(void)
    32423242{
     
    32863286    RTCritSectRwLeaveExcl(&mCrOglLock);
    32873287}
     3288
    32883289#endif /* VBOX_WITH_CRHGSMI */
    32893290
     
    44764477
    44774478/**
    4478  * Destruct a display driver instance.
    4479  *
    4480  * @returns VBox status code.
    4481  * @param   pDrvIns     The driver instance data.
     4479 * @interface_method_impl{PDMDRVREG,pfnPowerOff,
     4480 *  Tries to ensure no client calls gets to HGCM or the VGA device from here on.}
    44824481 */
    4483 DECLCALLBACK(void) Display::i_drvDestruct(PPDMDRVINS pDrvIns)
    4484 {
    4485     PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns);
     4482DECLCALLBACK(void) Display::i_drvPowerOff(PPDMDRVINS pDrvIns)
     4483{
    44864484    PDRVMAINDISPLAY pThis = PDMINS_2_DATA(pDrvIns, PDRVMAINDISPLAY);
    44874485    LogRelFlowFunc(("iInstance=%d\n", pDrvIns->iInstance));
    44884486
    4489     pThis->pUpPort->pfnSetRenderVRAM(pThis->pUpPort, false);
     4487    /*
     4488     * Do much of the work that i_drvDestruct does.
     4489     */
     4490    if (pThis->pUpPort)
     4491        pThis->pUpPort->pfnSetRenderVRAM(pThis->pUpPort, false);
    44904492
    44914493    pThis->IConnector.pbData     = NULL;
     
    45044506        pThis->pDisplay->i_destructCrHgsmiData();
    45054507#endif
     4508#if defined(VBOX_WITH_VIDEOHWACCEL) || defined(VBOX_WITH_CRHGSMI)
     4509        pThis->pVBVACallbacks = NULL;
     4510#endif
     4511    }
     4512}
     4513
     4514
     4515/**
     4516 * Destruct a display driver instance.
     4517 *
     4518 * @returns VBox status code.
     4519 * @param   pDrvIns     The driver instance data.
     4520 */
     4521DECLCALLBACK(void) Display::i_drvDestruct(PPDMDRVINS pDrvIns)
     4522{
     4523    PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns);
     4524    PDRVMAINDISPLAY pThis = PDMINS_2_DATA(pDrvIns, PDRVMAINDISPLAY);
     4525    LogRelFlowFunc(("iInstance=%d\n", pDrvIns->iInstance));
     4526
     4527    /*
     4528     * We repeat much of what i_drvPowerOff does in case it wasn't called.
     4529     * In addition we sever the connection between us and the display.
     4530     */
     4531    if (pThis->pUpPort)
     4532        pThis->pUpPort->pfnSetRenderVRAM(pThis->pUpPort, false);
     4533
     4534    pThis->IConnector.pbData     = NULL;
     4535    pThis->IConnector.cbScanline = 0;
     4536    pThis->IConnector.cBits      = 32;
     4537    pThis->IConnector.cx         = 0;
     4538    pThis->IConnector.cy         = 0;
     4539
     4540    if (pThis->pDisplay)
     4541    {
     4542        AutoWriteLock displayLock(pThis->pDisplay COMMA_LOCKVAL_SRC_POS);
     4543#ifdef VBOX_WITH_RECORDING
     4544        pThis->pDisplay->mParent->i_recordingStop();
     4545#endif
     4546#ifdef VBOX_WITH_CRHGSMI
     4547        pThis->pDisplay->i_destructCrHgsmiData();
     4548#endif
     4549#if defined(VBOX_WITH_VIDEOHWACCEL) || defined(VBOX_WITH_CRHGSMI)
     4550        pThis->pVBVACallbacks = NULL;
     4551#endif
     4552
    45064553        pThis->pDisplay->mpDrv = NULL;
    4507     }
     4554        pThis->pDisplay = NULL;
     4555    }
     4556#if defined(VBOX_WITH_VIDEOHWACCEL) || defined(VBOX_WITH_CRHGSMI)
     4557    pThis->pVBVACallbacks = NULL;
     4558#endif
    45084559}
    45094560
     
    46574708    NULL,
    46584709    /* pfnPowerOff */
    4659     NULL,
     4710    Display::i_drvPowerOff,
    46604711    /* pfnSoftReset */
    46614712    NULL,
Note: See TracChangeset for help on using the changeset viewer.

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