VirtualBox

Ignore:
Timestamp:
Jul 9, 2013 4:27:54 PM (11 years ago)
Author:
vboxsync
Message:

wddm/3d: fixes to r0-based presentation

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

Legend:

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

    r47039 r47059  
    209209}
    210210
    211 DECLINLINE(BOOLEAN) vboxWddmSwapchainRetain(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_SWAPCHAIN pSwapchain)
     211BOOLEAN vboxWddmSwapchainRetain(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_SWAPCHAIN pSwapchain)
    212212{
    213213    KIRQL OldIrql;
     
    219219}
    220220
    221 DECLINLINE(VOID) vboxWddmSwapchainRelease(PVBOXWDDM_SWAPCHAIN pSwapchain)
     221VOID vboxWddmSwapchainRelease(PVBOXWDDM_SWAPCHAIN pSwapchain)
    222222{
    223223    const uint32_t cRefs = ASMAtomicDecU32(&pSwapchain->cRefs);
     
    230230}
    231231
    232 PVBOXWDDM_SWAPCHAIN vboxWddmSwapchainRetainByAlloc(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_ALLOCATION pAlloc)
     232PVBOXWDDM_SWAPCHAIN vboxWddmSwapchainRetainByAllocData(PVBOXMP_DEVEXT pDevExt, const struct VBOXWDDM_ALLOC_DATA *pAllocData)
    233233{
    234234    KIRQL OldIrql;
    235235    PVBOXWDDM_SWAPCHAIN pSwapchain;
    236236    KeAcquireSpinLock(&pDevExt->SynchLock, &OldIrql);
    237     pSwapchain = pAlloc->pSwapchain;
     237    pSwapchain = pAllocData->pSwapchain;
    238238    if (pSwapchain && !vboxWddmSwapchainRetainLocked(pSwapchain))
    239239        pSwapchain = NULL;
     
    242242}
    243243
     244PVBOXWDDM_SWAPCHAIN vboxWddmSwapchainRetainByAlloc(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_ALLOCATION pAlloc)
     245{
     246    return vboxWddmSwapchainRetainByAllocData(pDevExt, &pAlloc->AllocData);
     247}
     248
    244249VOID vboxWddmSwapchainAllocRemove(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_SWAPCHAIN pSwapchain, PVBOXWDDM_ALLOCATION pAlloc)
    245250{
    246251    KIRQL OldIrql;
    247252    KeAcquireSpinLock(&pDevExt->SynchLock, &OldIrql);
    248     Assert(pAlloc->pSwapchain == pSwapchain);
    249     pAlloc->pSwapchain = NULL;
     253    Assert(pAlloc->AllocData.pSwapchain == pSwapchain);
     254    pAlloc->AllocData.pSwapchain = NULL;
    250255    RemoveEntryList(&pAlloc->SwapchainEntry);
    251256    KeReleaseSpinLock(&pDevExt->SynchLock, OldIrql);
     
    257262    KIRQL OldIrql;
    258263    BOOLEAN bRc;
    259     Assert(!pAlloc->pSwapchain);
     264    Assert(!pAlloc->AllocData.pSwapchain);
    260265    KeAcquireSpinLock(&pDevExt->SynchLock, &OldIrql);
    261266    bRc = vboxWddmSwapchainRetainLocked(pSwapchain);
    262267    if (bRc)
    263268    {
    264         if (pAlloc->pSwapchain)
     269        if (pAlloc->AllocData.pSwapchain)
    265270        {
    266271            RemoveEntryList(&pAlloc->SwapchainEntry);
    267272        }
    268273        InsertTailList(&pSwapchain->AllocList, &pAlloc->SwapchainEntry);
    269         pAlloc->pSwapchain = pSwapchain;
     274        pAlloc->AllocData.pSwapchain = pSwapchain;
    270275    }
    271276    KeReleaseSpinLock(&pDevExt->SynchLock, OldIrql);
     
    287292            PVBOXWDDM_ALLOCATION pAlloc = VBOXSCENTRY_2_ALLOC(pEntry);
    288293            pEntry = pEntry->Flink;
    289             Assert(pAlloc->pSwapchain == pSwapchain);
    290             pAlloc->pSwapchain = NULL;
     294            Assert(pAlloc->AllocData.pSwapchain == pSwapchain);
     295            pAlloc->AllocData.pSwapchain = NULL;
    291296            RemoveEntryList(&pAlloc->SwapchainEntry);
    292297            ++cRemoved;
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPMisc.h

    r47039 r47059  
    7272
    7373PVBOXWDDM_SWAPCHAIN vboxWddmSwapchainCreate();
    74 DECLINLINE(BOOLEAN) vboxWddmSwapchainRetain(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_SWAPCHAIN pSwapchain);
    75 DECLINLINE(VOID) vboxWddmSwapchainRelease(PVBOXWDDM_SWAPCHAIN pSwapchain);
     74BOOLEAN vboxWddmSwapchainRetain(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_SWAPCHAIN pSwapchain);
     75VOID vboxWddmSwapchainRelease(PVBOXWDDM_SWAPCHAIN pSwapchain);
    7676PVBOXWDDM_SWAPCHAIN vboxWddmSwapchainRetainByAlloc(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_ALLOCATION pAlloc);
     77PVBOXWDDM_SWAPCHAIN vboxWddmSwapchainRetainByAllocData(PVBOXMP_DEVEXT pDevExt, const struct VBOXWDDM_ALLOC_DATA *pAllocData);
    7778VOID vboxWddmSwapchainAllocRemove(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_SWAPCHAIN pSwapchain, PVBOXWDDM_ALLOCATION pAlloc);
    7879BOOLEAN vboxWddmSwapchainAllocAdd(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_SWAPCHAIN pSwapchain, PVBOXWDDM_ALLOCATION pAlloc);
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPTypes.h

    r46966 r47059  
    104104    VBOXWDDM_SURFACE_DESC SurfDesc;
    105105    VBOXWDDM_ADDR Addr;
     106    uint32_t hostID;
     107    struct VBOXWDDM_SWAPCHAIN *pSwapchain;
    106108} VBOXWDDM_ALLOC_DATA, *PVBOXWDDM_ALLOC_DATA;
    107109
     
    144146{
    145147    LIST_ENTRY SwapchainEntry;
    146     struct VBOXWDDM_SWAPCHAIN *pSwapchain;
    147148    VBOXWDDM_ALLOC_TYPE enmType;
    148149    volatile uint32_t cRefs;
     
    166167    KSPIN_LOCK OpenLock;
    167168    LIST_ENTRY OpenList;
    168     uint32_t hostID;
    169169    /* helps tracking when to release wine shared resource */
    170170    uint32_t cShRcRefs;
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.cpp

    r47049 r47059  
    448448 */
    449449static NTSTATUS vboxVdmaProcessVRegCmdLegacy(PVBOXMP_DEVEXT pDevExt,
    450         PVBOXWDDM_CONTEXT pContext,
     450        VBOXMP_CRPACKER *pCrPacker,
     451        uint32_t u32CrConClientID,
    451452        PVBOXWDDM_SOURCE pSource,
    452453        PVBOXWDDM_SWAPCHAIN pSwapchain,
     
    570571        goto done;
    571572
    572     PVBOXMP_CRPACKER pPacker = &pContext->CrPacker;
    573573    uint32_t cbCommandBuffer = VBOXMP_CRCMD_HEADER_SIZE, cCommands = 0;
    574574
     
    606606    }
    607607
    608     VBoxMpCrPackerTxBufferInit(pPacker,pvCommandBuffer, cbCommandBuffer, cCommands);
     608    VBoxMpCrPackerTxBufferInit(pCrPacker, pvCommandBuffer, cbCommandBuffer, cCommands);
    609609
    610610    Assert(pSwapchain->winHostID);
    611611
    612612    if (fCurRectChanged && fCurChanged)
    613         crPackWindowPosition(&pPacker->CrPacker, pSwapchain->winHostID, CurPos.x, CurPos.y);
     613        crPackWindowPosition(&pCrPacker->CrPacker, pSwapchain->winHostID, CurPos.x, CurPos.y);
    614614
    615615    if (!pSwapchain->fExposed)
    616616    {
    617         crPackWindowSize(&pPacker->CrPacker, pSwapchain->winHostID, pSwapchain->width, pSwapchain->height);
    618         crPackWindowShow(&pPacker->CrPacker, pSwapchain->winHostID, TRUE);
     617        crPackWindowSize(&pCrPacker->CrPacker, pSwapchain->winHostID, pSwapchain->width, pSwapchain->height);
     618        crPackWindowShow(&pCrPacker->CrPacker, pSwapchain->winHostID, TRUE);
    619619        pSwapchain->fExposed = TRUE;
    620620    }
    621621
    622     crPackWindowVisibleRegion(&pPacker->CrPacker, pSwapchain->winHostID, cVRects, (GLint*)pVRectsBuff);
    623 
    624     Status = vboxVdmaCrSubmitWriteAsync(pDevExt, pPacker, pContext->u32CrConClientID);
     622    crPackWindowVisibleRegion(&pCrPacker->CrPacker, pSwapchain->winHostID, cVRects, (GLint*)pVRectsBuff);
     623
     624    Status = vboxVdmaCrSubmitWriteAsync(pDevExt, pCrPacker, u32CrConClientID);
    625625    if (!NT_SUCCESS(Status))
    626626    {
     
    983983}
    984984
    985 NTSTATUS vboxVdmaTexPresentSetAlloc(PVBOXMP_DEVEXT pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, PVBOXWDDM_ALLOCATION pAllocation)
    986 {
    987     Assert(pDevExt->fTexPresentEnabled);
    988 
    989     RTRECT Rect, *pRect = NULL;
    990     uint32_t cRects = 0;
    991     uint32_t hostID = 0;
    992     uint32_t cfg = VidPnSourceId | CR_PRESENT_FLAG_CLEAR_RECTS;
    993     uint32_t u32CrConClientID;
    994     NTSTATUS Status = vboxVdmaCrCtlGetDefaultClientId(pDevExt, &u32CrConClientID);
    995     if (!NT_SUCCESS(Status))
    996     {
    997         WARN(("vboxVdmaCrCtlGetDefaultClientId failed Status 0x%x", Status));
    998         return Status;
    999     }
    1000 
    1001     VBOXMP_CRPACKER CrPacker;
    1002     VBoxMpCrPackerInit(&CrPacker);
    1003 
    1004     if (pAllocation && pAllocation->hostID)
    1005     {
    1006         hostID = pAllocation->hostID;
    1007         cRects = 1;
    1008         Rect.xLeft = 0;
    1009         Rect.yTop = 0;
    1010         Rect.xRight = pAllocation->AllocData.SurfDesc.width;
    1011         Rect.yBottom = pAllocation->AllocData.SurfDesc.height;
    1012         pRect = &Rect;
    1013         cfg = VidPnSourceId;
    1014     }
    1015 
    1016     Status = vboxVdmaTexPresentSubmit(pDevExt, &CrPacker, u32CrConClientID,
    1017             hostID, cfg, 0, 0, cRects, pRect);
    1018     if (!NT_SUCCESS(Status))
    1019     {
    1020         WARN(("vboxVdmaCrCtlGetDefaultClientId failed Status 0x%x", Status));
    1021         return Status;
    1022     }
    1023 
    1024     return STATUS_SUCCESS;
    1025  }
    1026 
    1027 static NTSTATUS vboxVdmaProcessVRegCmd(PVBOXMP_DEVEXT pDevExt, VBOXWDDM_CONTEXT *pContext,
    1028         VBOXWDDM_DMA_ALLOCINFO *pSrcAllocInfo,
    1029         VBOXWDDM_DMA_ALLOCINFO *pDstAllocInfo,
     985static NTSTATUS vboxVdmaProcessVReg(PVBOXMP_DEVEXT pDevExt,
     986        VBOXMP_CRPACKER *pCrPacker,
     987        uint32_t u32CrConClientID,
     988        const VBOXWDDM_ALLOC_DATA *pSrcAllocData,
     989        const VBOXWDDM_ALLOC_DATA *pDstAllocData,
    1030990        const RECT *pSrcRect, const VBOXVDMAPIPE_RECTS *pDstRects)
    1031991{
    1032     D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId = pDstAllocInfo->srcId;
     992    D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId = pDstAllocData->SurfDesc.VidPnSourceId;
    1033993    VBOXWDDM_SOURCE *pSource = &pDevExt->aSources[srcId];
    1034994    NTSTATUS Status = STATUS_SUCCESS;
     
    1037997    {
    1038998        /* we care only about screen regions */
    1039         PVBOXWDDM_ALLOCATION pDstAlloc = pDstAllocInfo->pAlloc;
    1040         PVBOXWDDM_ALLOCATION pSrcAlloc = pSrcAllocInfo->pAlloc;
    1041 
    1042         if (pDstAlloc != pSource->pPrimaryAllocation)
     999        if (pDstAllocData != &pSource->pPrimaryAllocation->AllocData)
    10431000        {
    10441001            WARN(("non-primary allocation passed to vboxWddmSubmitBltCmd!"));
     
    10461003        }
    10471004
    1048         uint32_t hostID = pSrcAlloc->hostID;
     1005        uint32_t hostID = pSrcAllocData->hostID;
    10491006        int rc;
    10501007        if (hostID)
    10511008        {
    1052             Assert(pContext->enmType == VBOXWDDM_CONTEXT_TYPE_CUSTOM_3D);
     1009//            Assert(pContext->enmType == VBOXWDDM_CONTEXT_TYPE_CUSTOM_3D);
    10531010            int32_t posX = pDstRects->ContextRect.left - pSrcRect->left;
    10541011            int32_t posY = pDstRects->ContextRect.top - pSrcRect->top;
    10551012
    1056             Status = vboxVdmaTexPresentSubmit(pDevExt, &pContext->CrPacker, pContext->u32CrConClientID, hostID, srcId, posX, posY, pDstRects->UpdateRects.cRects, (const RTRECT*)pDstRects->UpdateRects.aRects);
     1013            Status = vboxVdmaTexPresentSubmit(pDevExt, pCrPacker, u32CrConClientID, hostID, srcId, posX, posY, pDstRects->UpdateRects.cRects, (const RTRECT*)pDstRects->UpdateRects.aRects);
    10571014            if (NT_SUCCESS(Status))
    10581015            {
     
    10661023                WARN(("vboxVdmaTexPresentSubmit failed Status 0x%x", Status));
    10671024        }
    1068         else if (pSource->pPrimaryAllocation == pDstAlloc)
     1025        else if (&pSource->pPrimaryAllocation->AllocData == pDstAllocData)
    10691026        {
    10701027            bool fChanged = false;
    1071             Assert(pDstAlloc->bVisible);
     1028            Assert(pSource->pPrimaryAllocation->bVisible);
    10721029            rc = VBoxVrListRectsAdd(&pSource->VrList, pDstRects->UpdateRects.cRects, (const RTRECT*)pDstRects->UpdateRects.aRects, &fChanged);
    10731030            if (RT_SUCCESS(rc))
     
    10751032                if (fChanged)
    10761033                {
    1077                     Status = vboxVdmaTexPresentSubmit(pDevExt, &pContext->CrPacker, pContext->u32CrConClientID, hostID, srcId, 0, 0, pDstRects->UpdateRects.cRects, (const RTRECT*)pDstRects->UpdateRects.aRects);
     1034                    Status = vboxVdmaTexPresentSubmit(pDevExt, pCrPacker, u32CrConClientID, hostID, srcId, 0, 0, pDstRects->UpdateRects.cRects, (const RTRECT*)pDstRects->UpdateRects.aRects);
    10781035                    if (NT_SUCCESS(Status))
    10791036                    {
     
    10861043                                if (Rect.xLeft == 0
    10871044                                        && Rect.yTop == 0
    1088                                         && Rect.xRight == pDstAlloc->AllocData.SurfDesc.width
    1089                                         && Rect.yBottom == pDstAlloc->AllocData.SurfDesc.height)
     1045                                        && Rect.xRight == pDstAllocData->SurfDesc.width
     1046                                        && Rect.yBottom == pDstAllocData->SurfDesc.height)
    10901047                                {
    10911048                                    pSource->fHas3DVrs = FALSE;
     
    11091066    else
    11101067    {
    1111         PVBOXWDDM_ALLOCATION pSrcAlloc = pSrcAllocInfo->pAlloc;
    1112         PVBOXWDDM_SWAPCHAIN pSwapchain = vboxWddmSwapchainRetainByAlloc(pDevExt, pSrcAlloc);
     1068        PVBOXWDDM_SWAPCHAIN pSwapchain = vboxWddmSwapchainRetainByAllocData(pDevExt, pSrcAllocData);
    11131069
    11141070        if (pSwapchain)
    11151071        {
    1116             Assert(pSrcAlloc->AllocData.SurfDesc.width == pSwapchain->width);
    1117             Assert(pSrcAlloc->AllocData.SurfDesc.height == pSwapchain->height);
    1118         }
    1119 
    1120         Status = vboxVdmaProcessVRegCmdLegacy(pDevExt, pContext, pSource, pSwapchain, pSrcRect, pDstRects);
     1072            Assert(pSrcAllocData->SurfDesc.width == pSwapchain->width);
     1073            Assert(pSrcAllocData->SurfDesc.height == pSwapchain->height);
     1074        }
     1075
     1076        Status = vboxVdmaProcessVRegCmdLegacy(pDevExt, pCrPacker, u32CrConClientID, pSource, pSwapchain, pSrcRect, pDstRects);
    11211077        if (!NT_SUCCESS(Status))
    11221078            WARN(("vboxVdmaProcessVRegCmdLegacy failed Status 0x%x", Status));
     
    11271083
    11281084    return Status;
     1085}
     1086
     1087NTSTATUS vboxVdmaTexPresentSetAlloc(PVBOXMP_DEVEXT pDevExt, const VBOXWDDM_ALLOC_DATA *pAllocData)
     1088{
     1089    VBOXMP_CRPACKER CrPacker;
     1090    VBoxMpCrPackerInit(&CrPacker);
     1091    uint32_t u32CrConClientID;
     1092
     1093    NTSTATUS Status = vboxVdmaCrCtlGetDefaultClientId(pDevExt, &u32CrConClientID);
     1094    if (!NT_SUCCESS(Status))
     1095    {
     1096        WARN(("vboxVdmaCrCtlGetDefaultClientId failed Status 0x%x", Status));
     1097        return Status;
     1098    }
     1099
     1100    RECT Rect;
     1101    Rect.left = 0;
     1102    Rect.top = 0;
     1103    Rect.right = pAllocData->SurfDesc.width;
     1104    Rect.bottom = pAllocData->SurfDesc.height;
     1105
     1106    VBOXVDMAPIPE_RECTS RectInfo;
     1107    RectInfo.ContextRect = Rect;
     1108    RectInfo.UpdateRects.cRects = 1;
     1109    RectInfo.UpdateRects.aRects[0] = Rect;
     1110
     1111    return vboxVdmaProcessVReg(pDevExt, &CrPacker, u32CrConClientID,
     1112            pAllocData, pAllocData,
     1113            &Rect, &RectInfo);
     1114}
     1115
     1116static NTSTATUS vboxVdmaProcessVRegCmd(PVBOXMP_DEVEXT pDevExt, VBOXWDDM_CONTEXT *pContext,
     1117        const VBOXWDDM_DMA_ALLOCINFO *pSrcAllocInfo,
     1118        const VBOXWDDM_DMA_ALLOCINFO *pDstAllocInfo,
     1119        const RECT *pSrcRect, const VBOXVDMAPIPE_RECTS *pDstRects)
     1120{
     1121    return vboxVdmaProcessVReg(pDevExt, &pContext->CrPacker, pContext->u32CrConClientID,
     1122            &pSrcAllocInfo->pAlloc->AllocData, &pDstAllocInfo->pAlloc->AllocData,
     1123            pSrcRect, pDstRects);
    11291124}
    11301125
     
    12171212        Status = vboxVdmaGgDmaColorFill(pDevExt, &pCF->ClrFill);
    12181213        if (!NT_SUCCESS(Status))
    1219             WARN(("vboxVdmaProcessVRegCmd failed Status 0x%x", Status));
     1214            WARN(("vboxVdmaGgDmaColorFill failed Status 0x%x", Status));
    12201215    }
    12211216    else
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.h

    r46885 r47059  
    347347NTSTATUS vboxVdmaProcessClrFillCmd(PVBOXMP_DEVEXT pDevExt, struct VBOXWDDM_CONTEXT *pContext, struct VBOXWDDM_DMA_PRIVATEDATA_CLRFILL *pCF, struct VBOXVDMAPIPE_FLAGS_DMACMD fFlags);
    348348
    349 
    350 NTSTATUS vboxVdmaTexPresentSetAlloc(PVBOXMP_DEVEXT pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, PVBOXWDDM_ALLOCATION pAllocation);
     349NTSTATUS vboxVdmaTexPresentSetAlloc(PVBOXMP_DEVEXT pDevExt, const VBOXWDDM_ALLOC_DATA *pAllocData);
    351350
    352351#endif /* #ifndef ___VBoxMPVdma_h___ */
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp

    r47049 r47059  
    273273{
    274274    NTSTATUS Status = vboxWddmGhDisplaySetMode(pDevExt, pAllocData);
    275     Assert(Status == STATUS_SUCCESS);
    276     if (Status == STATUS_SUCCESS)
     275    if (NT_SUCCESS(Status))
    277276    {
    278277        Status = vboxWddmGhDisplayPostInfoView(pDevExt, pAllocData);
    279         Assert(Status == STATUS_SUCCESS);
    280         if (Status == STATUS_SUCCESS)
     278        if (NT_SUCCESS(Status))
    281279        {
    282280            Status = vboxWddmGhDisplayPostInfoScreen(pDevExt, pAllocData, pVScreenPos);
    283             Assert(Status == STATUS_SUCCESS);
    284             if (!NT_SUCCESS(Status))
    285                 WARN(("vboxWddmGhDisplayPostInfoScreen failed"));
     281            if (NT_SUCCESS(Status))
     282            {
     283                Status = vboxVdmaTexPresentSetAlloc(pDevExt, pAllocData);
     284                if (NT_SUCCESS(Status))
     285                    return STATUS_SUCCESS;
     286                else
     287                    WARN(("vboxVdmaTexPresentSetAlloc failed, Status 0x%x", Status));
     288            }
     289            else
     290                WARN(("vboxWddmGhDisplayPostInfoScreen failed, Status 0x%x", Status));
    286291        }
    287292        else
    288             WARN(("vboxWddmGhDisplayPostInfoView failed"));
     293            WARN(("vboxWddmGhDisplayPostInfoView failed, Status 0x%x", Status));
    289294    }
    290295    else
    291         WARN(("vboxWddmGhDisplaySetMode failed"));
     296        WARN(("vboxWddmGhDisplaySetMode failed, Status 0x%x", Status));
    292297
    293298    return Status;
     
    22732278                    pAllocation->fRcFlags = pAllocInfo->fFlags;
    22742279                    pAllocation->AllocData.SurfDesc = pAllocInfo->SurfDesc;
    2275                     pAllocation->hostID = pAllocInfo->hostID;
     2280                    pAllocation->AllocData.hostID = pAllocInfo->hostID;
    22762281
    22772282                    pAllocationInfo->Size = pAllocInfo->SurfDesc.cbSize;
     
    47424747    pSource->fGhSynced = 0; /* force guest->host notification */
    47434748
    4744     if (pSource->bVisible
    4745 //#if defined(VBOXWDDM_RENDER_FROM_SHADOW)
    4746 //            && (
    4747 //# if defined(VBOX_WDDM_WIN8)
    4748 //            g_VBoxDisplayOnly
    4749 //                    ||
    4750 //# endif
    4751 //                    pDevExt->fRenderToShadowDisabled
    4752 //                    /* only update for UMD_RC_GENERIC when resolution changes to inform host about it
    4753 //                     * otherwise keep host using the same VRAM, containing a valid data before the switch (i.e. SHADOW) */
    4754 //                    || (pAllocation
    4755 //                            && pAllocation->enmType == VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC
    4756 //                            && (pAllocation->AllocData.SurfDesc.width != pSource->AllocData.SurfDesc.width
    4757 //                                    || pAllocation->AllocData.SurfDesc.height != pSource->AllocData.SurfDesc.height)
    4758 //                            )
    4759 //                    )
    4760 //#endif
    4761             )
     4749    if (pSource->bVisible)
    47624750    {
    47634751        vboxWddmGhDisplayCheckSetInfoFromSource(pDevExt, pSource);
     
    48054793    {
    48064794        pSource->bVisible = pSetVidPnSourceVisibility->Visible;
    4807         if (pSource->bVisible
    4808 //#if defined(VBOXWDDM_RENDER_FROM_SHADOW)
    4809 //                && (
    4810 //# if defined(VBOX_WDDM_WIN8)
    4811 //                g_VBoxDisplayOnly
    4812 //                        ||
    4813 //# endif
    4814 //                        pDevExt->fRenderToShadowDisabled
    4815 //                        /* only update for UMD_RC_GENERIC when resolution changes to inform host about it
    4816 //                         * otherwise keep host using the same VRAM, containing a valid data before the switch (i.e. SHADOW) */
    4817 //                        || (pAllocation
    4818 //                                && pAllocation->enmType == VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC
    4819 //                                && (pAllocation->AllocData.SurfDesc.width != pSource->AllocData.SurfDesc.width
    4820 //                                        || pAllocation->AllocData.SurfDesc.height != pSource->AllocData.SurfDesc.height)
    4821 //                                )
    4822 //                        )
    4823 //#endif
    4824                 )
     4795        if (pSource->bVisible)
    48254796        {
    48264797            vboxWddmGhDisplayCheckSetInfoFromSource(pDevExt, pSource);
     
    64096380    SrcAllocData.Addr.SegmentId = 0;
    64106381    SrcAllocData.Addr.pvMem = pPresentDisplayOnly->pSource;
     6382    SrcAllocData.hostID = 0;
     6383    SrcAllocData.pSwapchain = NULL;
    64116384
    64126385    RECT UpdateRect;
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.h

    r47049 r47059  
    135135
    136136    pSource->pShadowAllocation = pAllocation;
     137
     138    Assert(!pSource->AllocData.pSwapchain);
     139    Assert(!pSource->AllocData.hostID);
    137140}
    138141#endif
     
    168171    }
    169172
    170     if (pDevExt->fTexPresentEnabled)
    171     {
    172         /* only submit TexPresent if host supports it and it is enabled */
    173         if (pAllocation && pAllocation->hostID)
    174         {
    175             NTSTATUS Status = vboxVdmaTexPresentSetAlloc(pDevExt, srcId, pAllocation);
    176             if (!NT_SUCCESS(Status))
    177             {
    178                 WARN(("vboxVdmaTexPresentSetAlloc failed, Status 0x%x", Status));
    179             }
    180 
    181             VBoxVrListClear(&pSource->VrList);
    182             pSource->fHas3DVrs = TRUE;
    183         }
    184         else
    185         {
    186             if (pSource->fHas3DVrs)
    187             {
    188                 NTSTATUS Status = vboxVdmaTexPresentSetAlloc(pDevExt, srcId, NULL);
    189                 if (!NT_SUCCESS(Status))
    190                 {
    191                     WARN(("vboxVdmaTexPresentSetAlloc failed, Status 0x%x", Status));
    192                 }
    193                 pSource->fHas3DVrs = FALSE;
    194             }
    195 
    196             RTRECT Rect;
    197             Rect.xLeft = 0;
    198             Rect.yTop = 0;
    199             Rect.xRight = pAllocation ? pAllocation->AllocData.SurfDesc.width : pSource->AllocData.SurfDesc.width;
    200             Rect.yBottom = pAllocation ? pAllocation->AllocData.SurfDesc.height : pSource->AllocData.SurfDesc.height;
    201 
    202             VBoxVrListRectsSet(&pSource->VrList, 1, &Rect, NULL);
    203         }
    204     }
    205     else
    206     {
    207         Assert(!pSource->fHas3DVrs);
    208     }
    209 
    210173    KIRQL OldIrql;
    211174    KeAcquireSpinLock(&pSource->AllocationLock, &OldIrql);
    212175    pSource->pPrimaryAllocation = pAllocation;
    213176    KeReleaseSpinLock(&pSource->AllocationLock, OldIrql);
     177
     178    Assert(!pSource->AllocData.pSwapchain);
     179    Assert(!pSource->AllocData.hostID);
    214180}
    215181
     
    231197# ifdef VBOX_WDDM_WIN8
    232198#  define VBOXWDDM_IS_FB_ALLOCATION(_pDevExt, _pAlloc) ( (_pAlloc)->bAssigned \
    233         && (  (_pAlloc)->enmType == VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC \
     199        && (  (_pAlloc)->AllocData.hostID \
    234200           || (_pAlloc)->enmType == \
    235201               ((g_VBoxDisplayOnly || (_pDevExt)->fRenderToShadowDisabled) ? VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE : VBOXWDDM_ALLOC_TYPE_STD_SHADOWSURFACE) \
     
    237203# else
    238204#  define VBOXWDDM_IS_FB_ALLOCATION(_pDevExt, _pAlloc) ( (_pAlloc)->bAssigned \
    239         && (  (_pAlloc)->enmType == VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC \
     205        && (  (_pAlloc)->AllocData.hostID \
    240206           || (_pAlloc)->enmType == \
    241207               (((_pDevExt)->fRenderToShadowDisabled) ? VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE : VBOXWDDM_ALLOC_TYPE_STD_SHADOWSURFACE) \
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