- Timestamp:
- Mar 6, 2012 8:38:49 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/VBoxVideoGuest.h
r38207 r40387 43 43 #endif 44 44 45 #ifdef VBOX_WDDM_MINIPORT 46 # include "wddm/VBoxMPShgsmi.h" 47 typedef VBOXSHGSMI HGSMIGUESTCMDHEAP; 48 # define HGSMIGUESTCMDHEAP_GET(_p) (&(_p)->Heap) 49 #else 50 typedef HGSMIHEAP HGSMIGUESTCMDHEAP; 51 # define HGSMIGUESTCMDHEAP_GET(_p) (_p) 52 #endif 53 45 54 RT_C_DECLS_BEGIN 46 55 … … 53 62 /** Information about the memory heap located in VRAM from which data 54 63 * structures to be sent to the host are allocated. */ 55 HGSMI HEAP heapCtx;64 HGSMIGUESTCMDHEAP heapCtx; 56 65 /** The I/O port used for submitting commands to the host by writing their 57 66 * offsets into the heap. */ -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPDevExt.h
r39981 r40387 178 178 #else 179 179 /* all memory layout info should be initialized */ 180 Assert(pDevExt->u.primary.Vdma.CmdHeap. area.offBase);180 Assert(pDevExt->u.primary.Vdma.CmdHeap.Heap.area.offBase); 181 181 /* page aligned */ 182 Assert(!(pDevExt->u.primary.Vdma.CmdHeap. area.offBase & 0xfff));183 184 return pDevExt->u.primary.Vdma.CmdHeap. area.offBase & ~0xfffUL;182 Assert(!(pDevExt->u.primary.Vdma.CmdHeap.Heap.area.offBase & 0xfff)); 183 184 return pDevExt->u.primary.Vdma.CmdHeap.Heap.area.offBase & ~0xfffUL; 185 185 #endif 186 186 } -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/common/VBoxMPHGSMI.cpp
r36867 r40387 154 154 { 155 155 VBoxMPCmnUnmapAdapterMemory(pCommon, &pCommon->pvMiniportHeap); 156 #ifdef VBOX_WDDM_MINIPORT 157 VBoxSHGSMITerm(&pCommon->guestCtx.heapCtx); 158 #else 156 159 HGSMIHeapDestroy(&pCommon->guestCtx.heapCtx); 160 #endif 157 161 158 162 /* Unmap the adapter information needed for HGSMI IO. */ -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPShgsmi.cpp
r39981 r40387 26 26 } 27 27 28 void vboxSHGSMICommandFree ( struct _HGSMIHEAP *pHeap, PVBOXSHGSMIHEADER pCmd)29 { 30 HGSMIHeapFree(pHeap, pCmd);31 } 32 33 DECLINLINE(void) vboxSHGSMICommandRelease ( struct _HGSMIHEAP *pHeap, PVBOXSHGSMIHEADER pCmd)28 void vboxSHGSMICommandFree (PVBOXSHGSMI pHeap, PVBOXSHGSMIHEADER pCmd) 29 { 30 VBoxSHGSMIHeapFree(pHeap, pCmd); 31 } 32 33 DECLINLINE(void) vboxSHGSMICommandRelease (PVBOXSHGSMI pHeap, PVBOXSHGSMIHEADER pCmd) 34 34 { 35 35 uint32_t cRefs = ASMAtomicDecU32(&pCmd->cRefs); … … 39 39 } 40 40 41 DECLCALLBACK(void) vboxSHGSMICompletionSetEvent( struct _HGSMIHEAP *pHeap, void *pvCmd, void *pvContext)41 DECLCALLBACK(void) vboxSHGSMICompletionSetEvent(PVBOXSHGSMI pHeap, void *pvCmd, void *pvContext) 42 42 { 43 43 RTSemEventSignal((RTSEMEVENT)pvContext); 44 44 } 45 45 46 DECLCALLBACK(void) vboxSHGSMICompletionCommandRelease( struct _HGSMIHEAP *pHeap, void *pvCmd, void *pvContext)46 DECLCALLBACK(void) vboxSHGSMICompletionCommandRelease(PVBOXSHGSMI pHeap, void *pvCmd, void *pvContext) 47 47 { 48 48 vboxSHGSMICommandRelease (pHeap, VBoxSHGSMIBufferHeader(pvCmd)); … … 50 50 51 51 /* do not wait for completion */ 52 DECLINLINE(const VBOXSHGSMIHEADER*) vboxSHGSMICommandPrepAsynch ( struct _HGSMIHEAP *pHeap, PVBOXSHGSMIHEADER pHeader)52 DECLINLINE(const VBOXSHGSMIHEADER*) vboxSHGSMICommandPrepAsynch (PVBOXSHGSMI pHeap, PVBOXSHGSMIHEADER pHeader) 53 53 { 54 54 /* ensure the command is not removed until we're processing it */ … … 57 57 } 58 58 59 DECLINLINE(void) vboxSHGSMICommandDoneAsynch ( struct _HGSMIHEAP *pHeap, const VBOXSHGSMIHEADER* pHeader)59 DECLINLINE(void) vboxSHGSMICommandDoneAsynch (PVBOXSHGSMI pHeap, const VBOXSHGSMIHEADER* pHeader) 60 60 { 61 61 if(!(ASMAtomicReadU32((volatile uint32_t *)&pHeader->fFlags) & VBOXSHGSMI_FLAG_HG_ASYNCH)) … … 69 69 } 70 70 71 const VBOXSHGSMIHEADER* VBoxSHGSMICommandPrepAsynchEvent ( struct _HGSMIHEAP *pHeap, PVOID pvBuff, RTSEMEVENT hEventSem)71 const VBOXSHGSMIHEADER* VBoxSHGSMICommandPrepAsynchEvent (PVBOXSHGSMI pHeap, PVOID pvBuff, RTSEMEVENT hEventSem) 72 72 { 73 73 PVBOXSHGSMIHEADER pHeader = VBoxSHGSMIBufferHeader (pvBuff); … … 79 79 } 80 80 81 const VBOXSHGSMIHEADER* VBoxSHGSMICommandPrepSynch ( struct _HGSMIHEAP *pHeap, PVOID pCmd)81 const VBOXSHGSMIHEADER* VBoxSHGSMICommandPrepSynch (PVBOXSHGSMI pHeap, PVOID pCmd) 82 82 { 83 83 RTSEMEVENT hEventSem; … … 91 91 } 92 92 93 void VBoxSHGSMICommandDoneAsynch ( struct _HGSMIHEAP *pHeap, const VBOXSHGSMIHEADER * pHeader)93 void VBoxSHGSMICommandDoneAsynch (PVBOXSHGSMI pHeap, const VBOXSHGSMIHEADER * pHeader) 94 94 { 95 95 vboxSHGSMICommandDoneAsynch(pHeap, pHeader); 96 96 } 97 97 98 int VBoxSHGSMICommandDoneSynch ( struct _HGSMIHEAP *pHeap, const VBOXSHGSMIHEADER* pHeader)98 int VBoxSHGSMICommandDoneSynch (PVBOXSHGSMI pHeap, const VBOXSHGSMIHEADER* pHeader) 99 99 { 100 100 VBoxSHGSMICommandDoneAsynch (pHeap, pHeader); … … 107 107 } 108 108 109 void VBoxSHGSMICommandCancelAsynch ( struct _HGSMIHEAP *pHeap, const VBOXSHGSMIHEADER* pHeader)109 void VBoxSHGSMICommandCancelAsynch (PVBOXSHGSMI pHeap, const VBOXSHGSMIHEADER* pHeader) 110 110 { 111 111 vboxSHGSMICommandRelease(pHeap, (PVBOXSHGSMIHEADER)pHeader); 112 112 } 113 113 114 void VBoxSHGSMICommandCancelSynch ( struct _HGSMIHEAP *pHeap, const VBOXSHGSMIHEADER* pHeader)114 void VBoxSHGSMICommandCancelSynch (PVBOXSHGSMI pHeap, const VBOXSHGSMIHEADER* pHeader) 115 115 { 116 116 VBoxSHGSMICommandCancelAsynch (pHeap, pHeader); … … 119 119 } 120 120 121 const VBOXSHGSMIHEADER* VBoxSHGSMICommandPrepAsynch ( struct _HGSMIHEAP *pHeap, PVOID pvBuff, PFNVBOXSHGSMICMDCOMPLETION pfnCompletion, PVOID pvCompletion, uint32_t fFlags)121 const VBOXSHGSMIHEADER* VBoxSHGSMICommandPrepAsynch (PVBOXSHGSMI pHeap, PVOID pvBuff, PFNVBOXSHGSMICMDCOMPLETION pfnCompletion, PVOID pvCompletion, uint32_t fFlags) 122 122 { 123 123 fFlags &= ~VBOXSHGSMI_FLAG_GH_ASYNCH_CALLBACK_IRQ; … … 130 130 } 131 131 132 const VBOXSHGSMIHEADER* VBoxSHGSMICommandPrepAsynchIrq ( struct _HGSMIHEAP *pHeap, PVOID pvBuff, PFNVBOXSHGSMICMDCOMPLETION_IRQ pfnCompletion, PVOID pvCompletion, uint32_t fFlags)132 const VBOXSHGSMIHEADER* VBoxSHGSMICommandPrepAsynchIrq (PVBOXSHGSMI pHeap, PVOID pvBuff, PFNVBOXSHGSMICMDCOMPLETION_IRQ pfnCompletion, PVOID pvCompletion, uint32_t fFlags) 133 133 { 134 134 fFlags |= VBOXSHGSMI_FLAG_GH_ASYNCH_CALLBACK_IRQ | VBOXSHGSMI_FLAG_GH_ASYNCH_IRQ; … … 142 142 } 143 143 144 void* VBoxSHGSMICommandAlloc (struct _HGSMIHEAP * pHeap, HGSMISIZE cbData, uint8_t u8Channel, uint16_t u16ChannelInfo) 144 void* VBoxSHGSMIHeapAlloc(PVBOXSHGSMI pHeap, HGSMISIZE cbData, uint8_t u8Channel, uint16_t u16ChannelInfo) 145 { 146 KIRQL OldIrql; 147 void* pvData; 148 Assert(KeGetCurrentIrql() <= DISPATCH_LEVEL); 149 KeAcquireSpinLock(&pHeap->HeapLock, &OldIrql); 150 pvData = HGSMIHeapAlloc(&pHeap->Heap, cbData, u8Channel, u16ChannelInfo); 151 KeReleaseSpinLock(&pHeap->HeapLock, OldIrql); 152 if (!pvData) 153 WARN(("HGSMIHeapAlloc failed!")); 154 return pvData; 155 } 156 157 void VBoxSHGSMIHeapFree(PVBOXSHGSMI pHeap, void *pvBuffer) 158 { 159 KIRQL OldIrql; 160 Assert(KeGetCurrentIrql() <= DISPATCH_LEVEL); 161 KeAcquireSpinLock(&pHeap->HeapLock, &OldIrql); 162 HGSMIHeapFree(&pHeap->Heap, pvBuffer); 163 KeReleaseSpinLock(&pHeap->HeapLock, OldIrql); 164 } 165 166 int VBoxSHGSMIInit(PVBOXSHGSMI pHeap, void *pvBase, HGSMISIZE cbArea, HGSMIOFFSET offBase, bool fOffsetBased) 167 { 168 KeInitializeSpinLock(&pHeap->HeapLock); 169 return HGSMIHeapSetup(&pHeap->Heap, pvBase, cbArea, offBase, fOffsetBased); 170 } 171 172 void VBoxSHGSMITerm(PVBOXSHGSMI pHeap) 173 { 174 HGSMIHeapDestroy(&pHeap->Heap); 175 } 176 177 void* VBoxSHGSMICommandAlloc(PVBOXSHGSMI pHeap, HGSMISIZE cbData, uint8_t u8Channel, uint16_t u16ChannelInfo) 145 178 { 146 179 /* Issue the flush command. */ 147 PVBOXSHGSMIHEADER pHeader = (PVBOXSHGSMIHEADER) HGSMIHeapAlloc(pHeap, cbData + sizeof (VBOXSHGSMIHEADER), u8Channel, u16ChannelInfo);180 PVBOXSHGSMIHEADER pHeader = (PVBOXSHGSMIHEADER)VBoxSHGSMIHeapAlloc(pHeap, cbData + sizeof (VBOXSHGSMIHEADER), u8Channel, u16ChannelInfo); 148 181 Assert(pHeader); 149 182 if (pHeader) … … 155 188 } 156 189 157 void VBoxSHGSMICommandFree (struct _HGSMIHEAP *pHeap, void *pvBuffer)190 void VBoxSHGSMICommandFree(PVBOXSHGSMI pHeap, void *pvBuffer) 158 191 { 159 192 PVBOXSHGSMIHEADER pHeader = VBoxSHGSMIBufferHeader(pvBuffer); … … 161 194 } 162 195 163 //int VBoxSHGSMISetup (PVBOXSHGSMIHEAP pHeap,164 // void *pvBase,165 // HGSMISIZE cbArea,166 // HGSMIOFFSET offBase,167 // bool fOffsetBased,168 // PFNVBOXSHGSMINOTIFYHOST pfnNotifyHost,169 // PFNVBOXSHGSMINOTIFYHOST pvNotifyHost)170 //{171 // /* Setup a HGSMI heap within the adapter information area. */172 // return HGSMIHeapSetup (&pHeap->Heap,173 // pvBuffer,174 // cbBuffer,175 // offBuffer,176 // false /*fOffsetBased*/);177 //}178 //179 //int VBoxSHGSMIDestroy (PVBOXSHGSMIHEAP pHeap)180 //{181 // HGSMIHeapDestroy (pHeap);182 // return VINF_SUCCESS;183 //}184 185 196 #define VBOXSHGSMI_CMD2LISTENTRY(_pCmd) ((PVBOXVTLIST_ENTRY)&(_pCmd)->pvNext) 186 197 #define VBOXSHGSMI_LISTENTRY2CMD(_pEntry) ( (PVBOXSHGSMIHEADER)((uint8_t *)(_pEntry) - RT_OFFSETOF(VBOXSHGSMIHEADER, pvNext)) ) 187 198 188 int VBoxSHGSMICommandProcessCompletion ( struct _HGSMIHEAP *pHeap, VBOXSHGSMIHEADER* pCur, bool bIrq, PVBOXVTLIST pPostProcessList)199 int VBoxSHGSMICommandProcessCompletion (PVBOXSHGSMI pHeap, VBOXSHGSMIHEADER* pCur, bool bIrq, PVBOXVTLIST pPostProcessList) 189 200 { 190 201 int rc = VINF_SUCCESS; … … 229 240 } 230 241 231 int VBoxSHGSMICommandPostprocessCompletion ( struct _HGSMIHEAP *pHeap, PVBOXVTLIST pPostProcessList)242 int VBoxSHGSMICommandPostprocessCompletion (PVBOXSHGSMI pHeap, PVBOXVTLIST pPostProcessList) 232 243 { 233 244 PVBOXVTLIST_ENTRY pNext, pCur; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPShgsmi.h
r39981 r40387 22 22 #include <iprt/cdefs.h> 23 23 #include <VBox/VBoxVideo.h> 24 #include "../../common/VBoxVideoTools.h"25 24 26 typedef DECLCALLBACK(void) FNVBOXSHGSMICMDCOMPLETION(struct _HGSMIHEAP * pHeap, void *pvCmd, void *pvContext); 25 #include "common/VBoxMPUtils.h" 26 27 typedef struct VBOXSHGSMI 28 { 29 KSPIN_LOCK HeapLock; 30 HGSMIHEAP Heap; 31 } VBOXSHGSMI, *PVBOXSHGSMI; 32 33 typedef DECLCALLBACK(void) FNVBOXSHGSMICMDCOMPLETION(PVBOXSHGSMI pHeap, void *pvCmd, void *pvContext); 27 34 typedef FNVBOXSHGSMICMDCOMPLETION *PFNVBOXSHGSMICMDCOMPLETION; 28 35 29 typedef DECLCALLBACK(void) FNVBOXSHGSMICMDCOMPLETION_IRQ( struct _HGSMIHEAP *pHeap, void *pvCmd, void *pvContext,36 typedef DECLCALLBACK(void) FNVBOXSHGSMICMDCOMPLETION_IRQ(PVBOXSHGSMI pHeap, void *pvCmd, void *pvContext, 30 37 PFNVBOXSHGSMICMDCOMPLETION *ppfnCompletion, void **ppvCompletion); 31 38 typedef FNVBOXSHGSMICMDCOMPLETION_IRQ *PFNVBOXSHGSMICMDCOMPLETION_IRQ; 32 39 33 40 34 const VBOXSHGSMIHEADER* VBoxSHGSMICommandPrepAsynchEvent( struct _HGSMIHEAP *pHeap, PVOID pvBuff, RTSEMEVENT hEventSem);35 const VBOXSHGSMIHEADER* VBoxSHGSMICommandPrepSynch( struct _HGSMIHEAP *pHeap, PVOID pCmd);36 const VBOXSHGSMIHEADER* VBoxSHGSMICommandPrepAsynch( struct _HGSMIHEAP *pHeap, PVOID pvBuff, PFNVBOXSHGSMICMDCOMPLETION pfnCompletion, PVOID pvCompletion, uint32_t fFlags);37 const VBOXSHGSMIHEADER* VBoxSHGSMICommandPrepAsynchIrq( struct _HGSMIHEAP *pHeap, PVOID pvBuff, PFNVBOXSHGSMICMDCOMPLETION_IRQ pfnCompletion, PVOID pvCompletion, uint32_t fFlags);41 const VBOXSHGSMIHEADER* VBoxSHGSMICommandPrepAsynchEvent(PVBOXSHGSMI pHeap, PVOID pvBuff, RTSEMEVENT hEventSem); 42 const VBOXSHGSMIHEADER* VBoxSHGSMICommandPrepSynch(PVBOXSHGSMI pHeap, PVOID pCmd); 43 const VBOXSHGSMIHEADER* VBoxSHGSMICommandPrepAsynch(PVBOXSHGSMI pHeap, PVOID pvBuff, PFNVBOXSHGSMICMDCOMPLETION pfnCompletion, PVOID pvCompletion, uint32_t fFlags); 44 const VBOXSHGSMIHEADER* VBoxSHGSMICommandPrepAsynchIrq(PVBOXSHGSMI pHeap, PVOID pvBuff, PFNVBOXSHGSMICMDCOMPLETION_IRQ pfnCompletion, PVOID pvCompletion, uint32_t fFlags); 38 45 39 void VBoxSHGSMICommandDoneAsynch( struct _HGSMIHEAP *pHeap, const VBOXSHGSMIHEADER* pHeader);40 int VBoxSHGSMICommandDoneSynch( struct _HGSMIHEAP *pHeap, const VBOXSHGSMIHEADER* pHeader);41 void VBoxSHGSMICommandCancelAsynch( struct _HGSMIHEAP *pHeap, const VBOXSHGSMIHEADER* pHeader);42 void VBoxSHGSMICommandCancelSynch( struct _HGSMIHEAP *pHeap, const VBOXSHGSMIHEADER* pHeader);46 void VBoxSHGSMICommandDoneAsynch(PVBOXSHGSMI pHeap, const VBOXSHGSMIHEADER* pHeader); 47 int VBoxSHGSMICommandDoneSynch(PVBOXSHGSMI pHeap, const VBOXSHGSMIHEADER* pHeader); 48 void VBoxSHGSMICommandCancelAsynch(PVBOXSHGSMI pHeap, const VBOXSHGSMIHEADER* pHeader); 49 void VBoxSHGSMICommandCancelSynch(PVBOXSHGSMI pHeap, const VBOXSHGSMIHEADER* pHeader); 43 50 44 DECLINLINE(HGSMIOFFSET) VBoxSHGSMICommandOffset( struct _HGSMIHEAP *pHeap, const VBOXSHGSMIHEADER* pHeader)51 DECLINLINE(HGSMIOFFSET) VBoxSHGSMICommandOffset(PVBOXSHGSMI pHeap, const VBOXSHGSMIHEADER* pHeader) 45 52 { 46 return HGSMIHeapBufferOffset( pHeap, (void*)pHeader);53 return HGSMIHeapBufferOffset(&pHeap->Heap, (void*)pHeader); 47 54 } 48 55 49 void* VBoxSHGSMICommandAlloc(struct _HGSMIHEAP * pHeap, HGSMISIZE cbData, uint8_t u8Channel, uint16_t u16ChannelInfo); 50 void VBoxSHGSMICommandFree(struct _HGSMIHEAP * pHeap, void *pvBuffer); 51 int VBoxSHGSMICommandProcessCompletion(struct _HGSMIHEAP * pHeap, VBOXSHGSMIHEADER* pCmd, bool bIrq, PVBOXVTLIST pPostProcessList); 52 int VBoxSHGSMICommandPostprocessCompletion(struct _HGSMIHEAP * pHeap, PVBOXVTLIST pPostProcessList); 56 int VBoxSHGSMIInit(PVBOXSHGSMI pHeap, void *pvBase, HGSMISIZE cbArea, HGSMIOFFSET offBase, bool fOffsetBased); 57 void VBoxSHGSMITerm(PVBOXSHGSMI pHeap); 58 void* VBoxSHGSMIHeapAlloc(PVBOXSHGSMI pHeap, HGSMISIZE cbData, uint8_t u8Channel, uint16_t u16ChannelInfo); 59 void VBoxSHGSMIHeapFree(PVBOXSHGSMI pHeap, void *pvBuffer); 60 void* VBoxSHGSMICommandAlloc(PVBOXSHGSMI pHeap, HGSMISIZE cbData, uint8_t u8Channel, uint16_t u16ChannelInfo); 61 void VBoxSHGSMICommandFree(PVBOXSHGSMI pHeap, void *pvBuffer); 62 int VBoxSHGSMICommandProcessCompletion(PVBOXSHGSMI pHeap, VBOXSHGSMIHEADER* pCmd, bool bIrq, struct VBOXVTLIST * pPostProcessList); 63 int VBoxSHGSMICommandPostprocessCompletion(PVBOXSHGSMI pHeap, struct VBOXVTLIST * pPostProcessList); 53 64 54 65 #endif /* #ifndef ___VBoxMPShgsmi_h___ */ -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.cpp
r39981 r40387 1315 1315 { 1316 1316 pCmd->enmCtl = enmCtl; 1317 pCmd->u32Offset = pInfo->CmdHeap. area.offBase;1317 pCmd->u32Offset = pInfo->CmdHeap.Heap.area.offBase; 1318 1318 pCmd->i32Result = VERR_NOT_SUPPORTED; 1319 1319 … … 1372 1372 1373 1373 #ifdef VBOX_WITH_VDMA 1374 KeInitializeSpinLock(&pInfo->HeapLock);1375 1374 Assert((offBuffer & 0xfff) == 0); 1376 1375 Assert((cbBuffer & 0xfff) == 0); … … 1396 1395 { 1397 1396 /* Setup a HGSMI heap within the adapter information area. */ 1398 rc = HGSMIHeapSetup(&pInfo->CmdHeap,1397 rc = VBoxSHGSMIInit(&pInfo->CmdHeap, 1399 1398 pvBuffer, 1400 1399 cbBuffer, … … 1488 1487 rc = vboxVdmaDisable (pDevExt, pInfo); 1489 1488 #ifdef VBOX_WITH_VDMA 1490 VBoxMPCmnUnmapAdapterMemory(VBoxCommonFromDeviceExt(pDevExt), (void**)&pInfo->CmdHeap.area.pu8Base); 1489 VBoxSHGSMITerm(&pInfo->CmdHeap); 1490 VBoxMPCmnUnmapAdapterMemory(VBoxCommonFromDeviceExt(pDevExt), (void**)&pInfo->CmdHeap.Heap.area.pu8Base); 1491 1491 #endif 1492 1492 } … … 1499 1499 void vboxVdmaCBufDrFree (PVBOXVDMAINFO pInfo, PVBOXVDMACBUF_DR pDr) 1500 1500 { 1501 KIRQL OldIrql;1502 KeAcquireSpinLock(&pInfo->HeapLock, &OldIrql);1503 1501 VBoxSHGSMICommandFree (&pInfo->CmdHeap, pDr); 1504 KeReleaseSpinLock(&pInfo->HeapLock, OldIrql);1505 1502 } 1506 1503 … … 1508 1505 { 1509 1506 uint32_t cbDr = VBOXVDMACBUF_DR_SIZE(cbTrailingData); 1510 KIRQL OldIrql;1511 KeAcquireSpinLock(&pInfo->HeapLock, &OldIrql);1512 1507 PVBOXVDMACBUF_DR pDr = (PVBOXVDMACBUF_DR)VBoxSHGSMICommandAlloc (&pInfo->CmdHeap, cbDr, HGSMI_CH_VBVA, VBVA_VDMA_CMD); 1513 KeReleaseSpinLock(&pInfo->HeapLock, OldIrql);1514 1508 Assert(pDr); 1515 1509 if (pDr) … … 1521 1515 } 1522 1516 1523 static DECLCALLBACK(void) vboxVdmaCBufDrCompletion( struct _HGSMIHEAP *pHeap, void *pvCmd, void *pvContext)1517 static DECLCALLBACK(void) vboxVdmaCBufDrCompletion(PVBOXSHGSMI pHeap, void *pvCmd, void *pvContext) 1524 1518 { 1525 1519 PVBOXMP_DEVEXT pDevExt = (PVBOXMP_DEVEXT)pvContext; … … 1529 1523 } 1530 1524 1531 static DECLCALLBACK(void) vboxVdmaCBufDrCompletionIrq( struct _HGSMIHEAP *pHeap, void *pvCmd, void *pvContext,1525 static DECLCALLBACK(void) vboxVdmaCBufDrCompletionIrq(PVBOXSHGSMI pHeap, void *pvCmd, void *pvContext, 1532 1526 PFNVBOXSHGSMICMDCOMPLETION *ppfnCompletion, void **ppvCompletion) 1533 1527 { -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPVdma.h
r38982 r40387 291 291 { 292 292 #ifdef VBOX_WITH_VDMA 293 KSPIN_LOCK HeapLock; 294 HGSMIHEAP CmdHeap; 293 VBOXSHGSMI CmdHeap; 295 294 #endif 296 295 UINT uLastCompletedPagingBufferCmdFenceId; -
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
r39981 r40387 288 288 #endif 289 289 290 HGSMIHEAP*vboxWddmHgsmiGetHeapFromCmdOffset(PVBOXMP_DEVEXT pDevExt, HGSMIOFFSET offCmd)290 PVBOXSHGSMI vboxWddmHgsmiGetHeapFromCmdOffset(PVBOXMP_DEVEXT pDevExt, HGSMIOFFSET offCmd) 291 291 { 292 292 #ifdef VBOX_WITH_VDMA 293 if(HGSMIAreaContainsOffset(&pDevExt->u.primary.Vdma.CmdHeap. area, offCmd))293 if(HGSMIAreaContainsOffset(&pDevExt->u.primary.Vdma.CmdHeap.Heap.area, offCmd)) 294 294 return &pDevExt->u.primary.Vdma.CmdHeap; 295 295 #endif 296 if (HGSMIAreaContainsOffset(&VBoxCommonFromDeviceExt(pDevExt)->guestCtx.heapCtx. area, offCmd))296 if (HGSMIAreaContainsOffset(&VBoxCommonFromDeviceExt(pDevExt)->guestCtx.heapCtx.Heap.area, offCmd)) 297 297 return &VBoxCommonFromDeviceExt(pDevExt)->guestCtx.heapCtx; 298 298 return NULL; … … 311 311 { 312 312 #ifdef VBOX_WITH_VDMA 313 if(HGSMIAreaContainsOffset(&pDevExt->u.primary.Vdma.CmdHeap. area, offCmd))313 if(HGSMIAreaContainsOffset(&pDevExt->u.primary.Vdma.CmdHeap.Heap.area, offCmd)) 314 314 return VBOXWDDM_HGSMICMD_TYPE_DMACMD; 315 315 #endif 316 if (HGSMIAreaContainsOffset(&VBoxCommonFromDeviceExt(pDevExt)->guestCtx.heapCtx. area, offCmd))316 if (HGSMIAreaContainsOffset(&VBoxCommonFromDeviceExt(pDevExt)->guestCtx.heapCtx.Heap.area, offCmd)) 317 317 return VBOXWDDM_HGSMICMD_TYPE_CTL; 318 318 return VBOXWDDM_HGSMICMD_TYPE_UNDEFINED; … … 1171 1171 VBOXWDDM_HGSMICMD_TYPE enmType = vboxWddmHgsmiGetCmdTypeFromOffset(pDevExt, offCmd); 1172 1172 PVBOXVTLIST pList; 1173 HGSMIHEAP *pHeap = NULL;1173 PVBOXSHGSMI pHeap = NULL; 1174 1174 switch (enmType) 1175 1175 { … … 1191 1191 { 1192 1192 uint16_t chInfo; 1193 uint8_t *pvCmd = HGSMIBufferDataAndChInfoFromOffset (&pHeap-> area, offCmd, &chInfo);1193 uint8_t *pvCmd = HGSMIBufferDataAndChInfoFromOffset (&pHeap->Heap.area, offCmd, &chInfo); 1194 1194 Assert(pvCmd); 1195 1195 if (pvCmd) -
trunk/src/VBox/Additions/common/VBoxVideo/HGSMIBase.cpp
r35398 r40387 128 128 uint16_t u16Op) 129 129 { 130 #ifdef VBOX_WITH_WDDM 131 /* @todo: add synchronization */ 130 #ifdef VBOX_WDDM_MINIPORT 131 return VBoxSHGSMIHeapAlloc (&pCtx->heapCtx, cbData, u8Ch, u16Op); 132 #else 133 return HGSMIHeapAlloc (&pCtx->heapCtx, cbData, u8Ch, u16Op); 132 134 #endif 133 return HGSMIHeapAlloc (&pCtx->heapCtx, cbData, u8Ch, u16Op);134 135 } 135 136 … … 144 145 void *pvBuffer) 145 146 { 146 #ifdef VBOX_WITH_WDDM 147 /* @todo: add synchronization */ 147 #ifdef VBOX_WDDM_MINIPORT 148 VBoxSHGSMIHeapFree (&pCtx->heapCtx, pvBuffer); 149 #else 150 HGSMIHeapFree (&pCtx->heapCtx, pvBuffer); 148 151 #endif 149 HGSMIHeapFree (&pCtx->heapCtx, pvBuffer);150 152 } 151 153 … … 161 163 { 162 164 /* Initialize the buffer and get the offset for port IO. */ 163 HGSMIOFFSET offBuffer = HGSMIHeapBufferOffset ( &pCtx->heapCtx, pvBuffer);165 HGSMIOFFSET offBuffer = HGSMIHeapBufferOffset (HGSMIGUESTCMDHEAP_GET(&pCtx->heapCtx), pvBuffer); 164 166 165 167 Assert(offBuffer != HGSMIOFFSET_VOID); … … 184 186 185 187 /* Allocate the IO buffer. */ 186 p = (HGSMIBUFFERLOCATION *) HGSMIHeapAlloc(&pCtx->heapCtx,188 p = (HGSMIBUFFERLOCATION *)VBoxHGSMIBufferAlloc(pCtx, 187 189 sizeof(HGSMIBUFFERLOCATION), 188 190 HGSMI_CH_HGSMI, … … 195 197 rc = VBoxHGSMIBufferSubmit(pCtx, p); 196 198 /* Free the IO buffer. */ 197 HGSMIHeapFree (&pCtx->heapCtx, p);199 VBoxHGSMIBufferFree(pCtx, p); 198 200 } 199 201 else … … 212 214 213 215 /* Allocate the IO buffer. */ 214 pCaps = (VBVACAPS *) HGSMIHeapAlloc(&pCtx->heapCtx,216 pCaps = (VBVACAPS *)VBoxHGSMIBufferAlloc(pCtx, 215 217 sizeof(VBVACAPS), HGSMI_CH_VBVA, 216 218 VBVA_INFO_CAPS); … … 228 230 } 229 231 /* Free the IO buffer. */ 230 HGSMIHeapFree(&pCtx->heapCtx, pCaps);232 VBoxHGSMIBufferFree(pCtx, pCaps); 231 233 } 232 234 else … … 245 247 246 248 /* Allocate the IO buffer. */ 247 p = (VBVAINFOHEAP *) HGSMIHeapAlloc(&pCtx->heapCtx,249 p = (VBVAINFOHEAP *)VBoxHGSMIBufferAlloc(pCtx, 248 250 sizeof (VBVAINFOHEAP), HGSMI_CH_VBVA, 249 251 VBVA_INFO_HEAP); … … 255 257 rc = VBoxHGSMIBufferSubmit(pCtx, p); 256 258 /* Free the IO buffer. */ 257 HGSMIHeapFree(&pCtx->heapCtx, p);259 VBoxHGSMIBufferFree(pCtx, p); 258 260 } 259 261 else … … 322 324 /** @todo should we be using a fixed ISA port value here? */ 323 325 pCtx->port = (RTIOPORT)VGA_PORT_HGSMI_GUEST; 326 #ifdef VBOX_WDDM_MINIPORT 327 return VBoxSHGSMIInit(&pCtx->heapCtx, pvGuestHeapMemory, 328 cbGuestHeapMemory, offVRAMGuestHeapMemory, 329 false /*fOffsetBased*/); 330 #else 324 331 return HGSMIHeapSetup(&pCtx->heapCtx, pvGuestHeapMemory, 325 332 cbGuestHeapMemory, offVRAMGuestHeapMemory, 326 333 false /*fOffsetBased*/); 334 #endif 327 335 } 328 336 … … 460 468 461 469 /* Allocate the IO buffer. */ 462 p = (VBVACONF32 *) HGSMIHeapAlloc(&pCtx->heapCtx,470 p = (VBVACONF32 *)VBoxHGSMIBufferAlloc(pCtx, 463 471 sizeof(VBVACONF32), HGSMI_CH_VBVA, 464 472 VBVA_QUERY_CONF32); … … 475 483 } 476 484 /* Free the IO buffer. */ 477 HGSMIHeapFree(&pCtx->heapCtx, p);485 VBoxHGSMIBufferFree(pCtx, p); 478 486 } 479 487 else … … 528 536 } 529 537 /* Allocate the IO buffer. */ 530 p = (VBVAMOUSEPOINTERSHAPE *) HGSMIHeapAlloc(&pCtx->heapCtx,538 p = (VBVAMOUSEPOINTERSHAPE *)VBoxHGSMIBufferAlloc(pCtx, 531 539 sizeof(VBVAMOUSEPOINTERSHAPE) 532 540 + cbData, … … 551 559 rc = p->i32Result; 552 560 /* Free the IO buffer. */ 553 HGSMIHeapFree(&pCtx->heapCtx, p);561 VBoxHGSMIBufferFree(pCtx, p); 554 562 } 555 563 else
Note:
See TracChangeset
for help on using the changeset viewer.