Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.cpp	(revision 42154)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.cpp	(revision 42158)
@@ -585,10 +585,6 @@
             {
                 if (pAlloc->AllocData.SurfDesc.VidPnSourceId != D3DDDI_ID_UNINITIALIZED
-                        && pAlloc->bAssigned
-#if 0//def VBOXWDDM_RENDER_FROM_SHADOW
-                        && pAlloc->enmType == VBOXWDDM_ALLOC_TYPE_STD_SHADOWSURFACE
-#else
-                        && pAlloc->enmType == VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE
-#endif
+                        && VBOXWDDM_IS_FB_ALLOCATION(pDevExt, pAlloc)
+                        && pAlloc->bVisible
                         )
                 {
@@ -768,7 +764,6 @@
                 vboxVdmaGgDmaBlt(pDevExt, &pBlt->Blt);
 
-                if ((pDstAlloc->enmType == VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE
-                        || pDstAlloc->enmType == VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC)
-                        && pDstAlloc->bAssigned)
+                if (VBOXWDDM_IS_FB_ALLOCATION(pDevExt, pDstAlloc)
+                        && pDstAlloc->bVisible)
                 {
                     VBOXWDDM_SOURCE *pSource = &pDevExt->aSources[pDstAlloc->AllocData.SurfDesc.VidPnSourceId];
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVidPn.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVidPn.cpp	(revision 42154)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVidPn.cpp	(revision 42158)
@@ -1571,5 +1571,5 @@
     if (pNewVidPnPresentPathInfo->VidPnSourceId != pNewVidPnPresentPathInfo->VidPnTargetId)
     {
-        WARN(("unsupported source(%d)->target(%d) pair", pNewVidPnPresentPathInfo->VidPnSourceId, pNewVidPnPresentPathInfo->VidPnTargetId));
+        LOG(("unsupported source(%d)->target(%d) pair", pNewVidPnPresentPathInfo->VidPnSourceId, pNewVidPnPresentPathInfo->VidPnTargetId));
         return FALSE;
     }
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp	(revision 42154)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp	(revision 42158)
@@ -2981,13 +2981,15 @@
             fRenderFromSharedDisabled = vboxWddmModeRenderFromShadowCheckOnSubmitCommand(pDevExt, NULL);
             vboxWddmCheckUpdateFramebufferAddress(pDevExt, pSource);
-            uint32_t cUnlockedVBVADisabled = ASMAtomicReadU32(&pDevExt->cUnlockedVBVADisabled);
-            if (!cUnlockedVBVADisabled)
-                VBOXVBVA_OP(ReportDirtyRect, pDevExt, pSource, &pS2P->Shadow2Primary.SrcRect);
-            else
-            {
-                Assert(KeGetCurrentIrql() == DISPATCH_LEVEL);
-                VBOXVBVA_OP_WITHLOCK_ATDPC(ReportDirtyRect, pDevExt, pSource, &pS2P->Shadow2Primary.SrcRect);
-            }
-            /* get DPC data at IRQL */
+            if (pSrcAlloc->bVisible)
+            {
+                uint32_t cUnlockedVBVADisabled = ASMAtomicReadU32(&pDevExt->cUnlockedVBVADisabled);
+                if (!cUnlockedVBVADisabled)
+                    VBOXVBVA_OP(ReportDirtyRect, pDevExt, pSource, &pS2P->Shadow2Primary.SrcRect);
+                else
+                {
+                    Assert(KeGetCurrentIrql() == DISPATCH_LEVEL);
+                    VBOXVBVA_OP_WITHLOCK_ATDPC(ReportDirtyRect, pDevExt, pSource, &pS2P->Shadow2Primary.SrcRect);
+                }
+            }
 
             Status = vboxVdmaDdiCmdFenceComplete(pDevExt, pContext->NodeOrdinal, pSubmitCommand->SubmissionFenceId, DXGK_INTERRUPT_DMA_COMPLETED);
@@ -3001,7 +3003,4 @@
             PVBOXWDDM_ALLOCATION pDstAlloc = pBlt->Blt.DstAlloc.pAlloc;
             PVBOXWDDM_ALLOCATION pSrcAlloc = pBlt->Blt.SrcAlloc.pAlloc;
-            VBOXWDDM_SOURCE *pSource = &pDevExt->aSources[pDstAlloc->AllocData.SurfDesc.VidPnSourceId];
-
-            Assert(pDstAlloc->AllocData.SurfDesc.VidPnSourceId < VBOX_VIDEO_MAX_SCREENS);
 
             vboxWddmAddrSetVram(&pDstAlloc->AllocData.Addr, pBlt->Blt.DstAlloc.segmentIdAlloc, pBlt->Blt.DstAlloc.offAlloc);
@@ -3018,4 +3017,7 @@
                     )
             {
+                VBOXWDDM_SOURCE *pSource = &pDevExt->aSources[pDstAlloc->AllocData.SurfDesc.VidPnSourceId];
+                Assert(pDstAlloc->AllocData.SurfDesc.VidPnSourceId < VBOX_VIDEO_MAX_SCREENS);
+
                 if (pSrcAlloc->enmType == VBOXWDDM_ALLOC_TYPE_STD_SHADOWSURFACE)
                     vboxWddmAssignShadow(pDevExt, pSource, pSrcAlloc, pDstAlloc->AllocData.SurfDesc.VidPnSourceId);
@@ -3030,4 +3032,7 @@
                     )
             {
+                VBOXWDDM_SOURCE *pSource = &pDevExt->aSources[pDstAlloc->AllocData.SurfDesc.VidPnSourceId];
+                Assert(pDstAlloc->AllocData.SurfDesc.VidPnSourceId < VBOX_VIDEO_MAX_SCREENS);
+
                 if (pDstAlloc->enmType == VBOXWDDM_ALLOC_TYPE_STD_SHADOWSURFACE)
                     vboxWddmAssignShadow(pDevExt, pSource, pDstAlloc, pSrcAlloc->AllocData.SurfDesc.VidPnSourceId);
@@ -3048,5 +3053,5 @@
                     if (pDstAlloc->bAssigned)
                     {
-                        Assert(pSource->pPrimaryAllocation == pDstAlloc);
+//                        Assert(pSource->pPrimaryAllocation == pDstAlloc);
 
                         switch (pSrcAlloc->enmType)
@@ -3056,6 +3061,8 @@
                                 fBltFlags.fVisibleRegions = !!cContexts3D;
                                 Assert(pContext->enmType == VBOXWDDM_CONTEXT_TYPE_SYSTEM);
-
-                                if (!fRenderFromSharedDisabled)
+                                VBOXWDDM_SOURCE *pSource = &pDevExt->aSources[pDstAlloc->AllocData.SurfDesc.VidPnSourceId];
+                                Assert(pDstAlloc->AllocData.SurfDesc.VidPnSourceId < VBOX_VIDEO_MAX_SCREENS);
+
+                                if (!fRenderFromSharedDisabled && pSource->bVisible)
                                 {
                                     RECT rect;
@@ -4355,5 +4362,5 @@
     if (fDisabledFound)
     {
-        WARN(("found unsupported path"));
+        LOG(("found unsupported path"));
         bSupported = FALSE;
     }
@@ -4651,4 +4658,5 @@
 # endif
                     pDevExt->fRenderToShadowDisabled
+                    || (pAllocation && pAllocation->enmType == VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC)
                     )
 #endif
@@ -4707,4 +4715,5 @@
 # endif
                         pDevExt->fRenderToShadowDisabled
+                        || (pAllocation && pAllocation->enmType == VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC)
                         )
 #endif
@@ -5492,7 +5501,5 @@
                             Assert(pContext->enmType == VBOXWDDM_CONTEXT_TYPE_SYSTEM);
                             Assert(pDstAlloc->bAssigned);
-                            Assert(pDstAlloc->bVisible);
-                            if (pDstAlloc->bAssigned
-                                    && pDstAlloc->bVisible)
+                            if (pDstAlloc->bAssigned)
                             {
 #ifdef VBOX_WITH_VIDEOHWACCEL
@@ -6295,5 +6302,5 @@
     }
 
-    if (bUpdateRectInited)
+    if (bUpdateRectInited && pSource->bVisible)
     {
         VBOXVBVA_OP_WITHLOCK(ReportDirtyRect, pDevExt, pSource, &UpdateRect);
Index: trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.h
===================================================================
--- trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.h	(revision 42154)
+++ trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.h	(revision 42158)
@@ -126,9 +126,10 @@
         Assert(!pAllocation->bAssigned);
         Assert(!pAllocation->bVisible);
-        pAllocation->bVisible = FALSE;
         /* this check ensures the shadow is not used for other source simultaneously */
         Assert(pAllocation->AllocData.SurfDesc.VidPnSourceId == D3DDDI_ID_UNINITIALIZED);
         pAllocation->AllocData.SurfDesc.VidPnSourceId = srcId;
         pAllocation->bAssigned = TRUE;
+        pAllocation->bVisible = pSource->bVisible;
+
         if(!vboxWddmAddrVramEqual(&pSource->AllocData.Addr, &pAllocation->AllocData.Addr))
             pSource->bGhSynced = FALSE; /* force guest->host notification */
@@ -159,7 +160,7 @@
     if (pAllocation)
     {
-        pAllocation->bVisible = FALSE;
         Assert(pAllocation->AllocData.SurfDesc.VidPnSourceId == srcId);
         pAllocation->bAssigned = TRUE;
+        pAllocation->bVisible = pSource->bVisible;
 
         if(!vboxWddmAddrVramEqual(&pSource->AllocData.Addr, &pAllocation->AllocData.Addr))
@@ -192,8 +193,22 @@
 #ifdef VBOXWDDM_RENDER_FROM_SHADOW
 # ifdef VBOX_WDDM_WIN8
-#  define VBOXWDDM_FB_ALLOCATION(_pDevExt, _pSrc) ( (g_VBoxDisplayOnly || (_pDevExt)->fRenderToShadowDisabled) ? (_pSrc)->pPrimaryAllocation : (_pSrc)->pShadowAllocation)
+#  define VBOXWDDM_IS_FB_ALLOCATION(_pDevExt, _pAlloc) ( (_pAlloc)->bAssigned \
+        && (  (_pAlloc)->enmType == VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC \
+           || (_pAlloc)->enmType == \
+               ((g_VBoxDisplayOnly || (_pDevExt)->fRenderToShadowDisabled) ? VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE : VBOXWDDM_ALLOC_TYPE_STD_SHADOWSURFACE) \
+               ))
 # else
-#  define VBOXWDDM_FB_ALLOCATION(_pDevExt, _pSrc) ((_pDevExt)->fRenderToShadowDisabled ? (_pSrc)->pPrimaryAllocation : (_pSrc)->pShadowAllocation)
+#  define VBOXWDDM_IS_FB_ALLOCATION(_pDevExt, _pAlloc) ( (_pAlloc)->bAssigned \
+        && (  (_pAlloc)->enmType == VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC \
+           || (_pAlloc)->enmType == \
+               (((_pDevExt)->fRenderToShadowDisabled) ? VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE : VBOXWDDM_ALLOC_TYPE_STD_SHADOWSURFACE) \
+               ))
 # endif
+# define VBOXWDDM_FB_ALLOCATION(_pDevExt, _pSrc) ( ((_pSrc)->pPrimaryAllocation && VBOXWDDM_IS_FB_ALLOCATION(_pDevExt, (_pSrc)->pPrimaryAllocation)) ? \
+                (_pSrc)->pPrimaryAllocation : ( \
+                        ((_pSrc)->pShadowAllocation && VBOXWDDM_IS_FB_ALLOCATION(_pDevExt, (_pSrc)->pShadowAllocation)) ? \
+                                (_pSrc)->pShadowAllocation : NULL \
+                        ) \
+                )
 #else
 # define VBOXWDDM_FB_ALLOCATION(_pDevExt, _pSrc) ((_pSrc)->pPrimaryAllocation)
