VirtualBox

Ignore:
Timestamp:
May 21, 2014 12:56:33 PM (11 years ago)
Author:
vboxsync
Message:

crOpenGL: multi-screen fixes

Location:
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server.h

    r51260 r51320  
    410410HCR_FRAMEBUFFER CrPMgrFbGetFirstEnabled();
    411411HCR_FRAMEBUFFER CrPMgrFbGetNextEnabled(HCR_FRAMEBUFFER hFb);
    412 HCR_FRAMEBUFFER CrPMgrFbGetEnabled(uint32_t idScreen);
     412HCR_FRAMEBUFFER CrPMgrFbGetEnabled(uint32_t idFb);
     413HCR_FRAMEBUFFER CrPMgrFbGetEnabledForScreen(uint32_t idScreen);
    413414int CrPMgrModeVrdp(bool fEnable);
    414415int CrPMgrModeRootVr(bool fEnable);
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c

    r51260 r51320  
    41804180static DECLCALLBACK(bool) crVBoxServerHasDataForScreen(uint32_t u32ScreenID)
    41814181{
    4182     HCR_FRAMEBUFFER hFb = CrPMgrFbGetEnabled(u32ScreenID);
     4182    HCR_FRAMEBUFFER hFb = CrPMgrFbGetEnabledForScreen(u32ScreenID);
    41834183    if (hFb)
    41844184        return CrFbHas3DData(hFb);
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_muralfbo.cpp

    r51260 r51320  
    651651DECLEXPORT(int) crServerVBoxScreenshotGet(uint32_t u32Screen, uint32_t width, uint32_t height, uint32_t pitch, void *pvBuffer, CR_SCREENSHOT *pScreenshot)
    652652{
    653     HCR_FRAMEBUFFER hFb = CrPMgrFbGetEnabled(u32Screen);
     653    HCR_FRAMEBUFFER hFb = CrPMgrFbGetEnabledForScreen(u32Screen);
    654654    if (!hFb)
    655655        return VERR_INVALID_STATE;
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_presenter.cpp

    r51269 r51320  
    156156/* FRAMEBUFFER */
    157157
    158 void CrFbInit(CR_FRAMEBUFFER *pFb, uint32_t idScreen)
     158void CrFbInit(CR_FRAMEBUFFER *pFb, uint32_t idFb)
    159159{
    160160    RTRECT Rect;
     
    165165    memset(pFb, 0, sizeof (*pFb));
    166166    pFb->ScreenInfo.u16Flags = VBVA_SCREEN_F_DISABLED;
    167     pFb->ScreenInfo.u32ViewIndex = idScreen;
     167    pFb->ScreenInfo.u32ViewIndex = idFb;
    168168    CrVrScrCompositorInit(&pFb->Compositor, &Rect);
    169169    RTListInit(&pFb->EntriesList);
     
    957957        return;
    958958    }
    959     uint32_t idScreen = pFb->ScreenInfo.u32ViewIndex;
     959    uint32_t idFb = pFb->ScreenInfo.u32ViewIndex;
    960960
    961961    CrVrScrCompositorClear(&pFb->Compositor);
     
    968968
    969969    pFb->ScreenInfo.u16Flags = VBVA_SCREEN_F_DISABLED;
    970     pFb->ScreenInfo.u32ViewIndex = idScreen;
     970    pFb->ScreenInfo.u32ViewIndex = idFb;
    971971}
    972972
     
    39373937}
    39383938
    3939 HCR_FRAMEBUFFER CrPMgrFbGet(uint32_t idScreen)
    3940 {
    3941     if (idScreen >= CR_MAX_GUEST_MONITORS)
    3942     {
    3943         WARN(("invalid idScreen %d", idScreen));
     3939HCR_FRAMEBUFFER CrPMgrFbGet(uint32_t idFb)
     3940{
     3941    if (idFb >= CR_MAX_GUEST_MONITORS)
     3942    {
     3943        WARN(("invalid idFb %d", idFb));
    39443944        return NULL;
    39453945    }
    39463946
    3947     if (!CrFBmIsSet(&g_CrPresenter.FramebufferInitMap, idScreen))
    3948     {
    3949         CrFbInit(&g_CrPresenter.aFramebuffers[idScreen], idScreen);
    3950         CrFBmSetAtomic(&g_CrPresenter.FramebufferInitMap, idScreen);
     3947    if (!CrFBmIsSet(&g_CrPresenter.FramebufferInitMap, idFb))
     3948    {
     3949        CrFbInit(&g_CrPresenter.aFramebuffers[idFb], idFb);
     3950        CrFBmSetAtomic(&g_CrPresenter.FramebufferInitMap, idFb);
    39513951    }
    39523952    else
    3953         Assert(g_CrPresenter.aFramebuffers[idScreen].ScreenInfo.u32ViewIndex == idScreen);
    3954 
    3955     return &g_CrPresenter.aFramebuffers[idScreen];
    3956 }
    3957 
    3958 HCR_FRAMEBUFFER CrPMgrFbGetInitialized(uint32_t idScreen)
    3959 {
    3960     if (idScreen >= CR_MAX_GUEST_MONITORS)
    3961     {
    3962         WARN(("invalid idScreen %d", idScreen));
     3953        Assert(g_CrPresenter.aFramebuffers[idFb].ScreenInfo.u32ViewIndex == idFb);
     3954
     3955    return &g_CrPresenter.aFramebuffers[idFb];
     3956}
     3957
     3958HCR_FRAMEBUFFER CrPMgrFbGetInitialized(uint32_t idFb)
     3959{
     3960    if (idFb >= CR_MAX_GUEST_MONITORS)
     3961    {
     3962        WARN(("invalid idFb %d", idFb));
    39633963        return NULL;
    39643964    }
    39653965
    3966     if (!CrFBmIsSet(&g_CrPresenter.FramebufferInitMap, idScreen))
     3966    if (!CrFBmIsSet(&g_CrPresenter.FramebufferInitMap, idFb))
    39673967    {
    39683968        return NULL;
    39693969    }
    39703970    else
    3971         Assert(g_CrPresenter.aFramebuffers[idScreen].ScreenInfo.u32ViewIndex == idScreen);
    3972 
    3973     return &g_CrPresenter.aFramebuffers[idScreen];
    3974 }
    3975 
    3976 HCR_FRAMEBUFFER CrPMgrFbGetEnabled(uint32_t idScreen)
    3977 {
    3978     HCR_FRAMEBUFFER hFb = CrPMgrFbGetInitialized(idScreen);
     3971        Assert(g_CrPresenter.aFramebuffers[idFb].ScreenInfo.u32ViewIndex == idFb);
     3972
     3973    return &g_CrPresenter.aFramebuffers[idFb];
     3974}
     3975
     3976HCR_FRAMEBUFFER CrPMgrFbGetEnabled(uint32_t idFb)
     3977{
     3978    HCR_FRAMEBUFFER hFb = CrPMgrFbGetInitialized(idFb);
    39793979
    39803980    if(hFb && CrFbIsEnabled(hFb))
     
    39823982
    39833983    return NULL;
     3984}
     3985
     3986HCR_FRAMEBUFFER CrPMgrFbGetEnabledForScreen(uint32_t idScreen)
     3987{
     3988    if (idScreen >= cr_server.screenCount)
     3989    {
     3990        WARN(("invalid target id"));
     3991        return NULL;
     3992    }
     3993
     3994    const CR_FBDISPLAY_INFO *pDpInfo = &g_CrPresenter.aDisplayInfos[idScreen];
     3995    if (pDpInfo->iFb < 0)
     3996        return NULL;
     3997
     3998    return CrPMgrFbGetEnabled(pDpInfo->iFb);
    39843999}
    39854000
     
    51735188crServerDispatchVBoxTexPresent(GLuint texture, GLuint cfg, GLint xPos, GLint yPos, GLint cRects, const GLint *pRects)
    51745189{
    5175     uint32_t idScreen = CR_PRESENT_GET_SCREEN(cfg);
    5176     if (idScreen >= CR_MAX_GUEST_MONITORS)
     5190    uint32_t idFb = CR_PRESENT_GET_SCREEN(cfg);
     5191    if (idFb >= CR_MAX_GUEST_MONITORS)
    51775192    {
    51785193        WARN(("Invalid guest screen"));
     
    51805195    }
    51815196
    5182     HCR_FRAMEBUFFER hFb = CrPMgrFbGetEnabled(idScreen);
     5197    HCR_FRAMEBUFFER hFb = CrPMgrFbGetEnabled(idFb);
    51835198    if (!hFb)
    51845199    {
     
    55195534    {
    55205535        const VBVAINFOSCREEN *pScreen = CrFbGetScreenInfo(hFb);
    5521         Assert(pScreen->u32Width == width);
    5522         Assert(pScreen->u32Height == height);
     5536        Assert(!width || pScreen->u32Width == width);
     5537        Assert(!height || pScreen->u32Height == height);
    55235538
    55245539        crServerDispatchVBoxTexPresent(hostId, pScreen->u32ViewIndex, pPos->x, pPos->y, cRects, (const GLint*)pRects);
     
    59916006    }
    59926007
    5993     uint32_t idScreen = pFlip->Hdr.u.u8PrimaryID;
    5994     HCR_FRAMEBUFFER hFb = CrPMgrFbGetEnabled(idScreen);
     6008    uint32_t idFb = pFlip->Hdr.u.u8PrimaryID;
     6009    HCR_FRAMEBUFFER hFb = CrPMgrFbGetEnabled(idFb);
    59956010    if (!hFb)
    59966011    {
     
    60006015
    60016016    const RTRECT *pRect = CrVrScrCompositorRectGet(&hFb->Compositor);
    6002     crServerDispatchVBoxTexPresent(hostId, idScreen, 0, 0, 1, (const GLint*)pRect);
     6017    crServerDispatchVBoxTexPresent(hostId, idFb, 0, 0, 1, (const GLint*)pRect);
    60036018    return 0;
    60046019}
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