Changeset 34665 in vbox for trunk/src/VBox/Additions/common/VBoxVideo
- Timestamp:
- Dec 2, 2010 11:05:33 PM (14 years ago)
- Location:
- trunk/src/VBox/Additions/common/VBoxVideo
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxVideo/HGSMIBase.cpp
r34430 r34665 324 324 { 325 325 VBVAINFOVIEW *pInfo = (VBVAINFOVIEW *)p; 326 rc = pfnFill(pvData, pInfo );326 rc = pfnFill(pvData, pInfo, u32Count); 327 327 if (RT_SUCCESS(rc)) 328 328 VBoxHGSMIBufferSubmit (pCtx, p); … … 337 337 /** 338 338 * Get the information needed to map the basic communication structures in 339 * device memory into our address space. 339 * device memory into our address space. All pointer parameters are optional. 340 340 * 341 341 * @param cbVRAM how much video RAM is allocated to the device 342 342 * @param poffVRAMBaseMapping where to save the offset from the start of the 343 * device VRAM of the whole area to map 343 * device VRAM of the whole area to map 344 344 * @param pcbMapping where to save the mapping size 345 345 * @param poffGuestHeapMemory where to save the offset into the mapped area … … 357 357 uint32_t *poffHostFlags) 358 358 { 359 AssertPtrReturnVoid(poffVRAMBaseMapping); 360 AssertPtrReturnVoid(pcbMapping); 361 AssertPtrReturnVoid(poffGuestHeapMemory); 362 AssertPtrReturnVoid(pcbGuestHeapMemory); 363 AssertPtrReturnVoid(poffHostFlags); 364 *poffVRAMBaseMapping = cbVRAM - VBVA_ADAPTER_INFORMATION_SIZE; 365 *pcbMapping = VBVA_ADAPTER_INFORMATION_SIZE; 366 *poffGuestHeapMemory = 0; 367 *pcbGuestHeapMemory = VBVA_ADAPTER_INFORMATION_SIZE - sizeof(HGSMIHOSTFLAGS); 368 *poffHostFlags = VBVA_ADAPTER_INFORMATION_SIZE - sizeof(HGSMIHOSTFLAGS); 359 AssertPtrNullReturnVoid(poffVRAMBaseMapping); 360 AssertPtrNullReturnVoid(pcbMapping); 361 AssertPtrNullReturnVoid(poffGuestHeapMemory); 362 AssertPtrNullReturnVoid(pcbGuestHeapMemory); 363 AssertPtrNullReturnVoid(poffHostFlags); 364 if (poffVRAMBaseMapping) 365 *poffVRAMBaseMapping = cbVRAM - VBVA_ADAPTER_INFORMATION_SIZE; 366 if (pcbMapping) 367 *pcbMapping = VBVA_ADAPTER_INFORMATION_SIZE; 368 if (poffGuestHeapMemory) 369 *poffGuestHeapMemory = 0; 370 if (pcbGuestHeapMemory) 371 *pcbGuestHeapMemory = VBVA_ADAPTER_INFORMATION_SIZE 372 - sizeof(HGSMIHOSTFLAGS); 373 if (poffHostFlags) 374 *poffHostFlags = VBVA_ADAPTER_INFORMATION_SIZE 375 - sizeof(HGSMIHOSTFLAGS); 369 376 } 370 377 -
trunk/src/VBox/Additions/common/VBoxVideo/VBVABase.cpp
r34440 r34665 49 49 static bool vboxVBVAInformHost(PVBVABUFFERCONTEXT pCtx, 50 50 PHGSMIGUESTCOMMANDCONTEXT pHGSMICtx, 51 bool bEnable)51 int32_t cScreen, bool bEnable) 52 52 { 53 53 bool bRc = false; … … 58 58 { 59 59 void *p = VBoxHGSMIBufferAlloc(pHGSMICtx, 60 sizeof (VBVAENABLE ),60 sizeof (VBVAENABLE_EX), 61 61 HGSMI_CH_VBVA, 62 62 VBVA_ENABLE); … … 67 67 else 68 68 { 69 VBVAENABLE *pEnable = (VBVAENABLE *)p; 70 71 pEnable->u32Flags = bEnable? VBVA_F_ENABLE: VBVA_F_DISABLE; 72 pEnable->u32Offset = pCtx->offVRAMBuffer; 73 pEnable->i32Result = VERR_NOT_SUPPORTED; 69 VBVAENABLE_EX *pEnable = (VBVAENABLE_EX *)p; 70 71 pEnable->Base.u32Flags = bEnable? VBVA_F_ENABLE: VBVA_F_DISABLE; 72 pEnable->Base.u32Offset = pCtx->offVRAMBuffer; 73 pEnable->Base.i32Result = VERR_NOT_SUPPORTED; 74 if (cScreen >= 0) 75 { 76 pEnable->Base.u32Flags |= VBVA_F_EXTENDED | VBVA_F_ABSOFFSET; 77 pEnable->u32ScreenId = cScreen; 78 } 74 79 75 80 VBoxHGSMIBufferSubmit(pHGSMICtx, p); … … 77 82 if (bEnable) 78 83 { 79 bRc = RT_SUCCESS(pEnable-> i32Result);84 bRc = RT_SUCCESS(pEnable->Base.i32Result); 80 85 } 81 86 else … … 96 101 RTDECL(bool) VBoxVBVAEnable(PVBVABUFFERCONTEXT pCtx, 97 102 PHGSMIGUESTCOMMANDCONTEXT pHGSMICtx, 98 VBVABUFFER *pVBVA )103 VBVABUFFER *pVBVA, int32_t cScreen) 99 104 { 100 105 bool bRc = false; … … 122 127 pCtx->pVBVA = pVBVA; 123 128 124 bRc = vboxVBVAInformHost(pCtx, pHGSMICtx, true);129 bRc = vboxVBVAInformHost(pCtx, pHGSMICtx, cScreen, true); 125 130 } 126 131 127 132 if (!bRc) 128 133 { 129 VBoxVBVADisable(pCtx, pHGSMICtx );134 VBoxVBVADisable(pCtx, pHGSMICtx, cScreen); 130 135 } 131 136 … … 134 139 135 140 RTDECL(void) VBoxVBVADisable(PVBVABUFFERCONTEXT pCtx, 136 PHGSMIGUESTCOMMANDCONTEXT pHGSMICtx) 141 PHGSMIGUESTCOMMANDCONTEXT pHGSMICtx, 142 int32_t cScreen) 137 143 { 138 144 LogFlowFunc(("\n")); … … 142 148 pCtx->pVBVA = NULL; 143 149 144 vboxVBVAInformHost(pCtx, pHGSMICtx, false);150 vboxVBVAInformHost(pCtx, pHGSMICtx, cScreen, false); 145 151 146 152 return; … … 374 380 375 381 return false; 382 } 383 384 RTDECL(void) VBoxVBVASetupBufferContext(PVBVABUFFERCONTEXT pCtx, 385 uint32_t offVRAMBuffer, 386 uint32_t cbBuffer) 387 { 388 pCtx->offVRAMBuffer = offVRAMBuffer; 389 pCtx->cbBuffer = cbBuffer; 376 390 } 377 391
Note:
See TracChangeset
for help on using the changeset viewer.