Changeset 109165 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/gallium/VBoxMPGaWddm.cpp
- Timestamp:
- May 5, 2025 6:17:33 PM (4 days ago)
- svn:sync-xref-src-repo-rev:
- 168723
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/gallium/VBoxMPGaWddm.cpp
r106061 r109165 5 5 6 6 /* 7 * Copyright (C) 2016-202 4Oracle and/or its affiliates.7 * Copyright (C) 2016-2025 Oracle and/or its affiliates. 8 8 * 9 9 * This file is part of VirtualBox base platform packages, as … … 183 183 AssertReturn(pSvgaContext, STATUS_INSUFFICIENT_RESOURCES); 184 184 185 pSvgaContext->u32Cid = SVGA3D_INVALID_ID; 186 for (unsigned i = 0; i < RT_ELEMENTS(pSvgaContext->aCOT); ++i) 187 pSvgaContext->aCOT[i].mobid = SVGA3D_INVALID_ID; 185 188 pSvgaContext->fDXContext = RT_BOOL(pInfo->u.vmsvga.u32Flags & VBOXWDDM_F_GA_CONTEXT_VGPU10); 186 189 … … 236 239 { 237 240 PVMSVGACOT pCOT = &pSvgaContext->aCOT[i]; 238 if (pCOT-> pMob)241 if (pCOT->mobid != SVGA3D_INVALID_ID) 239 242 { 240 243 void *pvCmd = SvgaCmdBuf3dCmdReserve(pSvga, SVGA_3D_CMD_DX_SET_COTABLE, sizeof(SVGA3dCmdDXSetCOTable), SVGA3D_INVALID_ID); … … 257 260 258 261 uint32_t cbRequired = 0; 259 SvgaMobDestroy(pSvga, pCOT->pMob, NULL, 0, &cbRequired);262 SvgaMobDestroy(pSvga, SVGA3D_INVALID_ID, NULL, 0, &cbRequired); 260 263 pvCmd = SvgaCmdBufReserve(pSvga, cbRequired, SVGA3D_INVALID_ID); 261 264 if (pvCmd) 262 265 { 263 SvgaMobDestroy(pSvga, pCOT-> pMob, pvCmd, cbRequired, &cbRequired);266 SvgaMobDestroy(pSvga, pCOT->mobid, pvCmd, cbRequired, &cbRequired); 264 267 SvgaCmdBufCommit(pSvga, cbRequired); 265 268 } 266 269 267 pCOT-> pMob = NULL;270 pCOT->mobid = SVGA3D_INVALID_ID; 268 271 } 269 272 } … … 1563 1566 1564 1567 PVBOXWDDM_EXT_VMSVGA pSvga = (PVBOXWDDM_EXT_VMSVGA)Context; 1565 if (pSvga->pMiniportMobData) 1566 { 1567 uint64_t const u64MobFence = ASMAtomicReadU64(&pSvga->pMiniportMobData->u64MobFence); 1568 1569 /* Move mobs which were deleted by the host to the local list under the lock. */ 1570 RTLISTANCHOR listDestroyedMobs; 1571 RTListInit(&listDestroyedMobs); 1572 1573 KIRQL OldIrql; 1574 SvgaHostObjectsLock(pSvga, &OldIrql); 1575 1576 PVMSVGAMOB pIter, pNext; 1577 RTListForEachSafe(&pSvga->listMobDeferredDestruction, pIter, pNext, VMSVGAMOB, node) 1578 { 1579 if (gaFenceCmp64(pIter->u64MobFence, u64MobFence) <= 0) 1580 { 1581 RTListNodeRemove(&pIter->node); 1582 RTListAppend(&listDestroyedMobs, &pIter->node); 1583 } 1584 } 1585 1586 SvgaHostObjectsUnlock(pSvga, OldIrql); 1587 1588 RTListForEachSafe(&listDestroyedMobs, pIter, pNext, VMSVGAMOB, node) 1589 { 1590 /* Delete the data. SvgaMobFree deallocates pIter. */ 1591 RTListNodeRemove(&pIter->node); 1592 SvgaMobFree(pSvga, pIter); 1593 } 1594 } 1568 SvgaDeferredMobDestruction(pSvga); 1569 1570 ASMAtomicDecS32(&pSvga->cQueuedWorkItems); 1595 1571 } 1596 1572 … … 1692 1668 PIO_WORKITEM pWorkItem = IoAllocateWorkItem(pDevExt->pPDO); 1693 1669 if (pWorkItem) 1670 { 1671 ASMAtomicIncS32(&pSvga->cQueuedWorkItems); 1694 1672 IoQueueWorkItemEx(pWorkItem, dxDeferredMobDestruction, DelayedWorkQueue, pSvga); 1673 } 1695 1674 } 1696 1675 }
Note:
See TracChangeset
for help on using the changeset viewer.