Changeset 26969 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Timestamp:
- Mar 2, 2010 8:28:01 PM (15 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoShgsmi.cpp
r26930 r26969 28 28 29 29 /* SHGSMI */ 30 31 DECLINLINE(uint8_t *) vboxSHGSMIBufferData (const PVBOXSHGSMIHEADER pHeader)32 {33 return (uint8_t *)pHeader + sizeof (VBOXSHGSMIHEADER);34 }35 36 DECLINLINE(PVBOXSHGSMIHEADER) vboxSHGSMIBufferHeader (const void *pvData)37 {38 return (PVBOXSHGSMIHEADER)((uint8_t *)pvData - sizeof (VBOXSHGSMIHEADER));39 }40 41 30 DECLINLINE(void) vboxSHGSMICommandRetain (PVBOXSHGSMIHEADER pCmd) 42 31 { … … 64 53 DECLCALLBACK(void) vboxSHGSMICompletionCommandRelease(struct _HGSMIHEAP * pHeap, void *pvCmd, void *pvContext) 65 54 { 66 vboxSHGSMICommandRelease (pHeap, vboxSHGSMIBufferHeader(pvCmd));55 vboxSHGSMICommandRelease (pHeap, VBoxSHGSMIBufferHeader(pvCmd)); 67 56 } 68 57 … … 88 77 { 89 78 PFNVBOXSHGSMICMDCOMPLETION pfnCompletion = (PFNVBOXSHGSMICMDCOMPLETION)pHeader->u64Info1; 90 pfnCompletion(pHeap, vboxSHGSMIBufferData (pHeader), (PVOID)pHeader->u64Info2);79 pfnCompletion(pHeap, VBoxSHGSMIBufferData (pHeader), (PVOID)pHeader->u64Info2); 91 80 } 92 81 … … 97 86 void VBoxSHGSMICommandSubmitAsynchEvent (struct _HGSMIHEAP * pHeap, PVOID pvBuff, RTSEMEVENT hEventSem) 98 87 { 99 PVBOXSHGSMIHEADER pHeader = vboxSHGSMIBufferHeader (pvBuff);88 PVBOXSHGSMIHEADER pHeader = VBoxSHGSMIBufferHeader (pvBuff); 100 89 pHeader->u64Info1 = (uint64_t)vboxSHGSMICompletionSetEvent; 101 90 pHeader->u64Info2 = (uint64_t)hEventSem; … … 125 114 { 126 115 fFlags &= ~VBOXSHGSMI_FLAG_GH_ASYNCH_CALLBACK_IRQ; 127 PVBOXSHGSMIHEADER pHeader = vboxSHGSMIBufferHeader (pvBuff);116 PVBOXSHGSMIHEADER pHeader = VBoxSHGSMIBufferHeader (pvBuff); 128 117 pHeader->u64Info1 = (uint64_t)pfnCompletion; 129 118 pHeader->u64Info2 = (uint64_t)pvCompletion; … … 136 125 { 137 126 fFlags |= VBOXSHGSMI_FLAG_GH_ASYNCH_CALLBACK_IRQ | VBOXSHGSMI_FLAG_GH_ASYNCH_IRQ; 138 PVBOXSHGSMIHEADER pHeader = vboxSHGSMIBufferHeader (pvBuff);127 PVBOXSHGSMIHEADER pHeader = VBoxSHGSMIBufferHeader (pvBuff); 139 128 pHeader->u64Info1 = (uint64_t)pfnCompletion; 140 129 pHeader->u64Info2 = (uint64_t)pvCompletion; 130 /* we must assign rather than or because flags field does not get zeroed on command creation */ 141 131 pHeader->fFlags = fFlags; 142 132 … … 150 140 Assert(pHeader); 151 141 if (pHeader) 152 return vboxSHGSMIBufferData(pHeader); 142 { 143 pHeader->cRefs = 1; 144 return VBoxSHGSMIBufferData(pHeader); 145 } 153 146 return NULL; 154 147 } … … 156 149 void VBoxSHGSMICommandFree (struct _HGSMIHEAP * pHeap, void *pvBuffer) 157 150 { 158 PVBOXSHGSMIHEADER pHeader = vboxSHGSMIBufferHeader(pvBuffer);151 PVBOXSHGSMIHEADER pHeader = VBoxSHGSMIBufferHeader(pvBuffer); 159 152 vboxSHGSMICommandRelease (pHeap, pHeader); 160 153 } … … 204 197 void *pvCallback = (void*)pCur->u64Info2; 205 198 206 pfnCallback(pHeap, vboxSHGSMIBufferData(pCur), pvCallback, &pfnCompletion, &pvCompletion);199 pfnCallback(pHeap, VBoxSHGSMIBufferData(pCur), pvCallback, &pfnCompletion, &pvCompletion); 207 200 if (pfnCompletion) 208 201 { … … 222 215 PFNVBOXSHGSMICMDCOMPLETION pfnCallback = (PFNVBOXSHGSMICMDCOMPLETION)pCur->u64Info1; 223 216 void *pvCallback = (void*)pCur->u64Info2; 224 pfnCallback(pHeap, vboxSHGSMIBufferData(pCur), pvCallback);217 pfnCallback(pHeap, VBoxSHGSMIBufferData(pCur), pvCallback); 225 218 } 226 219 else -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.cpp
r26661 r26969 30 30 31 31 32 static int vboxVdmaInformHost (PDEVICE_EXTENSION pDevExt, PVBOXVDMAINFO pInfo, uint32_t fFlags)32 static int vboxVdmaInformHost (PDEVICE_EXTENSION pDevExt, PVBOXVDMAINFO pInfo, VBOXVDMA_CTL_TYPE enmCtl) 33 33 { 34 34 int rc = VINF_SUCCESS; … … 37 37 if (pCmd) 38 38 { 39 pCmd-> u32Flags = fFlags;39 pCmd->enmCtl = enmCtl; 40 40 pCmd->u32Offset = pInfo->CmdHeap.area.offBase; 41 41 pCmd->i32Result = VERR_NOT_SUPPORTED; … … 51 51 { 52 52 drprintf((__FUNCTION__": HGSMIHeapAlloc failed\n")); 53 rc = VERR_ GENERAL_FAILURE;53 rc = VERR_OUT_OF_RESOURCES; 54 54 } 55 55 … … 115 115 pInfo->fEnabled = FALSE; 116 116 117 int rc = vboxVdmaInformHost (pDevExt, pInfo, VBOXVDMA_CTL_ DISABLE);117 int rc = vboxVdmaInformHost (pDevExt, pInfo, VBOXVDMA_CTL_TYPE_DISABLE); 118 118 AssertRC(rc); 119 119 return rc; … … 128 128 return VINF_ALREADY_INITIALIZED; 129 129 130 int rc = vboxVdmaInformHost (pDevExt, pInfo, VBOXVDMA_CTL_ ENABLE);130 int rc = vboxVdmaInformHost (pDevExt, pInfo, VBOXVDMA_CTL_TYPE_ENABLE); 131 131 Assert(RT_SUCCESS(rc)); 132 132 if (RT_SUCCESS(rc)) … … 144 144 return VINF_ALREADY_INITIALIZED; 145 145 146 int rc = vboxVdmaInformHost (pDevExt, pInfo, VBOXVDMA_CTL_ FLUSH);146 int rc = vboxVdmaInformHost (pDevExt, pInfo, VBOXVDMA_CTL_TYPE_FLUSH); 147 147 Assert(RT_SUCCESS(rc)); 148 148
Note:
See TracChangeset
for help on using the changeset viewer.