Changeset 40747 in vbox for trunk/src/VBox/Additions/WINNT/Graphics
- Timestamp:
- Apr 2, 2012 5:07:43 PM (13 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Video
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/common/wddm/VBoxMPIf.h
r40483 r40747 239 239 { 240 240 VBOXWDDM_CONTEXT_TYPE_UNDEFINED = 0, 241 /* system-created context (for GDI rendering) */ 241 242 VBOXWDDM_CONTEXT_TYPE_SYSTEM, 243 /* context created by the D3D User-mode driver when crogl IS available */ 242 244 VBOXWDDM_CONTEXT_TYPE_CUSTOM_3D, 245 /* context created by the D3D User-mode driver when crogl is NOT available or for ddraw overlay acceleration */ 243 246 VBOXWDDM_CONTEXT_TYPE_CUSTOM_2D, 247 /* contexts created by the cromium HGSMI transport for HGSMI commands submission */ 244 248 VBOXWDDM_CONTEXT_TYPE_CUSTOM_UHGSMI_3D, 245 249 VBOXWDDM_CONTEXT_TYPE_CUSTOM_UHGSMI_GL, 250 /* context created by the kernel->user communication mechanism for visible rects reporting, etc. */ 246 251 VBOXWDDM_CONTEXT_TYPE_CUSTOM_SESSION 247 252 } VBOXWDDM_CONTEXT_TYPE; … … 481 486 482 487 /* submit cmd func */ 488 DECLINLINE(D3DDDIFORMAT) vboxWddmFmtNoAlphaFormat(D3DDDIFORMAT enmFormat) 489 { 490 switch (enmFormat) 491 { 492 case D3DDDIFMT_A8R8G8B8: 493 return D3DDDIFMT_X8R8G8B8; 494 case D3DDDIFMT_A1R5G5B5: 495 return D3DDDIFMT_X1R5G5B5; 496 case D3DDDIFMT_A4R4G4B4: 497 return D3DDDIFMT_X4R4G4B4; 498 case D3DDDIFMT_A8B8G8R8: 499 return D3DDDIFMT_X8B8G8R8; 500 default: 501 return enmFormat; 502 } 503 } 483 504 484 505 /* tooling */ -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPDevExt.h
r40566 r40747 99 99 KSPIN_LOCK SynchLock; 100 100 volatile uint32_t cContexts3D; 101 volatile uint32_t cContexts2D; 102 volatile uint32_t cRenderFromShadowDisabledContexts; 101 103 volatile uint32_t cUnlockedVBVADisabled; 104 /* this is examined and swicthed by DxgkDdiSubmitCommand only! */ 105 volatile BOOLEAN fRenderToShadowDisabled; 102 106 103 107 HVBOXCRCTL hCrCtl; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPTypes.h
r40483 r40747 221 221 UINT NodeOrdinal; 222 222 UINT EngineAffinity; 223 BOOLEAN fRenderFromShadowDisabled; 223 224 uint32_t u32CrConClientID; 224 225 VBOXWDDM_HTABLE Swapchains; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.cpp
r40387 r40747 621 621 { 622 622 uint8_t* pvVramBase = pDevExt->pvVisibleVram; 623 /* we do not support color conversion */624 Assert(pSrcAlloc->SurfDesc.format == pDstAlloc->SurfDesc.format);625 623 /* we do not support stretching */ 626 624 uint32_t srcWidth = pSrcRect->right - pSrcRect->left; … … 632 630 Assert(pDstAlloc->offVram != VBOXVIDEOOFFSET_VOID); 633 631 Assert(pSrcAlloc->offVram != VBOXVIDEOOFFSET_VOID); 634 635 if (pSrcAlloc->SurfDesc.format != pDstAlloc->SurfDesc.format) 636 return STATUS_INVALID_PARAMETER; 632 D3DDDIFORMAT enmSrcFormat, enmDstFormat; 633 634 enmSrcFormat = pSrcAlloc->SurfDesc.format; 635 enmDstFormat = pDstAlloc->SurfDesc.format; 636 637 if (enmSrcFormat != enmDstFormat) 638 { 639 /* just ignore the alpha component 640 * this is ok since our software-based stuff can not handle alpha channel in any way */ 641 enmSrcFormat = vboxWddmFmtNoAlphaFormat(enmSrcFormat); 642 enmDstFormat = vboxWddmFmtNoAlphaFormat(enmDstFormat); 643 if (enmSrcFormat != enmDstFormat) 644 { 645 WARN(("color conversion src(%d), dst(%d) not supported!", pSrcAlloc->SurfDesc.format, pDstAlloc->SurfDesc.format)); 646 return STATUS_INVALID_PARAMETER; 647 } 648 } 637 649 if (srcHeight != dstHeight) 638 650 return STATUS_INVALID_PARAMETER; … … 678 690 for (uint32_t i = 0; i < cRows; ++i) 679 691 { 680 memcpy 692 memcpy(pvDstStart, pvSrcStart, cbDstLine); 681 693 pvDstStart += cbDstSkip; 682 694 pvSrcStart += cbSrcSkip; … … 689 701 * @return on success the number of bytes the command contained, otherwise - VERR_xxx error code 690 702 */ 691 static NTSTATUS vboxVdmaGgDmaBlt(PVBOXMP_DEVEXT pDevExt, PVBOXVDMA PIPE_CMD_DMACMD_BLT pBlt)703 static NTSTATUS vboxVdmaGgDmaBlt(PVBOXMP_DEVEXT pDevExt, PVBOXVDMA_BLT pBlt) 692 704 { 693 705 /* we do not support stretching for now */ 694 Assert(pBlt-> Blt.SrcRect.right - pBlt->Blt.SrcRect.left == pBlt->Blt.DstRects.ContextRect.right - pBlt->Blt.DstRects.ContextRect.left);695 Assert(pBlt-> Blt.SrcRect.bottom - pBlt->Blt.SrcRect.top == pBlt->Blt.DstRects.ContextRect.bottom - pBlt->Blt.DstRects.ContextRect.top);696 if (pBlt-> Blt.SrcRect.right - pBlt->Blt.SrcRect.left != pBlt->Blt.DstRects.ContextRect.right - pBlt->Blt.DstRects.ContextRect.left)706 Assert(pBlt->SrcRect.right - pBlt->SrcRect.left == pBlt->DstRects.ContextRect.right - pBlt->DstRects.ContextRect.left); 707 Assert(pBlt->SrcRect.bottom - pBlt->SrcRect.top == pBlt->DstRects.ContextRect.bottom - pBlt->DstRects.ContextRect.top); 708 if (pBlt->SrcRect.right - pBlt->SrcRect.left != pBlt->DstRects.ContextRect.right - pBlt->DstRects.ContextRect.left) 697 709 return STATUS_INVALID_PARAMETER; 698 if (pBlt-> Blt.SrcRect.bottom - pBlt->Blt.SrcRect.top != pBlt->Blt.DstRects.ContextRect.bottom - pBlt->Blt.DstRects.ContextRect.top)710 if (pBlt->SrcRect.bottom - pBlt->SrcRect.top != pBlt->DstRects.ContextRect.bottom - pBlt->DstRects.ContextRect.top) 699 711 return STATUS_INVALID_PARAMETER; 700 Assert(pBlt-> Blt.DstRects.UpdateRects.cRects);712 Assert(pBlt->DstRects.UpdateRects.cRects); 701 713 702 714 NTSTATUS Status = STATUS_SUCCESS; 703 715 704 if (pBlt->Blt.DstRects.UpdateRects.cRects) 705 { 706 for (uint32_t i = 0; i < pBlt->Blt.DstRects.UpdateRects.cRects; ++i) 707 { 708 RECT DstRect; 716 if (pBlt->DstRects.UpdateRects.cRects) 717 { 718 for (uint32_t i = 0; i < pBlt->DstRects.UpdateRects.cRects; ++i) 719 { 709 720 RECT SrcRect; 710 vboxWddmRectTranslated(&DstRect, &pBlt->Blt.DstRects.UpdateRects.aRects[i], pBlt->Blt.DstRects.ContextRect.left, pBlt->Blt.DstRects.ContextRect.top); 711 vboxWddmRectTranslated(&SrcRect, &pBlt->Blt.DstRects.UpdateRects.aRects[i], pBlt->Blt.SrcRect.left, pBlt->Blt.SrcRect.top); 712 713 Status = vboxVdmaGgDmaBltPerform(pDevExt, pBlt->Blt.SrcAlloc.pAlloc, &SrcRect, 714 pBlt->Blt.DstAlloc.pAlloc, &DstRect); 721 vboxWddmRectTranslated(&SrcRect, &pBlt->DstRects.UpdateRects.aRects[i], -pBlt->DstRects.ContextRect.left, -pBlt->DstRects.ContextRect.top); 722 723 Status = vboxVdmaGgDmaBltPerform(pDevExt, pBlt->SrcAlloc.pAlloc, &SrcRect, 724 pBlt->DstAlloc.pAlloc, &pBlt->DstRects.UpdateRects.aRects[i]); 715 725 Assert(Status == STATUS_SUCCESS); 716 726 if (Status != STATUS_SUCCESS) … … 720 730 else 721 731 { 722 Status = vboxVdmaGgDmaBltPerform(pDevExt, pBlt-> Blt.SrcAlloc.pAlloc, &pBlt->Blt.SrcRect,723 pBlt-> Blt.DstAlloc.pAlloc, &pBlt->Blt.DstRects.ContextRect);732 Status = vboxVdmaGgDmaBltPerform(pDevExt, pBlt->SrcAlloc.pAlloc, &pBlt->SrcRect, 733 pBlt->DstAlloc.pAlloc, &pBlt->DstRects.ContextRect); 724 734 Assert(Status == STATUS_SUCCESS); 725 735 if (Status != STATUS_SUCCESS) … … 752 762 PVBOXWDDM_ALLOCATION pDstAlloc = pBlt->Blt.DstAlloc.pAlloc; 753 763 PVBOXWDDM_ALLOCATION pSrcAlloc = pBlt->Blt.SrcAlloc.pAlloc; 754 BOOLEAN bComplete = TRUE; 755 switch (pDstAlloc->enmType)764 765 if (pBlt->Hdr.fFlags.fRealOp) 756 766 { 757 case VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE: 758 case VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC: 767 vboxVdmaGgDmaBlt(pDevExt, &pBlt->Blt); 768 769 if ((pDstAlloc->enmType == VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE 770 || pDstAlloc->enmType == VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC) 771 && pDstAlloc->bAssigned) 759 772 { 760 if (pDstAlloc->bAssigned) 773 VBOXWDDM_SOURCE *pSource = &pDevExt->aSources[pDstAlloc->SurfDesc.VidPnSourceId]; 774 Assert(pDstAlloc->SurfDesc.VidPnSourceId < VBOX_VIDEO_MAX_SCREENS); 775 Assert(pSource->pPrimaryAllocation == pDstAlloc); 776 777 RECT UpdateRect; 778 UpdateRect = pBlt->Blt.DstRects.UpdateRects.aRects[0]; 779 for (UINT i = 1; i < pBlt->Blt.DstRects.UpdateRects.cRects; ++i) 761 780 { 762 VBOXWDDM_SOURCE *pSource = &pDevExt->aSources[pDstAlloc->SurfDesc.VidPnSourceId]; 763 Assert(pSource->pPrimaryAllocation == pDstAlloc); 764 switch (pSrcAlloc->enmType) 765 { 766 case VBOXWDDM_ALLOC_TYPE_STD_SHADOWSURFACE: 767 { 768 Assert(pContext->enmType == VBOXWDDM_CONTEXT_TYPE_SYSTEM); 769 770 if (pBlt->Hdr.fFlags.b2DRelated) 771 { 772 RECT OverlayUnionRect; 773 RECT UpdateRect; 774 UpdateRect = pBlt->Blt.DstRects.UpdateRects.aRects[0]; 775 for (UINT i = 1; i < pBlt->Blt.DstRects.UpdateRects.cRects; ++i) 776 { 777 vboxWddmRectUnite(&UpdateRect, &pBlt->Blt.DstRects.UpdateRects.aRects[i]); 778 } 779 vboxVhwaHlpOverlayDstRectUnion(pDevExt, pDstAlloc->SurfDesc.VidPnSourceId, &OverlayUnionRect); 780 Assert(pBlt->Blt.DstRects.ContextRect.left == 0); /* <-| otherwise we would probably need to translate the UpdateRects to left;top first??*/ 781 Assert(pBlt->Blt.DstRects.ContextRect.top == 0); /* <--| */ 782 vboxVdmaDirtyRectsCalcIntersection(&OverlayUnionRect, &pBlt->Blt.DstRects.UpdateRects, &pBlt->Blt.DstRects.UpdateRects); 783 if (pBlt->Blt.DstRects.UpdateRects.cRects) 784 { 785 vboxVdmaGgDmaBlt(pDevExt, pBlt); 786 } 787 788 uint32_t cUnlockedVBVADisabled = ASMAtomicReadU32(&pDevExt->cUnlockedVBVADisabled); 789 if (!cUnlockedVBVADisabled) 790 { 791 VBOXVBVA_OP(ReportDirtyRect, pDevExt, pSource, &UpdateRect); 792 } 793 else 794 { 795 VBOXVBVA_OP_WITHLOCK(ReportDirtyRect, pDevExt, pSource, &UpdateRect); 796 } 797 798 } 799 800 if (pBlt->Hdr.fFlags.b3DRelated) 801 { 802 Status = STATUS_MORE_PROCESSING_REQUIRED; 803 } 804 805 break; 806 } 807 case VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC: 808 { 809 Assert(pContext->enmType == VBOXWDDM_CONTEXT_TYPE_CUSTOM_3D); 810 Assert(pSrcAlloc->fRcFlags.RenderTarget); 811 if (pSrcAlloc->fRcFlags.RenderTarget) 812 { 813 if (pBlt->Hdr.fFlags.b3DRelated) 814 { 815 Status = STATUS_MORE_PROCESSING_REQUIRED; 816 } 817 } 818 break; 819 } 820 default: 821 AssertBreakpoint(); 822 break; 823 } 781 vboxWddmRectUnite(&UpdateRect, &pBlt->Blt.DstRects.UpdateRects.aRects[i]); 824 782 } 825 break; 826 } 827 case VBOXWDDM_ALLOC_TYPE_STD_SHADOWSURFACE: 828 { 829 if (pBlt->Hdr.fFlags.b2DRelated) 783 784 uint32_t cUnlockedVBVADisabled = ASMAtomicReadU32(&pDevExt->cUnlockedVBVADisabled); 785 if (!cUnlockedVBVADisabled) 830 786 { 831 RECT OverlayUnionRect; 832 vboxVhwaHlpOverlayDstRectUnion(pDevExt, pDstAlloc->SurfDesc.VidPnSourceId, &OverlayUnionRect); 833 Assert(pBlt->Blt.DstRects.ContextRect.left == 0); /* <-| otherwise we would probably need to translate the UpdateRects to left;top first??*/ 834 Assert(pBlt->Blt.DstRects.ContextRect.top == 0); /* <--| */ 835 vboxVdmaDirtyRectsCalcIntersection(&OverlayUnionRect, &pBlt->Blt.DstRects.UpdateRects, &pBlt->Blt.DstRects.UpdateRects); 836 if (pBlt->Blt.DstRects.UpdateRects.cRects) 837 { 838 vboxVdmaGgDmaBlt(pDevExt, pBlt); 839 } 787 VBOXVBVA_OP(ReportDirtyRect, pDevExt, pSource, &UpdateRect); 840 788 } 841 789 else 842 790 { 843 Assert(0);791 VBOXVBVA_OP_WITHLOCK(ReportDirtyRect, pDevExt, pSource, &UpdateRect); 844 792 } 845 break;846 793 } 847 default:848 Assert(0);849 794 } 850 795 851 if ( Status == STATUS_MORE_PROCESSING_REQUIRED)796 if (pBlt->Hdr.fFlags.fVisibleRegions) 852 797 { 798 Status = STATUS_MORE_PROCESSING_REQUIRED; 853 799 vboxWddmAllocationRetain(pDstAlloc); 854 800 vboxWddmAllocationRetain(pSrcAlloc); … … 856 802 break; 857 803 } 804 858 805 case VBOXVDMACMD_TYPE_DMA_PRESENT_FLIP: 859 806 { 860 807 PVBOXVDMAPIPE_CMD_DMACMD_FLIP pFlip = (PVBOXVDMAPIPE_CMD_DMACMD_FLIP)pDmaCmd; 861 Assert(pFlip->Hdr.fFlags. b3DRelated);862 Assert(!pFlip->Hdr.fFlags. b2DRelated);863 if (pFlip->Hdr.fFlags. b3DRelated)808 Assert(pFlip->Hdr.fFlags.fVisibleRegions); 809 Assert(!pFlip->Hdr.fFlags.fRealOp); 810 if (pFlip->Hdr.fFlags.fVisibleRegions) 864 811 { 865 812 Status = STATUS_MORE_PROCESSING_REQUIRED; … … 872 819 { 873 820 PVBOXVDMAPIPE_CMD_DMACMD_CLRFILL pCF = (PVBOXVDMAPIPE_CMD_DMACMD_CLRFILL)pDmaCmd; 874 Assert(pCF->Hdr.fFlags. b2DRelated);875 Assert(!pCF->Hdr.fFlags. b3DRelated);821 Assert(pCF->Hdr.fFlags.fRealOp); 822 Assert(!pCF->Hdr.fFlags.fVisibleRegions); 876 823 Status = vboxVdmaGgDmaColorFill(pDevExt, pCF); 877 824 Assert(Status == STATUS_SUCCESS); … … 899 846 PVBOXWDDM_CONTEXT pContext = pDmaCmd->pContext; 900 847 DXGK_INTERRUPT_TYPE enmComplType = DXGK_INTERRUPT_DMA_COMPLETED; 848 849 Assert(pDmaCmd->fFlags.Value); 850 Assert(!pDmaCmd->fFlags.fRealOp); 851 901 852 switch (pDmaCmd->enmCmd) 902 853 { … … 907 858 PVBOXWDDM_ALLOCATION pSrcAlloc = pBlt->Blt.SrcAlloc.pAlloc; 908 859 BOOLEAN bComplete = TRUE; 909 switch (pDstAlloc->enmType) 860 VBOXWDDM_SOURCE *pSource = &pDevExt->aSources[pDstAlloc->SurfDesc.VidPnSourceId]; 861 Assert(pDstAlloc->SurfDesc.VidPnSourceId < VBOX_VIDEO_MAX_SCREENS); 862 863 if (pBlt->Hdr.fFlags.fVisibleRegions) 910 864 { 911 case VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE:912 case VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC:865 POINT pos = pSource->VScreenPos; 866 if (pos.x || pos.y) 913 867 { 914 if (pDstAlloc->bAssigned) 915 { 916 VBOXWDDM_SOURCE *pSource = &pDevExt->aSources[pDstAlloc->SurfDesc.VidPnSourceId]; 917 Assert(pSource->pPrimaryAllocation == pDstAlloc); 918 switch (pSrcAlloc->enmType) 919 { 920 case VBOXWDDM_ALLOC_TYPE_STD_SHADOWSURFACE: 921 { 922 Assert(pContext->enmType == VBOXWDDM_CONTEXT_TYPE_SYSTEM); 923 924 if (pBlt->Hdr.fFlags.b3DRelated) 925 { 926 POINT pos = pSource->VScreenPos; 927 if (pos.x || pos.y) 928 { 929 /* note: do NOT trans;ate the src rect since it is used for screen pos calculation */ 930 vboxWddmBltPipeRectsTranslate(&pBlt->Blt.DstRects, pos.x, pos.y); 931 } 932 933 Status = vboxVdmaGgDirtyRectsProcess(pDevExt, pContext, NULL, &pBlt->Blt.SrcRect, &pBlt->Blt.DstRects); 934 Assert(Status == STATUS_SUCCESS); 935 } 936 937 break; 938 } 939 case VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC: 940 { 941 Assert(pContext->enmType == VBOXWDDM_CONTEXT_TYPE_CUSTOM_3D); 942 Assert(pSrcAlloc->fRcFlags.RenderTarget); 943 if (pSrcAlloc->fRcFlags.RenderTarget) 944 { 945 if (pBlt->Hdr.fFlags.b3DRelated) 946 { 947 POINT pos = pSource->VScreenPos; 948 if (pos.x || pos.y) 949 { 950 /* note: do NOT trans;ate the src rect since it is used for screen pos calculation */ 951 vboxWddmBltPipeRectsTranslate(&pBlt->Blt.DstRects, pos.x, pos.y); 952 } 953 954 PVBOXWDDM_SWAPCHAIN pSwapchain; 955 pSwapchain = vboxWddmSwapchainRetainByAlloc(pDevExt, pSrcAlloc); 956 if (pSwapchain) 957 { 958 Status = vboxVdmaGgDirtyRectsProcess(pDevExt, pContext, pSwapchain, &pBlt->Blt.SrcRect, &pBlt->Blt.DstRects); 959 Assert(Status == STATUS_SUCCESS); 960 vboxWddmSwapchainRelease(pSwapchain); 961 } 962 } 963 } 964 break; 965 } 966 default: 967 AssertBreakpoint(); 968 break; 969 } 970 } 971 break; 868 /* note: do NOT translate the src rect since it is used for screen pos calculation */ 869 vboxWddmBltPipeRectsTranslate(&pBlt->Blt.DstRects, pos.x, pos.y); 972 870 } 973 default: 974 Assert(0); 871 872 Status = vboxVdmaGgDirtyRectsProcess(pDevExt, pContext, NULL, &pBlt->Blt.SrcRect, &pBlt->Blt.DstRects); 873 Assert(Status == STATUS_SUCCESS); 874 } 875 else 876 { 877 WARN(("not expected!")); 975 878 } 976 879 977 880 vboxWddmAllocationRelease(pDstAlloc); 978 881 vboxWddmAllocationRelease(pSrcAlloc); 979 break; 980 } 882 883 break; 884 } 885 981 886 case VBOXVDMACMD_TYPE_DMA_PRESENT_FLIP: 982 887 { 983 888 PVBOXVDMAPIPE_CMD_DMACMD_FLIP pFlip = (PVBOXVDMAPIPE_CMD_DMACMD_FLIP)pDmaCmd; 984 Assert(pFlip->Hdr.fFlags.b3DRelated);985 Assert(!pFlip->Hdr.fFlags.b2DRelated);986 889 PVBOXWDDM_ALLOCATION pAlloc = pFlip->Flip.Alloc.pAlloc; 987 890 VBOXWDDM_SOURCE *pSource = &pDevExt->aSources[pAlloc->SurfDesc.VidPnSourceId]; 988 if (pFlip->Hdr.fFlags. b3DRelated)891 if (pFlip->Hdr.fFlags.fVisibleRegions) 989 892 { 990 893 PVBOXWDDM_SWAPCHAIN pSwapchain; … … 1010 913 } 1011 914 } 915 else 916 { 917 WARN(("not expected!")); 918 } 1012 919 1013 920 vboxWddmAllocationRelease(pAlloc); … … 1015 922 break; 1016 923 } 924 1017 925 default: 1018 Assert(0); 1019 break; 926 { 927 WARN(("not expected!")); 928 break; 929 } 1020 930 } 1021 931 -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.h
r40387 r40747 218 218 struct 219 219 { 220 UINT b2DRelated: 1;221 UINT b3DRelated: 1;222 UINT Reserve d: 30;220 UINT fRealOp : 1; 221 UINT fVisibleRegions : 1; 222 UINT Reserve : 30; 223 223 }; 224 224 UINT Value; … … 341 341 PFNVBOXVDMADDICMDCOMPLETE_DPC pfnComplete, PVOID pvComplete); 342 342 343 NTSTATUS vboxVdmaGgDmaBltPerform(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_ALLOCATION pSrcAlloc, RECT* pSrcRect, 344 PVBOXWDDM_ALLOCATION pDstAlloc, RECT* pDstRect); 345 343 346 #define VBOXVDMAPIPE_CMD_DR_FROM_DDI_CMD(_pCmd) ((PVBOXVDMAPIPE_CMD_DR)(((uint8_t*)(_pCmd)) - RT_OFFSETOF(VBOXVDMAPIPE_CMD_DR, DdiCmd))) 344 347 DECLCALLBACK(VOID) vboxVdmaGgDdiCmdDestroy(PVBOXMP_DEVEXT pDevExt, PVBOXVDMADDI_CMD pCmd, PVOID pvContext); -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
r40566 r40747 223 223 pSource->VScreenPos = *pVScreenPos; 224 224 225 PVBOXWDDM_ALLOCATION pAllocation = VBOXWDDM_FB_ALLOCATION(p Source);225 PVBOXWDDM_ALLOCATION pAllocation = VBOXWDDM_FB_ALLOCATION(pDevExt, pSource); 226 226 NTSTATUS Status = vboxWddmGhDisplayPostInfoScreen(pDevExt, pAllocation, &pSource->VScreenPos); 227 227 Assert(Status == STATUS_SUCCESS); … … 231 231 NTSTATUS vboxWddmGhDisplaySetInfo(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_SOURCE pSource, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId) 232 232 { 233 PVBOXWDDM_ALLOCATION pAllocation = VBOXWDDM_FB_ALLOCATION(p Source);233 PVBOXWDDM_ALLOCATION pAllocation = VBOXWDDM_FB_ALLOCATION(pDevExt, pSource); 234 234 VBOXVIDEOOFFSET offVram = vboxWddmValidatePrimary(pAllocation); 235 235 Assert(offVram != VBOXVIDEOOFFSET_VOID); … … 264 264 } 265 265 266 static VOID vboxWddmModeRenderFromShadowDisableOnSubmitCommand(PVBOXMP_DEVEXT pDevExt, BOOLEAN fDisable) 267 { 268 for (int i = 0; i < VBoxCommonFromDeviceExt(pDevExt)->cDisplays; ++i) 269 { 270 PVBOXWDDM_SOURCE pSource = &pDevExt->aSources[i]; 271 PVBOXWDDM_ALLOCATION pFromAllocation; 272 PVBOXWDDM_ALLOCATION pToAllocation; 273 if (fDisable) 274 { 275 pFromAllocation = pSource->pShadowAllocation; 276 pToAllocation = pSource->pPrimaryAllocation; 277 } 278 else 279 { 280 pToAllocation = pSource->pShadowAllocation; 281 pFromAllocation = pSource->pPrimaryAllocation; 282 } 283 284 Assert(pToAllocation->offVram != VBOXVIDEOOFFSET_VOID); 285 Assert(pFromAllocation->offVram != VBOXVIDEOOFFSET_VOID); 286 if (pToAllocation->offVram != VBOXVIDEOOFFSET_VOID 287 && pFromAllocation->offVram != VBOXVIDEOOFFSET_VOID) 288 { 289 RECT Rect; 290 Rect.left = 0; 291 Rect.top = 0; 292 Rect.right = pToAllocation->SurfDesc.width; 293 Rect.bottom = pToAllocation->SurfDesc.height; 294 vboxVdmaGgDmaBltPerform(pDevExt, pFromAllocation, &Rect, 295 pToAllocation, &Rect); 296 } 297 298 /* ensure we issue resize command on next update */ 299 pSource->offVram = VBOXVIDEOOFFSET_VOID; 300 } 301 } 302 303 static BOOLEAN vboxWddmModeRenderFromShadowCheckOnSubmitCommand(PVBOXMP_DEVEXT pDevExt, BOOLEAN *pbSwitched) 304 { 305 BOOLEAN fDisabled, fNeedSwitch; 306 uint32_t cCount = ASMAtomicUoReadU32(&pDevExt->cRenderFromShadowDisabledContexts); 307 308 fDisabled = !!cCount; 309 fNeedSwitch = (!fDisabled != !pDevExt->fRenderToShadowDisabled); 310 311 if (fNeedSwitch) 312 { 313 vboxWddmModeRenderFromShadowDisableOnSubmitCommand(pDevExt, fDisabled); 314 pDevExt->fRenderToShadowDisabled = fDisabled; 315 } 316 317 if (pbSwitched) 318 *pbSwitched = fNeedSwitch; 319 320 return fDisabled; 321 } 322 323 324 static VOID vboxWddmModeRenderFromShadowDisableRegister(PVBOXMP_DEVEXT pDevExt, VBOXWDDM_CONTEXT *pContext) 325 { 326 if (pContext->fRenderFromShadowDisabled) 327 return; 328 ASMAtomicIncU32(&pDevExt->cRenderFromShadowDisabledContexts); 329 pContext->fRenderFromShadowDisabled = TRUE; 330 } 331 332 static VOID vboxWddmModeRenderFromShadowDisableUnregister(PVBOXMP_DEVEXT pDevExt, VBOXWDDM_CONTEXT *pContext) 333 { 334 if (!pContext->fRenderFromShadowDisabled) 335 return; 336 337 uint32_t cCount = ASMAtomicDecU32(&pDevExt->cRenderFromShadowDisabledContexts); 338 Assert(cCount < UINT32_MAX); 339 pContext->fRenderFromShadowDisabled = FALSE; 340 } 341 342 DECLINLINE(VOID) vboxWddmAllocUpdateAddress(PVBOXWDDM_ALLOCATION pAllocation, UINT SegmentId, VBOXVIDEOOFFSET offVram) 343 { 344 pAllocation->SegmentId = SegmentId; 345 pAllocation->offVram = offVram; 346 } 347 266 348 #ifdef VBOXWDDM_RENDER_FROM_SHADOW 267 bool vboxWddmCheckUpdateShadowAddress(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_SOURCE pSource, 268 D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, UINT SegmentId, VBOXVIDEOOFFSET offVram) 349 bool vboxWddmCheckUpdateFramebufferAddress(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_SOURCE pSource, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId) 269 350 { 270 351 if (pSource->pPrimaryAllocation->enmType == VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC) … … 273 354 return false; 274 355 } 275 if (pSource->offVram == offVram) 356 357 PVBOXWDDM_ALLOCATION pAllocation = VBOXWDDM_FB_ALLOCATION(pDevExt, pSource); 358 Assert(VBOXVIDEOOFFSET_VOID != pAllocation->offVram); 359 360 if (pSource->offVram == pAllocation->offVram) 276 361 return false; 277 pSource->offVram = offVram; 278 pSource->pShadowAllocation->SegmentId = SegmentId; 279 pSource->pShadowAllocation->offVram = offVram; 362 pSource->offVram = pAllocation->offVram; 280 363 281 364 NTSTATUS Status = vboxWddmGhDisplaySetInfo(pDevExt, pSource, VidPnSourceId); 282 Assert(Status == STATUS_SUCCESS);283 365 if (Status != STATUS_SUCCESS) 284 366 WARN(("vboxWddmGhDisplaySetInfo failed, Status (0x%x)", Status)); … … 965 1047 InitializeListHead(&pDevExt->SwapchainList3D); 966 1048 pDevExt->cContexts3D = 0; 1049 pDevExt->cContexts2D = 0; 1050 pDevExt->cUnlockedVBVADisabled = 0; 967 1051 ExInitializeFastMutex(&pDevExt->ContextMutex); 968 1052 KeInitializeSpinLock(&pDevExt->SynchLock); … … 2709 2793 } 2710 2794 2795 if (pContext->enmType == VBOXWDDM_CONTEXT_TYPE_CUSTOM_2D) 2796 vboxWddmModeRenderFromShadowDisableRegister(pDevExt, pContext); 2797 2798 BOOLEAN fRenderFromSharedDisabled = pDevExt->fRenderToShadowDisabled; 2799 2711 2800 switch (enmCmd) 2712 2801 { … … 2718 2807 PVBOXWDDM_ALLOCATION pSrcAlloc = pS2P->Shadow2Primary.ShadowAlloc.pAlloc; 2719 2808 vboxWddmAssignShadow(pDevExt, pSource, pSrcAlloc, pS2P->Shadow2Primary.VidPnSourceId); 2720 vboxWddmCheckUpdateShadowAddress(pDevExt, pSource, pS2P->Shadow2Primary.VidPnSourceId, 2721 pS2P->Shadow2Primary.ShadowAlloc.segmentIdAlloc, pS2P->Shadow2Primary.ShadowAlloc.offAlloc); 2809 vboxWddmAllocUpdateAddress(pSrcAlloc, pS2P->Shadow2Primary.ShadowAlloc.segmentIdAlloc, pS2P->Shadow2Primary.ShadowAlloc.offAlloc); 2810 fRenderFromSharedDisabled = vboxWddmModeRenderFromShadowCheckOnSubmitCommand(pDevExt, NULL); 2811 vboxWddmCheckUpdateFramebufferAddress(pDevExt, pSource, pS2P->Shadow2Primary.VidPnSourceId); 2722 2812 uint32_t cUnlockedVBVADisabled = ASMAtomicReadU32(&pDevExt->cUnlockedVBVADisabled); 2723 2813 if (!cUnlockedVBVADisabled) … … 2740 2830 PVBOXWDDM_ALLOCATION pDstAlloc = pBlt->Blt.DstAlloc.pAlloc; 2741 2831 PVBOXWDDM_ALLOCATION pSrcAlloc = pBlt->Blt.SrcAlloc.pAlloc; 2832 VBOXWDDM_SOURCE *pSource = &pDevExt->aSources[pDstAlloc->SurfDesc.VidPnSourceId]; 2833 2834 Assert(pDstAlloc->SurfDesc.VidPnSourceId < VBOX_VIDEO_MAX_SCREENS); 2835 2836 vboxWddmAllocUpdateAddress(pDstAlloc, pBlt->Blt.DstAlloc.segmentIdAlloc, pBlt->Blt.DstAlloc.offAlloc); 2837 vboxWddmAllocUpdateAddress(pSrcAlloc, pBlt->Blt.SrcAlloc.segmentIdAlloc, pBlt->Blt.SrcAlloc.offAlloc); 2742 2838 2743 2839 uint32_t cContexts3D = ASMAtomicReadU32(&pDevExt->cContexts3D); 2744 BOOLEAN bComplete = TRUE; 2840 2841 VBOXVDMAPIPE_FLAGS_DMACMD fBltFlags; 2842 fBltFlags.Value = 0; 2843 2844 if (pDstAlloc->bAssigned && 2845 (pDstAlloc->enmType == VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE 2846 || pDstAlloc->enmType == VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE) 2847 ) 2848 { 2849 if (pSrcAlloc->enmType == VBOXWDDM_ALLOC_TYPE_STD_SHADOWSURFACE) 2850 vboxWddmAssignShadow(pDevExt, pSource, pSrcAlloc, pDstAlloc->SurfDesc.VidPnSourceId); 2851 fRenderFromSharedDisabled = vboxWddmModeRenderFromShadowCheckOnSubmitCommand(pDevExt, NULL); 2852 if(pContext->enmType != VBOXWDDM_CONTEXT_TYPE_CUSTOM_3D 2853 || pDstAlloc->enmType !=VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC) 2854 vboxWddmCheckUpdateFramebufferAddress(pDevExt, pSource, pDstAlloc->SurfDesc.VidPnSourceId); 2855 } 2856 else if (pSrcAlloc->bAssigned && 2857 (pSrcAlloc->enmType == VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE 2858 || pSrcAlloc->enmType == VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE) 2859 ) 2860 { 2861 if (pDstAlloc->enmType == VBOXWDDM_ALLOC_TYPE_STD_SHADOWSURFACE) 2862 vboxWddmAssignShadow(pDevExt, pSource, pDstAlloc, pSrcAlloc->SurfDesc.VidPnSourceId); 2863 fRenderFromSharedDisabled = vboxWddmModeRenderFromShadowCheckOnSubmitCommand(pDevExt, NULL); 2864 if(pContext->enmType != VBOXWDDM_CONTEXT_TYPE_CUSTOM_3D 2865 || pSrcAlloc->enmType !=VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC) 2866 vboxWddmCheckUpdateFramebufferAddress(pDevExt, pSource, pSrcAlloc->SurfDesc.VidPnSourceId); 2867 } 2868 2869 if (pContext->enmType != VBOXWDDM_CONTEXT_TYPE_CUSTOM_3D && fRenderFromSharedDisabled) 2870 fBltFlags.fRealOp = 1; 2871 2745 2872 switch (pDstAlloc->enmType) 2746 2873 { … … 2750 2877 if (pDstAlloc->bAssigned) 2751 2878 { 2752 VBOXWDDM_SOURCE *pSource = &pDevExt->aSources[pDstAlloc->SurfDesc.VidPnSourceId];2753 2879 Assert(pSource->pPrimaryAllocation == pDstAlloc); 2880 2754 2881 switch (pSrcAlloc->enmType) 2755 2882 { 2756 2883 case VBOXWDDM_ALLOC_TYPE_STD_SHADOWSURFACE: 2757 2884 { 2758 VBOXVDMAPIPE_FLAGS_DMACMD fBltFlags; 2759 fBltFlags.Value = 0; 2760 fBltFlags.b3DRelated = !!cContexts3D; 2885 fBltFlags.fVisibleRegions = !!cContexts3D; 2761 2886 Assert(pContext->enmType == VBOXWDDM_CONTEXT_TYPE_SYSTEM); 2762 vboxWddmAssignShadow(pDevExt, pSource, pSrcAlloc, pDstAlloc->SurfDesc.VidPnSourceId); 2763 vboxWddmCheckUpdateShadowAddress(pDevExt, pSource, 2764 pDstAlloc->SurfDesc.VidPnSourceId, pBlt->Blt.SrcAlloc.segmentIdAlloc, pBlt->Blt.SrcAlloc.offAlloc); 2765 if (vboxVhwaHlpOverlayListIsEmpty(pDevExt, pDstAlloc->SurfDesc.VidPnSourceId)) 2887 2888 if (!fRenderFromSharedDisabled) 2766 2889 { 2767 2890 RECT rect; … … 2787 2910 } 2788 2911 } 2789 else 2790 { 2791 fBltFlags.b2DRelated = 1; 2792 } 2793 2794 if (fBltFlags.Value) 2795 { 2796 Status = vboxWddmSubmitBltCmd(pDevExt, pContext, pSubmitCommand->SubmissionFenceId, pBlt, fBltFlags); 2797 bComplete = FALSE; 2798 } 2912 2799 2913 break; 2800 2914 } 2801 2915 case VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC: 2802 2916 { 2803 Assert(pContext->enmType == VBOXWDDM_CONTEXT_TYPE_CUSTOM_3D); 2804 Assert(pSrcAlloc->fRcFlags.RenderTarget); 2805 if (pSrcAlloc->fRcFlags.RenderTarget) 2917 if(pContext->enmType == VBOXWDDM_CONTEXT_TYPE_CUSTOM_3D) 2806 2918 { 2807 VBOXVDMAPIPE_FLAGS_DMACMD fBltFlags; 2808 fBltFlags.Value = 0; 2809 fBltFlags.b3DRelated = 1; 2810 Status = vboxWddmSubmitBltCmd(pDevExt, pContext, pSubmitCommand->SubmissionFenceId, pBlt, fBltFlags); 2811 bComplete = FALSE; 2919 Assert(pSrcAlloc->fRcFlags.RenderTarget); 2920 if (pSrcAlloc->fRcFlags.RenderTarget) 2921 fBltFlags.fVisibleRegions = 1; 2812 2922 } 2813 2923 break; 2814 2924 } 2815 2925 default: 2926 { 2816 2927 AssertBreakpoint(); 2817 2928 break; 2929 } 2818 2930 } 2819 2931 } 2932 2820 2933 break; 2821 2934 } 2822 2935 case VBOXWDDM_ALLOC_TYPE_STD_STAGINGSURFACE: 2823 2936 { 2824 Assert(pContext->enmType == VBOXWDDM_CONTEXT_TYPE_CUSTOM_3D);2937 // Assert(pContext->enmType == VBOXWDDM_CONTEXT_TYPE_CUSTOM_3D); 2825 2938 Assert(pSrcAlloc->enmType == VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC); 2826 2939 Assert(pSrcAlloc->fRcFlags.RenderTarget); … … 2834 2947 Assert(pSrcAlloc->enmType == VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE); 2835 2948 Assert(pContext->enmType == VBOXWDDM_CONTEXT_TYPE_SYSTEM); 2836 VBOXVDMAPIPE_FLAGS_DMACMD fBltFlags;2837 fBltFlags.Value = 0;2838 if (pDstAlloc->SurfDesc.VidPnSourceId != D3DDDI_ID_UNINITIALIZED &&2839 !vboxVhwaHlpOverlayListIsEmpty(pDevExt, pDstAlloc->SurfDesc.VidPnSourceId))2840 {2841 fBltFlags.b2DRelated = 1;2842 Status = vboxWddmSubmitBltCmd(pDevExt, pContext, pSubmitCommand->SubmissionFenceId, pBlt, fBltFlags);2843 bComplete = FALSE;2844 }2845 2949 break; 2846 2950 } … … 2850 2954 } 2851 2955 2852 if (bComplete) 2956 if (fBltFlags.Value) 2957 { 2958 Status = vboxWddmSubmitBltCmd(pDevExt, pContext, pSubmitCommand->SubmissionFenceId, pBlt, fBltFlags); 2959 } 2960 else 2853 2961 { 2854 2962 Status = vboxVdmaDdiCmdFenceComplete(pDevExt, pContext->NodeOrdinal, pSubmitCommand->SubmissionFenceId, DXGK_INTERRUPT_DMA_COMPLETED); … … 2920 3028 vboxVdmaGgCmdDmaNotifyInit(&pFlipCmd->Hdr, pContext->NodeOrdinal, pSubmitCommand->SubmissionFenceId, NULL, NULL); 2921 3029 pFlipCmd->Hdr.fFlags.Value = 0; 2922 pFlipCmd->Hdr.fFlags. b3DRelated= 1;3030 pFlipCmd->Hdr.fFlags.fVisibleRegions = 1; 2923 3031 pFlipCmd->Hdr.pContext = pContext; 2924 3032 pFlipCmd->Hdr.enmCmd = VBOXVDMACMD_TYPE_DMA_PRESENT_FLIP; … … 2945 3053 vboxVdmaGgCmdDmaNotifyInit(&pCFCmd->Hdr, pContext->NodeOrdinal, pSubmitCommand->SubmissionFenceId, NULL, NULL); 2946 3054 pCFCmd->Hdr.fFlags.Value = 0; 2947 pCFCmd->Hdr.fFlags. b2DRelated= 1;3055 pCFCmd->Hdr.fFlags.fRealOp = 1; 2948 3056 pCFCmd->Hdr.pContext = pContext; 2949 3057 pCFCmd->Hdr.enmCmd = VBOXVDMACMD_TYPE_DMA_PRESENT_CLRFILL; … … 4340 4448 { 4341 4449 // Assert(pAllocation->enmType == VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE); 4342 pAllocation->offVram = (VBOXVIDEOOFFSET)pSetVidPnSourceAddress->PrimaryAddress.QuadPart; 4343 pAllocation->SegmentId = pSetVidPnSourceAddress->PrimarySegment; 4450 vboxWddmAllocUpdateAddress(pAllocation, pSetVidPnSourceAddress->PrimarySegment, (VBOXVIDEOOFFSET)pSetVidPnSourceAddress->PrimaryAddress.QuadPart); 4344 4451 Assert (pAllocation->SegmentId); 4345 4452 Assert (!pAllocation->bVisible); … … 4368 4475 else 4369 4476 { 4370 LOGREL(("no allocation data available!!"));4477 WARN(("no allocation data available!!")); 4371 4478 Status = STATUS_INVALID_PARAMETER; 4372 4479 } … … 4374 4481 else 4375 4482 { 4376 LOGREL(("invalid VidPnSourceId (%d), should be smaller than (%d)", pSetVidPnSourceAddress->VidPnSourceId, VBoxCommonFromDeviceExt(pDevExt)->cDisplays));4483 WARN(("invalid VidPnSourceId (%d), should be smaller than (%d)", pSetVidPnSourceAddress->VidPnSourceId, VBoxCommonFromDeviceExt(pDevExt)->cDisplays)); 4377 4484 Status = STATUS_INVALID_PARAMETER; 4378 4485 } … … 5109 5216 pPrivateData->BaseHdr.fFlags.Value = 0; 5110 5217 uint32_t cContexts3D = ASMAtomicReadU32(&pDevExt->cContexts3D); 5218 uint32_t cContexts2D = ASMAtomicReadU32(&pDevExt->cContexts2D); 5111 5219 #define VBOXWDDM_DUMMY_DMABUFFER_SIZE sizeof(RECT) 5112 5220 … … 5141 5249 /* issue VBOXWDDM_ALLOC_TYPE_STD_SHADOWSURFACE ONLY in case there are no 3D contexts currently 5142 5250 * otherwise we would need info about all rects being updated on primary for visible rect reporting */ 5143 if (!cContexts3D )5251 if (!cContexts3D && !cContexts2D) 5144 5252 { 5145 5253 if (pDstAlloc->enmType == VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE … … 5153 5261 { 5154 5262 #ifdef VBOX_WITH_VIDEOHWACCEL 5155 if (vboxVhwaHlpOverlayListIsEmpty(pDevExt, pDstAlloc->SurfDesc.VidPnSourceId))5263 // if (vboxVhwaHlpOverlayListIsEmpty(pDevExt, pDstAlloc->SurfDesc.VidPnSourceId)) 5156 5264 #endif 5157 5265 { … … 5160 5268 { 5161 5269 VBOXWDDM_SOURCE *pSource = &pDevExt->aSources[pDstAlloc->SurfDesc.VidPnSourceId]; 5162 vboxWddmAssignShadow(pDevExt, pSource, pSrcAlloc, pDstAlloc->SurfDesc.VidPnSourceId);5270 // vboxWddmAssignShadow(pDevExt, pSource, pSrcAlloc, pDstAlloc->SurfDesc.VidPnSourceId); 5163 5271 Assert(pPresent->SrcRect.left == pPresent->DstRect.left); 5164 5272 Assert(pPresent->SrcRect.right == pPresent->DstRect.right); … … 5690 5798 if (RT_SUCCESS(rc)) 5691 5799 { 5692 // Assert(KeGetCurrentIrql() < DISPATCH_LEVEL);5693 // ExAcquireFastMutex(&pDevExt->ContextMutex);5694 5800 ASMAtomicIncU32(&pDevExt->cContexts3D); 5695 // ExReleaseFastMutex(&pDevExt->ContextMutex);5696 5801 break; 5697 5802 } … … 5727 5832 if (RT_SUCCESS(rc)) 5728 5833 { 5834 ASMAtomicIncU32(&pDevExt->cContexts3D); 5729 5835 break; 5730 5836 } … … 5736 5842 { 5737 5843 pContext->enmType = pInfo->enmType; 5844 ASMAtomicIncU32(&pDevExt->cContexts2D); 5738 5845 break; 5739 5846 } … … 5784 5891 { 5785 5892 case VBOXWDDM_CONTEXT_TYPE_CUSTOM_3D: 5786 {5787 Assert(KeGetCurrentIrql() < DISPATCH_LEVEL);5788 // ExAcquireFastMutex(&pDevExt->ContextMutex);5789 // RemoveEntryList(&pContext->ListEntry);5790 uint32_t cContexts = ASMAtomicDecU32(&pDevExt->cContexts3D);5791 // ExReleaseFastMutex(&pDevExt->ContextMutex);5792 Assert(cContexts < UINT32_MAX/2);5793 /* don't break! */5794 }5795 5893 case VBOXWDDM_CONTEXT_TYPE_CUSTOM_UHGSMI_3D: 5796 5894 case VBOXWDDM_CONTEXT_TYPE_CUSTOM_UHGSMI_GL: 5895 { 5896 uint32_t cContexts = ASMAtomicDecU32(&pDevExt->cContexts3D); 5897 Assert(cContexts < UINT32_MAX/2); 5797 5898 if (pContext->u32CrConClientID) 5798 5899 { … … 5800 5901 } 5801 5902 break; 5903 } 5904 case VBOXWDDM_CONTEXT_TYPE_CUSTOM_2D: 5905 { 5906 uint32_t cContexts = ASMAtomicDecU32(&pDevExt->cContexts2D); 5907 Assert(cContexts < UINT32_MAX/2); 5908 break; 5909 } 5802 5910 default: 5803 5911 break; 5804 5912 } 5913 5914 vboxWddmModeRenderFromShadowDisableUnregister(pDevExt, pContext); 5805 5915 5806 5916 /* first terminate the swapchain, this will also ensure -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.h
r39981 r40747 74 74 75 75 #ifdef VBOXWDDM_RENDER_FROM_SHADOW 76 # define VBOXWDDM_FB_ALLOCATION(_p Src) ((_pSrc)->pShadowAllocation)76 # define VBOXWDDM_FB_ALLOCATION(_pDevExt, _pSrc) ((_pDevExt)->fRenderToShadowDisabled ? (_pSrc)->pPrimaryAllocation : (_pSrc)->pShadowAllocation) 77 77 #else 78 # define VBOXWDDM_FB_ALLOCATION(_p Src) ((_pSrc)->pPrimaryAllocation)78 # define VBOXWDDM_FB_ALLOCATION(_pDevExt, _pSrc) ((_pSrc)->pPrimaryAllocation) 79 79 #endif 80 80
Note:
See TracChangeset
for help on using the changeset viewer.