VirtualBox

Changeset 51460 in vbox for trunk/src/VBox


Ignore:
Timestamp:
May 29, 2014 12:44:48 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
94030
Message:

main: async call crogl when needed

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

Legend:

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

    r51436 r51460  
    371371    void vbvaReleaseCmd(VBVACMDHDR *pHdr, int32_t cbCmd);
    372372
    373     void handleResizeCompletedEMT(unsigned uScreenId);
     373    void handleResizeCompletedEMT(unsigned uScreenId, BOOL fResizeContext);
    374374
    375375    RTCRITSECT mVBVALock;
     
    390390    int crCtlSubmit(struct VBOXCRCMDCTL* pCmd, uint32_t cbCmd, PFNCRCTLCOMPLETION pfnCompletion, void *pvCompletion);
    391391    int crCtlSubmitSync(struct VBOXCRCMDCTL* pCmd, uint32_t cbCmd);
     392    /* copies the given command and submits it asynchronously,
     393     * i.e. the pCmd data may be discarded right after the call returns */
     394    int crCtlSubmitAsyncCmdCopy(struct VBOXCRCMDCTL* pCmd, uint32_t cbCmd);
    392395    /* performs synchronous request processing if 3D backend has something to display
    393396     * this is primarily to work-around 3d<->main thread deadlocks on OSX
  • trunk/src/VBox/Main/src-client/DisplayImpl.cpp

    r51441 r51460  
    10431043
    10441044    /* The method also unlocks the framebuffer. */
    1045     handleResizeCompletedEMT(uScreenId);
     1045    handleResizeCompletedEMT(uScreenId, TRUE);
    10461046
    10471047    return VINF_SUCCESS;
     
    10541054 *  @thread EMT
    10551055 */
    1056 void Display::handleResizeCompletedEMT(unsigned uScreenId)
     1056void Display::handleResizeCompletedEMT(unsigned uScreenId, BOOL fResizeContext)
    10571057{
    10581058    LogRelFlowFunc(("\n"));
     
    11611161                data.aParms[0].u.uint32 = uScreenId;
    11621162
    1163                 crCtlSubmitSync(&data.Hdr, sizeof (data));
     1163                if (fResizeContext)
     1164                    crCtlSubmitAsyncCmdCopy(&data.Hdr, sizeof (data));
     1165                else
     1166                    crCtlSubmitSync(&data.Hdr, sizeof (data));
    11641167            }
    11651168        }
     
    40894092            fNoUpdate = true; /* Always set it here, because pfnUpdateDisplayAll can cause a new resize. */
    40904093            /* The framebuffer was resized and display data need to be updated. */
    4091             pDisplay->handleResizeCompletedEMT(uScreenId);
     4094            pDisplay->handleResizeCompletedEMT(uScreenId, FALSE);
    40924095            if (pFBInfo->u32ResizeStatus != ResizeStatus_Void)
    40934096            {
     
    47444747}
    47454748
    4746 int Display::crCtlSubmitSyncIfHasDataForScreen(uint32_t u32ScreenID, struct VBOXCRCMDCTL* pCmd, uint32_t cbCmd)
    4747 {
    4748     if (mCrOglCallbacks.pfnHasDataForScreen(u32ScreenID))
    4749         return crCtlSubmitSync(pCmd, cbCmd);
    4750 
     4749int Display::crCtlSubmitAsyncCmdCopy(struct VBOXCRCMDCTL* pCmd, uint32_t cbCmd)
     4750{
    47514751    VBOXCRCMDCTL* pCmdCopy = (VBOXCRCMDCTL*)RTMemAlloc(cbCmd);
    47524752    if (!pCmdCopy)
     
    47674767
    47684768    return VINF_SUCCESS;
     4769}
     4770
     4771int Display::crCtlSubmitSyncIfHasDataForScreen(uint32_t u32ScreenID, struct VBOXCRCMDCTL* pCmd, uint32_t cbCmd)
     4772{
     4773    if (mCrOglCallbacks.pfnHasDataForScreen(u32ScreenID))
     4774        return crCtlSubmitSync(pCmd, cbCmd);
     4775
     4776    return crCtlSubmitAsyncCmdCopy(pCmd, cbCmd);
    47694777}
    47704778
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