Changeset 47059 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm
- Timestamp:
- Jul 9, 2013 4:27:54 PM (11 years ago)
- 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 209 209 } 210 210 211 DECLINLINE(BOOLEAN)vboxWddmSwapchainRetain(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_SWAPCHAIN pSwapchain)211 BOOLEAN vboxWddmSwapchainRetain(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_SWAPCHAIN pSwapchain) 212 212 { 213 213 KIRQL OldIrql; … … 219 219 } 220 220 221 DECLINLINE(VOID)vboxWddmSwapchainRelease(PVBOXWDDM_SWAPCHAIN pSwapchain)221 VOID vboxWddmSwapchainRelease(PVBOXWDDM_SWAPCHAIN pSwapchain) 222 222 { 223 223 const uint32_t cRefs = ASMAtomicDecU32(&pSwapchain->cRefs); … … 230 230 } 231 231 232 PVBOXWDDM_SWAPCHAIN vboxWddmSwapchainRetainByAlloc (PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_ALLOCATION pAlloc)232 PVBOXWDDM_SWAPCHAIN vboxWddmSwapchainRetainByAllocData(PVBOXMP_DEVEXT pDevExt, const struct VBOXWDDM_ALLOC_DATA *pAllocData) 233 233 { 234 234 KIRQL OldIrql; 235 235 PVBOXWDDM_SWAPCHAIN pSwapchain; 236 236 KeAcquireSpinLock(&pDevExt->SynchLock, &OldIrql); 237 pSwapchain = pAlloc ->pSwapchain;237 pSwapchain = pAllocData->pSwapchain; 238 238 if (pSwapchain && !vboxWddmSwapchainRetainLocked(pSwapchain)) 239 239 pSwapchain = NULL; … … 242 242 } 243 243 244 PVBOXWDDM_SWAPCHAIN vboxWddmSwapchainRetainByAlloc(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_ALLOCATION pAlloc) 245 { 246 return vboxWddmSwapchainRetainByAllocData(pDevExt, &pAlloc->AllocData); 247 } 248 244 249 VOID vboxWddmSwapchainAllocRemove(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_SWAPCHAIN pSwapchain, PVBOXWDDM_ALLOCATION pAlloc) 245 250 { 246 251 KIRQL OldIrql; 247 252 KeAcquireSpinLock(&pDevExt->SynchLock, &OldIrql); 248 Assert(pAlloc-> pSwapchain == pSwapchain);249 pAlloc-> pSwapchain = NULL;253 Assert(pAlloc->AllocData.pSwapchain == pSwapchain); 254 pAlloc->AllocData.pSwapchain = NULL; 250 255 RemoveEntryList(&pAlloc->SwapchainEntry); 251 256 KeReleaseSpinLock(&pDevExt->SynchLock, OldIrql); … … 257 262 KIRQL OldIrql; 258 263 BOOLEAN bRc; 259 Assert(!pAlloc-> pSwapchain);264 Assert(!pAlloc->AllocData.pSwapchain); 260 265 KeAcquireSpinLock(&pDevExt->SynchLock, &OldIrql); 261 266 bRc = vboxWddmSwapchainRetainLocked(pSwapchain); 262 267 if (bRc) 263 268 { 264 if (pAlloc-> pSwapchain)269 if (pAlloc->AllocData.pSwapchain) 265 270 { 266 271 RemoveEntryList(&pAlloc->SwapchainEntry); 267 272 } 268 273 InsertTailList(&pSwapchain->AllocList, &pAlloc->SwapchainEntry); 269 pAlloc-> pSwapchain = pSwapchain;274 pAlloc->AllocData.pSwapchain = pSwapchain; 270 275 } 271 276 KeReleaseSpinLock(&pDevExt->SynchLock, OldIrql); … … 287 292 PVBOXWDDM_ALLOCATION pAlloc = VBOXSCENTRY_2_ALLOC(pEntry); 288 293 pEntry = pEntry->Flink; 289 Assert(pAlloc-> pSwapchain == pSwapchain);290 pAlloc-> pSwapchain = NULL;294 Assert(pAlloc->AllocData.pSwapchain == pSwapchain); 295 pAlloc->AllocData.pSwapchain = NULL; 291 296 RemoveEntryList(&pAlloc->SwapchainEntry); 292 297 ++cRemoved; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPMisc.h
r47039 r47059 72 72 73 73 PVBOXWDDM_SWAPCHAIN vboxWddmSwapchainCreate(); 74 DECLINLINE(BOOLEAN)vboxWddmSwapchainRetain(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_SWAPCHAIN pSwapchain);75 DECLINLINE(VOID)vboxWddmSwapchainRelease(PVBOXWDDM_SWAPCHAIN pSwapchain);74 BOOLEAN vboxWddmSwapchainRetain(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_SWAPCHAIN pSwapchain); 75 VOID vboxWddmSwapchainRelease(PVBOXWDDM_SWAPCHAIN pSwapchain); 76 76 PVBOXWDDM_SWAPCHAIN vboxWddmSwapchainRetainByAlloc(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_ALLOCATION pAlloc); 77 PVBOXWDDM_SWAPCHAIN vboxWddmSwapchainRetainByAllocData(PVBOXMP_DEVEXT pDevExt, const struct VBOXWDDM_ALLOC_DATA *pAllocData); 77 78 VOID vboxWddmSwapchainAllocRemove(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_SWAPCHAIN pSwapchain, PVBOXWDDM_ALLOCATION pAlloc); 78 79 BOOLEAN vboxWddmSwapchainAllocAdd(PVBOXMP_DEVEXT pDevExt, PVBOXWDDM_SWAPCHAIN pSwapchain, PVBOXWDDM_ALLOCATION pAlloc); -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPTypes.h
r46966 r47059 104 104 VBOXWDDM_SURFACE_DESC SurfDesc; 105 105 VBOXWDDM_ADDR Addr; 106 uint32_t hostID; 107 struct VBOXWDDM_SWAPCHAIN *pSwapchain; 106 108 } VBOXWDDM_ALLOC_DATA, *PVBOXWDDM_ALLOC_DATA; 107 109 … … 144 146 { 145 147 LIST_ENTRY SwapchainEntry; 146 struct VBOXWDDM_SWAPCHAIN *pSwapchain;147 148 VBOXWDDM_ALLOC_TYPE enmType; 148 149 volatile uint32_t cRefs; … … 166 167 KSPIN_LOCK OpenLock; 167 168 LIST_ENTRY OpenList; 168 uint32_t hostID;169 169 /* helps tracking when to release wine shared resource */ 170 170 uint32_t cShRcRefs; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.cpp
r47049 r47059 448 448 */ 449 449 static NTSTATUS vboxVdmaProcessVRegCmdLegacy(PVBOXMP_DEVEXT pDevExt, 450 PVBOXWDDM_CONTEXT pContext, 450 VBOXMP_CRPACKER *pCrPacker, 451 uint32_t u32CrConClientID, 451 452 PVBOXWDDM_SOURCE pSource, 452 453 PVBOXWDDM_SWAPCHAIN pSwapchain, … … 570 571 goto done; 571 572 572 PVBOXMP_CRPACKER pPacker = &pContext->CrPacker;573 573 uint32_t cbCommandBuffer = VBOXMP_CRCMD_HEADER_SIZE, cCommands = 0; 574 574 … … 606 606 } 607 607 608 VBoxMpCrPackerTxBufferInit(p Packer,pvCommandBuffer, cbCommandBuffer, cCommands);608 VBoxMpCrPackerTxBufferInit(pCrPacker, pvCommandBuffer, cbCommandBuffer, cCommands); 609 609 610 610 Assert(pSwapchain->winHostID); 611 611 612 612 if (fCurRectChanged && fCurChanged) 613 crPackWindowPosition(&p Packer->CrPacker, pSwapchain->winHostID, CurPos.x, CurPos.y);613 crPackWindowPosition(&pCrPacker->CrPacker, pSwapchain->winHostID, CurPos.x, CurPos.y); 614 614 615 615 if (!pSwapchain->fExposed) 616 616 { 617 crPackWindowSize(&p Packer->CrPacker, pSwapchain->winHostID, pSwapchain->width, pSwapchain->height);618 crPackWindowShow(&p Packer->CrPacker, pSwapchain->winHostID, TRUE);617 crPackWindowSize(&pCrPacker->CrPacker, pSwapchain->winHostID, pSwapchain->width, pSwapchain->height); 618 crPackWindowShow(&pCrPacker->CrPacker, pSwapchain->winHostID, TRUE); 619 619 pSwapchain->fExposed = TRUE; 620 620 } 621 621 622 crPackWindowVisibleRegion(&p Packer->CrPacker, pSwapchain->winHostID, cVRects, (GLint*)pVRectsBuff);623 624 Status = vboxVdmaCrSubmitWriteAsync(pDevExt, p Packer, pContext->u32CrConClientID);622 crPackWindowVisibleRegion(&pCrPacker->CrPacker, pSwapchain->winHostID, cVRects, (GLint*)pVRectsBuff); 623 624 Status = vboxVdmaCrSubmitWriteAsync(pDevExt, pCrPacker, u32CrConClientID); 625 625 if (!NT_SUCCESS(Status)) 626 626 { … … 983 983 } 984 984 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, 985 static 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, 1030 990 const RECT *pSrcRect, const VBOXVDMAPIPE_RECTS *pDstRects) 1031 991 { 1032 D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId = pDstAlloc Info->srcId;992 D3DDDI_VIDEO_PRESENT_SOURCE_ID srcId = pDstAllocData->SurfDesc.VidPnSourceId; 1033 993 VBOXWDDM_SOURCE *pSource = &pDevExt->aSources[srcId]; 1034 994 NTSTATUS Status = STATUS_SUCCESS; … … 1037 997 { 1038 998 /* 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) 1043 1000 { 1044 1001 WARN(("non-primary allocation passed to vboxWddmSubmitBltCmd!")); … … 1046 1003 } 1047 1004 1048 uint32_t hostID = pSrcAlloc ->hostID;1005 uint32_t hostID = pSrcAllocData->hostID; 1049 1006 int rc; 1050 1007 if (hostID) 1051 1008 { 1052 Assert(pContext->enmType == VBOXWDDM_CONTEXT_TYPE_CUSTOM_3D);1009 // Assert(pContext->enmType == VBOXWDDM_CONTEXT_TYPE_CUSTOM_3D); 1053 1010 int32_t posX = pDstRects->ContextRect.left - pSrcRect->left; 1054 1011 int32_t posY = pDstRects->ContextRect.top - pSrcRect->top; 1055 1012 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); 1057 1014 if (NT_SUCCESS(Status)) 1058 1015 { … … 1066 1023 WARN(("vboxVdmaTexPresentSubmit failed Status 0x%x", Status)); 1067 1024 } 1068 else if ( pSource->pPrimaryAllocation == pDstAlloc)1025 else if (&pSource->pPrimaryAllocation->AllocData == pDstAllocData) 1069 1026 { 1070 1027 bool fChanged = false; 1071 Assert(p DstAlloc->bVisible);1028 Assert(pSource->pPrimaryAllocation->bVisible); 1072 1029 rc = VBoxVrListRectsAdd(&pSource->VrList, pDstRects->UpdateRects.cRects, (const RTRECT*)pDstRects->UpdateRects.aRects, &fChanged); 1073 1030 if (RT_SUCCESS(rc)) … … 1075 1032 if (fChanged) 1076 1033 { 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); 1078 1035 if (NT_SUCCESS(Status)) 1079 1036 { … … 1086 1043 if (Rect.xLeft == 0 1087 1044 && Rect.yTop == 0 1088 && Rect.xRight == pDstAlloc ->AllocData.SurfDesc.width1089 && Rect.yBottom == pDstAlloc ->AllocData.SurfDesc.height)1045 && Rect.xRight == pDstAllocData->SurfDesc.width 1046 && Rect.yBottom == pDstAllocData->SurfDesc.height) 1090 1047 { 1091 1048 pSource->fHas3DVrs = FALSE; … … 1109 1066 else 1110 1067 { 1111 PVBOXWDDM_ALLOCATION pSrcAlloc = pSrcAllocInfo->pAlloc; 1112 PVBOXWDDM_SWAPCHAIN pSwapchain = vboxWddmSwapchainRetainByAlloc(pDevExt, pSrcAlloc); 1068 PVBOXWDDM_SWAPCHAIN pSwapchain = vboxWddmSwapchainRetainByAllocData(pDevExt, pSrcAllocData); 1113 1069 1114 1070 if (pSwapchain) 1115 1071 { 1116 Assert(pSrcAlloc ->AllocData.SurfDesc.width == pSwapchain->width);1117 Assert(pSrcAlloc ->AllocData.SurfDesc.height == pSwapchain->height);1118 } 1119 1120 Status = vboxVdmaProcessVRegCmdLegacy(pDevExt, pC ontext, 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); 1121 1077 if (!NT_SUCCESS(Status)) 1122 1078 WARN(("vboxVdmaProcessVRegCmdLegacy failed Status 0x%x", Status)); … … 1127 1083 1128 1084 return Status; 1085 } 1086 1087 NTSTATUS 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 1116 static 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); 1129 1124 } 1130 1125 … … 1217 1212 Status = vboxVdmaGgDmaColorFill(pDevExt, &pCF->ClrFill); 1218 1213 if (!NT_SUCCESS(Status)) 1219 WARN(("vboxVdma ProcessVRegCmdfailed Status 0x%x", Status));1214 WARN(("vboxVdmaGgDmaColorFill failed Status 0x%x", Status)); 1220 1215 } 1221 1216 else -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.h
r46885 r47059 347 347 NTSTATUS vboxVdmaProcessClrFillCmd(PVBOXMP_DEVEXT pDevExt, struct VBOXWDDM_CONTEXT *pContext, struct VBOXWDDM_DMA_PRIVATEDATA_CLRFILL *pCF, struct VBOXVDMAPIPE_FLAGS_DMACMD fFlags); 348 348 349 350 NTSTATUS vboxVdmaTexPresentSetAlloc(PVBOXMP_DEVEXT pDevExt, D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId, PVBOXWDDM_ALLOCATION pAllocation); 349 NTSTATUS vboxVdmaTexPresentSetAlloc(PVBOXMP_DEVEXT pDevExt, const VBOXWDDM_ALLOC_DATA *pAllocData); 351 350 352 351 #endif /* #ifndef ___VBoxMPVdma_h___ */ -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
r47049 r47059 273 273 { 274 274 NTSTATUS Status = vboxWddmGhDisplaySetMode(pDevExt, pAllocData); 275 Assert(Status == STATUS_SUCCESS); 276 if (Status == STATUS_SUCCESS) 275 if (NT_SUCCESS(Status)) 277 276 { 278 277 Status = vboxWddmGhDisplayPostInfoView(pDevExt, pAllocData); 279 Assert(Status == STATUS_SUCCESS); 280 if (Status == STATUS_SUCCESS) 278 if (NT_SUCCESS(Status)) 281 279 { 282 280 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)); 286 291 } 287 292 else 288 WARN(("vboxWddmGhDisplayPostInfoView failed "));293 WARN(("vboxWddmGhDisplayPostInfoView failed, Status 0x%x", Status)); 289 294 } 290 295 else 291 WARN(("vboxWddmGhDisplaySetMode failed "));296 WARN(("vboxWddmGhDisplaySetMode failed, Status 0x%x", Status)); 292 297 293 298 return Status; … … 2273 2278 pAllocation->fRcFlags = pAllocInfo->fFlags; 2274 2279 pAllocation->AllocData.SurfDesc = pAllocInfo->SurfDesc; 2275 pAllocation-> hostID = pAllocInfo->hostID;2280 pAllocation->AllocData.hostID = pAllocInfo->hostID; 2276 2281 2277 2282 pAllocationInfo->Size = pAllocInfo->SurfDesc.cbSize; … … 4742 4747 pSource->fGhSynced = 0; /* force guest->host notification */ 4743 4748 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) 4762 4750 { 4763 4751 vboxWddmGhDisplayCheckSetInfoFromSource(pDevExt, pSource); … … 4805 4793 { 4806 4794 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) 4825 4796 { 4826 4797 vboxWddmGhDisplayCheckSetInfoFromSource(pDevExt, pSource); … … 6409 6380 SrcAllocData.Addr.SegmentId = 0; 6410 6381 SrcAllocData.Addr.pvMem = pPresentDisplayOnly->pSource; 6382 SrcAllocData.hostID = 0; 6383 SrcAllocData.pSwapchain = NULL; 6411 6384 6412 6385 RECT UpdateRect; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.h
r47049 r47059 135 135 136 136 pSource->pShadowAllocation = pAllocation; 137 138 Assert(!pSource->AllocData.pSwapchain); 139 Assert(!pSource->AllocData.hostID); 137 140 } 138 141 #endif … … 168 171 } 169 172 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 else185 {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 else206 {207 Assert(!pSource->fHas3DVrs);208 }209 210 173 KIRQL OldIrql; 211 174 KeAcquireSpinLock(&pSource->AllocationLock, &OldIrql); 212 175 pSource->pPrimaryAllocation = pAllocation; 213 176 KeReleaseSpinLock(&pSource->AllocationLock, OldIrql); 177 178 Assert(!pSource->AllocData.pSwapchain); 179 Assert(!pSource->AllocData.hostID); 214 180 } 215 181 … … 231 197 # ifdef VBOX_WDDM_WIN8 232 198 # define VBOXWDDM_IS_FB_ALLOCATION(_pDevExt, _pAlloc) ( (_pAlloc)->bAssigned \ 233 && ( (_pAlloc)-> enmType == VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC\199 && ( (_pAlloc)->AllocData.hostID \ 234 200 || (_pAlloc)->enmType == \ 235 201 ((g_VBoxDisplayOnly || (_pDevExt)->fRenderToShadowDisabled) ? VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE : VBOXWDDM_ALLOC_TYPE_STD_SHADOWSURFACE) \ … … 237 203 # else 238 204 # define VBOXWDDM_IS_FB_ALLOCATION(_pDevExt, _pAlloc) ( (_pAlloc)->bAssigned \ 239 && ( (_pAlloc)-> enmType == VBOXWDDM_ALLOC_TYPE_UMD_RC_GENERIC\205 && ( (_pAlloc)->AllocData.hostID \ 240 206 || (_pAlloc)->enmType == \ 241 207 (((_pDevExt)->fRenderToShadowDisabled) ? VBOXWDDM_ALLOC_TYPE_STD_SHAREDPRIMARYSURFACE : VBOXWDDM_ALLOC_TYPE_STD_SHADOWSURFACE) \
Note:
See TracChangeset
for help on using the changeset viewer.