Changeset 26969 in vbox for trunk/src/VBox
- Timestamp:
- Mar 2, 2010 8:28:01 PM (15 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 3 added
- 9 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 -
trunk/src/VBox/Devices/Graphics/DevVGA.cpp
r26856 r26969 49 49 * Defined Constants And Macros * 50 50 *******************************************************************************/ 51 #ifndef VBOX 51 52 /** The default amount of VRAM. */ 52 53 #define VGA_VRAM_DEFAULT (_4M) … … 55 56 /** The minimum amount of VRAM. */ 56 57 #define VGA_VRAM_MIN (_1M) 58 #else 59 /* moved to DevVGA.h */ 60 #endif 57 61 58 62 /** The size of the VGA GC mapping. -
trunk/src/VBox/Devices/Graphics/DevVGA.h
r25985 r26969 44 44 * THE SOFTWARE. 45 45 */ 46 #ifdef VBOX 47 /** The default amount of VRAM. */ 48 # define VGA_VRAM_DEFAULT (_4M) 49 /** The maximum amount of VRAM. */ 50 # define VGA_VRAM_MAX (128 * _1M) 51 /** The minimum amount of VRAM. */ 52 # define VGA_VRAM_MIN (_1M) 53 #endif 46 54 47 55 #ifdef VBOX_WITH_HGSMI … … 252 260 #endif /* VBOX */ 253 261 262 #ifdef VBOXVDMA 263 typedef struct VBOXVDMAHOST *PVBOXVDMAHOST; 264 #endif 265 254 266 typedef struct VGAState { 255 267 VGA_STATE_COMMON … … 282 294 R3PTRTYPE(PHGSMIINSTANCE) pHGSMI; 283 295 #endif /* VBOX_WITH_HGSMI */ 296 #ifdef VBOXVDMA 297 R3PTRTYPE(PVBOXVDMAHOST) pVdma; 298 #endif 284 299 285 300 /** Current refresh timer interval. */ … … 476 491 int vboxVBVALoadStateDone (PPDMDEVINS pDevIns, PSSMHANDLE pSSM); 477 492 493 # ifdef VBOXVDMA 494 int vboxVDMAConstruct(PVGASTATE pVGAState, struct VBOXVDMAHOST *pVdma); 495 int vboxVDMADestruct(PVGASTATE pVGAState, struct VBOXVDMAHOST *pVdma); 496 void vboxVDMAControl(PVGASTATE pVGAState, struct VBOXVDMAHOST *pVdma, PVBOXVDMA_CTL pCmd); 497 void vboxVDMACommand(PVGASTATE pVGAState, struct VBOXVDMAHOST *pVdma, PVBOXVDMACBUF_DR pCmd); 498 # endif /* VBOXVDMA */ 499 478 500 #endif /* VBOX_WITH_HGSMI */ 479 501 -
trunk/src/VBox/Devices/Graphics/DevVGA_VBVA.cpp
r26856 r26969 34 34 #include <iprt/semaphore.h> 35 35 #endif 36 37 /** The default amount of VRAM. */38 #define VGA_VRAM_DEFAULT (_4M)39 /** The maximum amount of VRAM. */40 #define VGA_VRAM_MAX (128 * _1M)41 /** The minimum amount of VRAM. */42 #define VGA_VRAM_MIN (_1M)43 36 44 37 #include "DevVGA.h" … … 1304 1297 #ifdef VBOXVDMA 1305 1298 case VBVA_VDMA_CMD: 1306 case VBVA_VDMA_CTL: 1299 { 1300 PVBOXVDMACBUF_DR pCmd = (PVBOXVDMACBUF_DR)VBoxSHGSMIBufferData ((PVBOXSHGSMIHEADER)pvBuffer); 1301 vboxVDMACommand(pVGAState, pVGAState->pVdma, pCmd); 1307 1302 rc = VINF_SUCCESS; 1308 1303 break; 1304 } 1305 case VBVA_VDMA_CTL: 1306 { 1307 PVBOXVDMA_CTL pCmd = (PVBOXVDMA_CTL)VBoxSHGSMIBufferData ((PVBOXSHGSMIHEADER)pvBuffer); 1308 vboxVDMAControl(pVGAState, pVGAState->pVdma, pCmd); 1309 rc = VINF_SUCCESS; 1310 break; 1311 } 1309 1312 #endif 1310 1313 case VBVA_QUERY_CONF32: -
trunk/src/VBox/Devices/Graphics/HGSMI/HGSMIHost.cpp
r26556 r26969 1677 1677 1678 1678 int rc = hgsmiGuestCompletionFIFOAlloc (pIns, &pEntry); 1679 1679 AssertRC(rc); 1680 1680 if (RT_SUCCESS (rc)) 1681 1681 { … … 1683 1683 1684 1684 rc = hgsmiFIFOLock(pIns); 1685 AssertRC(rc); 1685 1686 if (RT_SUCCESS (rc)) 1686 1687 { -
trunk/src/VBox/Devices/Graphics/HGSMI/HGSMIHost.h
r25062 r26969 136 136 int HGSMIHostSaveStateExec (PHGSMIINSTANCE pIns, PSSMHANDLE pSSM); 137 137 138 #if 0 139 /* Submit this buffer to the guest asynchronously. */ 140 int HGSMIHostBufferProcessAsync (PHGSMIINSTANCE pIns, 141 void *pvMem, 142 PFNHGSMIBUFFERPROCESSED); 138 #ifdef VBOXVDMA 139 int HGSMICompleteGuestCommand(PHGSMIINSTANCE pIns, void *pvMem, bool bDoIrq); 143 140 #endif 144 141 -
trunk/src/VBox/Devices/Graphics/HGSMI/HGSMIHostHlp.h
r26876 r26969 50 50 } 51 51 52 DECLINLINE(bool) hgsmiListIsEmpty (HGSMILIST *pList) 53 { 54 return !pList->pHead; 55 } 56 52 57 DECLINLINE(void) hgsmiListInit (HGSMILIST *pList) 53 58 { -
trunk/src/VBox/Devices/Makefile.kmk
r26951 r26969 348 348 ifdef VBOXVDMA 349 349 DevicesR3_DEFS += VBOXVDMA 350 DevicesR3_SOURCES += \ 351 Graphics/HGSMI/SHGSMIHost.cpp \ 352 Graphics/DevVGA_VDMA.cpp 350 353 endif 351 354
Note:
See TracChangeset
for help on using the changeset viewer.