VirtualBox

Changeset 50799 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 17, 2014 12:14:01 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
92830
Message:

crOpenGL: more on new command submission

Location:
trunk/src/VBox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA_VDMA.cpp

    r50773 r50799  
    942942}
    943943
    944 static DECLCALLBACK(VBOXCRCMDCTL*) vboxVDMACrHgcmHandleEnableRemainingHostCommand(HVBOXCRCMDCTL_REMAINING_HOST_COMMAND hClient, uint32_t *pcbCtl, int prevCmdRc)
     944static DECLCALLBACK(uint8_t*) vboxVDMACrHgcmHandleEnableRemainingHostCommand(HVBOXCRCMDCTL_REMAINING_HOST_COMMAND hClient, uint32_t *pcbCtl, int prevCmdRc)
    945945{
    946946    struct VBOXVDMAHOST *pVdma = hClient;
     
    959959    {
    960960        *pcbCtl = pVdma->pCurRemainingHostCtl->u.cmd.cbCmd;
    961         return (VBOXCRCMDCTL*)pVdma->pCurRemainingHostCtl->u.cmd.pu8Cmd;
     961        return pVdma->pCurRemainingHostCtl->u.cmd.pu8Cmd;
    962962    }
    963963
  • trunk/src/VBox/GuestHost/OpenGL/include/cr_server.h

    r50754 r50799  
    569569#endif
    570570
     571extern DECLEXPORT(int32_t) crVBoxServerHgcmEnable(HVBOXCRCMDCTL_REMAINING_HOST_COMMAND hRHCmd, PFNVBOXCRCMDCTL_REMAINING_HOST_COMMAND pfnRHCmd);
     572extern DECLEXPORT(int32_t) crVBoxServerHgcmDisable();
     573
    571574#ifdef __cplusplus
    572575}
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c

    r50773 r50799  
    36513651}
    36523652
     3653void crVBoxServerDefaultContextSet()
     3654{
     3655    GLint spuWindow, spuCtx;
     3656
     3657    if (cr_server.MainContextInfo.SpuContext)
     3658    {
     3659        CRMuralInfo *pMural = crServerGetDummyMural(cr_server.MainContextInfo.CreateInfo.realVisualBits);
     3660        if (!pMural)
     3661        {
     3662            WARN(("dummy mural is NULL"));
     3663            spuCtx = CR_RENDER_DEFAULT_CONTEXT_ID;
     3664            spuWindow = CR_RENDER_DEFAULT_WINDOW_ID;
     3665        }
     3666        else
     3667        {
     3668            spuCtx = cr_server.MainContextInfo.SpuContext;
     3669            spuWindow = pMural->CreateInfo.realVisualBits;
     3670        }
     3671    }
     3672    else
     3673    {
     3674        spuCtx = CR_RENDER_DEFAULT_CONTEXT_ID;
     3675        spuWindow = CR_RENDER_DEFAULT_WINDOW_ID;
     3676    }
     3677
     3678    cr_server.head_spu->dispatch_table.MakeCurrent(spuWindow, 0, spuCtx);
     3679}
     3680
     3681int32_t crVBoxServerHgcmEnable(HVBOXCRCMDCTL_REMAINING_HOST_COMMAND hRHCmd, PFNVBOXCRCMDCTL_REMAINING_HOST_COMMAND pfnRHCmd)
     3682{
     3683    int rc = VINF_SUCCESS;
     3684    uint8_t* pCtl;
     3685    uint32_t cbCtl;
     3686
     3687    if (cr_server.numClients)
     3688    {
     3689        WARN(("cr_server.numClients(%d) is not NULL", cr_server.numClients));
     3690        return VERR_INVALID_STATE;
     3691    }
     3692
     3693    for (pCtl = pfnRHCmd(hRHCmd, &cbCtl, rc); pCtl; pCtl = pfnRHCmd(hRHCmd, &cbCtl, rc))
     3694    {
     3695        rc = crVBoxCrCmdHostCtl(NULL, pCtl, cbCtl);
     3696    }
     3697
     3698    crVBoxServerDefaultContextSet();
     3699
     3700    return VINF_SUCCESS;
     3701}
     3702
     3703int32_t crVBoxServerHgcmDisable()
     3704{
     3705    if (cr_server.numClients)
     3706    {
     3707        WARN(("cr_server.numClients(%d) is not NULL", cr_server.numClients));
     3708        return VERR_INVALID_STATE;
     3709    }
     3710
     3711    cr_server.head_spu->dispatch_table.MakeCurrent(0, 0, 0);
     3712
     3713    return VINF_SUCCESS;
     3714}
     3715
    36533716#endif
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