VirtualBox

Ignore:
Timestamp:
Apr 25, 2014 12:51:03 PM (11 years ago)
Author:
vboxsync
Message:

crOpenGL: crcmd enhancements & fixes; osx deadlock fix; temporary disabled crcmd for testing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c

    r51121 r51141  
    146146}
    147147
     148static int crVBoxServerCrCmdDisablePostProcess(VBOXCRCMDCTL_HGCMENABLE_DATA *pData);
     149
    148150static void crServerTearDown( void )
    149151{
     
    151153    CRClientNode *pNode, *pNext;
    152154    GLboolean fOldEnableDiff;
     155    GLboolean fContextsDeleted = GL_FALSE;
    153156
    154157    /* avoid a race condition */
     
    173176        }
    174177
    175         rc = crVBoxServerHgcmEnable(&EnableData);
    176         if (!RT_SUCCESS(rc))
    177         {
    178             WARN(("crVBoxServerHgcmEnable failed %d", rc));
    179             return;
    180         }
     178        crVBoxServerCrCmdDisablePostProcess(&EnableData);
     179        fContextsDeleted = GL_TRUE;
    181180
    182181        CRASSERT(DisableData.pfnNotifyTermDone);
     
    201200    cr_server.currentMural = NULL;
    202201
    203     /* sync our state with renderspu,
    204      * do it before mural & context deletion to avoid deleting currently set murals/contexts*/
    205     cr_server.head_spu->dispatch_table.MakeCurrent(CR_RENDER_DEFAULT_WINDOW_ID, 0, CR_RENDER_DEFAULT_CONTEXT_ID);
     202    if (!fContextsDeleted)
     203    {
     204        /* sync our state with renderspu,
     205         * do it before mural & context deletion to avoid deleting currently set murals/contexts*/
     206        cr_server.head_spu->dispatch_table.MakeCurrent(CR_RENDER_DEFAULT_WINDOW_ID, 0, CR_RENDER_DEFAULT_CONTEXT_ID);
     207    }
    206208
    207209    /* Deallocate all semaphores */
     
    217219
    218220    /* synchronize with reality */
    219     fOldEnableDiff = crStateEnableDiffOnMakeCurrent(GL_FALSE);
    220     if(cr_server.MainContextInfo.pContext)
    221         crStateMakeCurrent(cr_server.MainContextInfo.pContext);
    222     crStateEnableDiffOnMakeCurrent(fOldEnableDiff);
     221    if (!fContextsDeleted)
     222    {
     223        fOldEnableDiff = crStateEnableDiffOnMakeCurrent(GL_FALSE);
     224        if(cr_server.MainContextInfo.pContext)
     225            crStateMakeCurrent(cr_server.MainContextInfo.pContext);
     226        crStateEnableDiffOnMakeCurrent(fOldEnableDiff);
     227    }
    223228
    224229    /* Free vertex programs */
     
    41704175}
    41714176
     4177
     4178static DECLCALLBACK(bool) crVBoxServerHasDataForScreen(uint32_t u32ScreenID)
     4179{
     4180    HCR_FRAMEBUFFER hFb = CrPMgrFbGetEnabled(u32ScreenID);
     4181    if (hFb)
     4182        return CrFbHas3DData(hFb);
     4183
     4184    return false;
     4185}
     4186
     4187
    41724188static DECLCALLBACK(bool) crVBoxServerHasData()
    41734189{
     
    42184234
    42194235            pSetup->MainInterface.pfnHasData = crVBoxServerHasData;
     4236            pSetup->MainInterface.pfnHasDataForScreen = crVBoxServerHasDataForScreen;
    42204237
    42214238            rc = VINF_SUCCESS;
     
    42364253}
    42374254
    4238 int32_t crVBoxServerHgcmEnable(VBOXCRCMDCTL_HGCMENABLE_DATA *pData)
     4255static int crVBoxServerCrCmdDisablePostProcess(VBOXCRCMDCTL_HGCMENABLE_DATA *pData)
    42394256{
    42404257    int rc = VINF_SUCCESS;
     
    42574274    }
    42584275
     4276    memset(&cr_server.DisableData, 0, sizeof (cr_server.DisableData));
     4277
     4278    return VINF_SUCCESS;
     4279}
     4280
     4281int32_t crVBoxServerHgcmEnable(VBOXCRCMDCTL_HGCMENABLE_DATA *pData)
     4282{
     4283    int rc = crVBoxServerCrCmdDisablePostProcess(pData);
     4284    if (RT_FAILURE(rc))
     4285    {
     4286        WARN(("crVBoxServerCrCmdDisablePostProcess failed %d", rc));
     4287        return rc;
     4288    }
     4289
    42594290    crVBoxServerDefaultContextSet();
    4260 
    4261     memset(&cr_server.DisableData, 0, sizeof (cr_server.DisableData));
    42624291
    42634292    return VINF_SUCCESS;
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