VirtualBox

Changeset 44331 in vbox


Ignore:
Timestamp:
Jan 22, 2013 6:54:28 PM (12 years ago)
Author:
vboxsync
Message:

wddm: fix display re-enabling

Location:
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPMisc.cpp

    r43489 r44331  
    26742674        if (pSource->AllocData.Addr.offVram != PhAddr.QuadPart
    26752675                || pSource->AllocData.Addr.SegmentId != 1)
    2676             pSource->bGhSynced = FALSE;
     2676            pSource->fGhSynced = 0;
    26772677        pSource->AllocData.Addr.SegmentId = 1;
    26782678        pSource->AllocData.Addr.offVram = PhAddr.QuadPart;
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPTypes.h

    r43489 r44331  
    111111    VBOXWDDM_ALLOC_DATA AllocData;
    112112    BOOLEAN bVisible;
    113     BOOLEAN bGhSynced;
     113    char fGhSynced;
    114114    VBOXVBVAINFO Vbva;
    115115#ifdef VBOX_WITH_VIDEOHWACCEL
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVidPn.cpp

    r44040 r44331  
    21222122    }
    21232123    Assert(pSource->AllocData.SurfDesc.VidPnSourceId == srcId);
    2124     pSource->bGhSynced = FALSE;
     2124    pSource->fGhSynced = 0;
    21252125    return STATUS_SUCCESS;
    21262126}
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp

    r44040 r44331  
    296296bool vboxWddmGhDisplayCheckSetInfoFromSource(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_SOURCE pSource)
    297297{
    298     Assert(VBOXVIDEOOFFSET_VOID != pSource->AllocData.Addr.offVram);
    299 
    300     if (pSource->bGhSynced)
     298//    Assert(VBOXVIDEOOFFSET_VOID != pSource->AllocData.Addr.offVram);
     299
     300    if (pSource->fGhSynced)
    301301        return false;
    302302
     303    char fGhSynced = 1;
    303304    PVBOXWDDM_ALLOCATION pFbAlloc = VBOXWDDM_FB_ALLOCATION(pDevExt, pSource);
     305#ifdef VBOXWDDM_RENDER_FROM_SHADOW
     306# ifdef VBOX_WDDM_WIN8
     307    if (!g_VBoxDisplayOnly)
     308# endif
     309    {
     310        if (!pFbAlloc)
     311        {
     312            pFbAlloc = VBOXWDDM_NONFB_ALLOCATION(pDevExt, pSource);
     313            fGhSynced = -1;
     314        }
     315
     316        if (!pFbAlloc || pFbAlloc->AllocData.Addr.offVram == VBOXVIDEOOFFSET_VOID)
     317        {
     318            return false;
     319        }
     320    }
     321#endif
    304322
    305323#ifdef VBOX_WDDM_WIN8
     
    315333    NTSTATUS Status = vboxWddmGhDisplaySetInfo(pDevExt, pFbAlloc ? &pFbAlloc->AllocData : &pSource->AllocData, &pSource->VScreenPos);
    316334    if (NT_SUCCESS(Status))
    317         pSource->bGhSynced = TRUE;
     335        pSource->fGhSynced = fGhSynced;
    318336    else
    319337        WARN(("vboxWddmGhDisplaySetInfo failed, Status (0x%x)", Status));
     
    355373
    356374        /* ensure we issue resize command on next update */
    357         pSource->bGhSynced = FALSE;
     375        pSource->fGhSynced = 0;
    358376    }
    359377}
     
    403421    if (pSource->pPrimaryAllocation->enmType == VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC)
    404422    {
    405         Assert(pSource->bGhSynced == FALSE);
     423//        Assert(pSource->fGhSynced == FALSE);
    406424        return false;
    407425    }
     
    47464764    }
    47474765
    4748     pSource->bGhSynced = FALSE; /* force guest->host notification */
     4766    pSource->fGhSynced = 0; /* force guest->host notification */
    47494767
    47504768    if (pSource->bVisible
    4751 #if defined(VBOXWDDM_RENDER_FROM_SHADOW)
    4752             && (
    4753 # if defined(VBOX_WDDM_WIN8)
    4754             g_VBoxDisplayOnly
    4755                     ||
    4756 # endif
    4757                     pDevExt->fRenderToShadowDisabled
    4758                     /* only update for UMD_RC_GENERIC when resolution changes to inform host about it
    4759                      * otherwise keep host using the same VRAM, containing a valid data before the switch (i.e. SHADOW) */
    4760                     || (pAllocation
    4761                             && pAllocation->enmType == VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC
    4762                             && (pAllocation->AllocData.SurfDesc.width != pSource->AllocData.SurfDesc.width
    4763                                     || pAllocation->AllocData.SurfDesc.height != pSource->AllocData.SurfDesc.height)
    4764                             )
    4765                     )
    4766 #endif
     4769//#if defined(VBOXWDDM_RENDER_FROM_SHADOW)
     4770//            && (
     4771//# if defined(VBOX_WDDM_WIN8)
     4772//            g_VBoxDisplayOnly
     4773//                    ||
     4774//# endif
     4775//                    pDevExt->fRenderToShadowDisabled
     4776//                    /* only update for UMD_RC_GENERIC when resolution changes to inform host about it
     4777//                     * otherwise keep host using the same VRAM, containing a valid data before the switch (i.e. SHADOW) */
     4778//                    || (pAllocation
     4779//                            && pAllocation->enmType == VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC
     4780//                            && (pAllocation->AllocData.SurfDesc.width != pSource->AllocData.SurfDesc.width
     4781//                                    || pAllocation->AllocData.SurfDesc.height != pSource->AllocData.SurfDesc.height)
     4782//                            )
     4783//                    )
     4784//#endif
    47674785            )
    47684786    {
     
    48124830        pSource->bVisible = pSetVidPnSourceVisibility->Visible;
    48134831        if (pSource->bVisible
    4814 #if defined(VBOXWDDM_RENDER_FROM_SHADOW)
    4815                 && (
    4816 # if defined(VBOX_WDDM_WIN8)
    4817                 g_VBoxDisplayOnly
    4818                         ||
    4819 # endif
    4820                         pDevExt->fRenderToShadowDisabled
    4821                         /* only update for UMD_RC_GENERIC when resolution changes to inform host about it
    4822                          * otherwise keep host using the same VRAM, containing a valid data before the switch (i.e. SHADOW) */
    4823                         || (pAllocation
    4824                                 && pAllocation->enmType == VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC
    4825                                 && (pAllocation->AllocData.SurfDesc.width != pSource->AllocData.SurfDesc.width
    4826                                         || pAllocation->AllocData.SurfDesc.height != pSource->AllocData.SurfDesc.height)
    4827                                 )
    4828                         )
    4829 #endif
     4832//#if defined(VBOXWDDM_RENDER_FROM_SHADOW)
     4833//                && (
     4834//# if defined(VBOX_WDDM_WIN8)
     4835//                g_VBoxDisplayOnly
     4836//                        ||
     4837//# endif
     4838//                        pDevExt->fRenderToShadowDisabled
     4839//                        /* only update for UMD_RC_GENERIC when resolution changes to inform host about it
     4840//                         * otherwise keep host using the same VRAM, containing a valid data before the switch (i.e. SHADOW) */
     4841//                        || (pAllocation
     4842//                                && pAllocation->enmType == VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC
     4843//                                && (pAllocation->AllocData.SurfDesc.width != pSource->AllocData.SurfDesc.width
     4844//                                        || pAllocation->AllocData.SurfDesc.height != pSource->AllocData.SurfDesc.height)
     4845//                                )
     4846//                        )
     4847//#endif
    48304848                )
    48314849        {
     
    49955013        }
    49965014
    4997 #ifdef VBOX_WDDM_WIN8
    4998         if (g_VBoxDisplayOnly)
     5015//#ifdef VBOX_WDDM_WIN8
     5016//        if (g_VBoxDisplayOnly)
    49995017        {
    50005018            for (int i = 0; /* <- never try to hide a primary monitor */
     
    50025020            {
    50035021                PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[i];
    5004                 if (pSource->bVisible && !pSource->bGhSynced)
     5022                if (pSource->bVisible)
    50055023                {
    50065024                    vboxWddmGhDisplayCheckSetInfoFromSource(pDevExt, pSource);
     
    50085026            }
    50095027        }
    5010 #endif
     5028//#endif
    50115029        LOGF(("LEAVE, SUCCESS status(0x%x), context(0x%x)", Status, hAdapter));
    50125030
     
    61206138            for (int i = 0; i < VBoxCommonFromDeviceExt(pDevExt)->cDisplays; ++i)
    61216139            {
    6122                 pDevExt->aSources[i].bGhSynced = FALSE;
     6140                pDevExt->aSources[i].fGhSynced = 0;
    61236141                NTSTATUS tmpStatus= vboxWddmDisplaySettingsQueryPos(pDevExt, i, &pDevExt->aSources[i].VScreenPos);
    61246142                Assert(tmpStatus == STATUS_SUCCESS);
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.h

    r44038 r44331  
    102102DECLINLINE(void) vboxWddmAssignShadow(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_SOURCE pSource, PVBOXWDDM_ALLOCATION pAllocation, D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId)
    103103{
    104     if (pSource->pShadowAllocation == pAllocation)
     104    if (pSource->pShadowAllocation == pAllocation && pSource->fGhSynced > 0)
    105105    {
    106106        Assert(pAllocation->bAssigned);
     
    130130
    131131        if(!vboxWddmAddrVramEqual(&pSource->AllocData.Addr, &pAllocation->AllocData.Addr))
    132             pSource->bGhSynced = FALSE; /* force guest->host notification */
     132            pSource->fGhSynced = 0; /* force guest->host notification */
    133133        pSource->AllocData.Addr = pAllocation->AllocData.Addr;
    134134    }
     
    162162
    163163        if(!vboxWddmAddrVramEqual(&pSource->AllocData.Addr, &pAllocation->AllocData.Addr))
    164             pSource->bGhSynced = FALSE; /* force guest->host notification */
     164            pSource->fGhSynced = 0; /* force guest->host notification */
    165165        pSource->AllocData.Addr = pAllocation->AllocData.Addr;
    166166
     
    208208                        ) \
    209209                )
     210# define VBOXWDDM_NONFB_ALLOCATION(_pDevExt, _pSrc) ( !((_pSrc)->pPrimaryAllocation && VBOXWDDM_IS_FB_ALLOCATION(_pDevExt, (_pSrc)->pPrimaryAllocation)) ? \
     211                (_pSrc)->pPrimaryAllocation : ( \
     212                        ((_pSrc)->pShadowAllocation && VBOXWDDM_IS_FB_ALLOCATION(_pDevExt, (_pSrc)->pShadowAllocation)) ? \
     213                                (_pSrc)->pShadowAllocation : NULL \
     214                        ) \
     215                )
    210216#else
    211217# define VBOXWDDM_FB_ALLOCATION(_pDevExt, _pSrc) ((_pSrc)->pPrimaryAllocation)
Note: See TracChangeset for help on using the changeset viewer.

© 2023 Oracle
ContactPrivacy policyTerms of Use