Changeset 34346 in vbox for trunk/src/VBox/Additions/WINNT/Graphics
- Timestamp:
- Nov 24, 2010 10:19:18 PM (14 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Miniport
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp
r34130 r34346 3382 3382 PDEVICE_EXTENSION PrimaryExtension = (PDEVICE_EXTENSION)HwDeviceExtension; 3383 3383 3384 hgsmiProcessHostCommandQueue( commonFromDeviceExt(PrimaryExtension));3384 hgsmiProcessHostCommandQueue(&commonFromDeviceExt(PrimaryExtension)->hostCtx); 3385 3385 } 3386 3386 … … 3391 3391 if (PrimaryExtension) 3392 3392 { 3393 if (commonFromDeviceExt(PrimaryExtension)-> pHostFlags) /* If HGSMI is enabled at all. */3394 { 3395 uint32_t flags = commonFromDeviceExt(PrimaryExtension)-> pHostFlags->u32HostFlags;3393 if (commonFromDeviceExt(PrimaryExtension)->hostCtx.pfHostFlags) /* If HGSMI is enabled at all. */ 3394 { 3395 uint32_t flags = commonFromDeviceExt(PrimaryExtension)->hostCtx.pfHostFlags->u32HostFlags; 3396 3396 if((flags & HGSMIHOSTFLAGS_IRQ) != 0) 3397 3397 { … … 3403 3403 } 3404 3404 /* clear the IRQ */ 3405 HGSMIClearIrq (commonFromDeviceExt(PrimaryExtension));3405 HGSMIClearIrq(&commonFromDeviceExt(PrimaryExtension)->hostCtx); 3406 3406 return TRUE; 3407 3407 } … … 3968 3968 pInfo->u32MinVBVABufferSize = VBVA_MIN_BUFFER_SIZE; 3969 3969 3970 pInfo->IOPortGuestCommand = commonFromDeviceExt(pDevExt)-> IOPortGuest;3970 pInfo->IOPortGuestCommand = commonFromDeviceExt(pDevExt)->guestCtx.port; 3971 3971 3972 3972 RequestPacket->StatusBlock->Information = sizeof(QUERYHGSMIRESULT); -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h
r34079 r34346 22 22 //#include <iprt/thread.h> 23 23 24 #include <VBox/HGSMI/HGSMI.h> 25 #include <VBox/HGSMI/HGSMIChSetup.h> 24 #include <VBox/VBoxVideoGuest.h> 26 25 #include <VBox/VBoxVideo.h> 27 26 #include "VBoxHGSMI.h" … … 69 68 * This is mapped by miniport separately. 70 69 */ 71 volatile HGSMIHOSTFLAGS * pHostFlags; /* HGSMI host flags */72 volatile bool bHostCmdProcessing;73 74 70 void *pvAdapterInformation; /* The pointer to the last 4K of VRAM. 75 71 * This is mapped by miniport separately. … … 78 74 /** Host HGSMI capabilities the guest can handle */ 79 75 uint32_t fCaps; 80 81 bool bHGSMI; /* Whether HGSMI is enabled. */ 82 83 HGSMIAREA areaHostHeap; /* Host heap VRAM area. */ 84 85 HGSMICHANNELINFO channels; 86 87 HGSMIHEAP hgsmiAdapterHeap; 88 89 /* The IO Port Number for host commands. */ 90 RTIOPORT IOPortHost; 91 92 /* The IO Port Number for guest commands. */ 93 RTIOPORT IOPortGuest; 76 /** Whether HGSMI is enabled. */ 77 bool bHGSMI; 78 /** Context information needed to receive commands from the host. */ 79 HGSMIHOSTCOMMANDCONTEXT hostCtx; 80 /** Context information needed to submit commands to the host. */ 81 HGSMIGUESTCOMMANDCONTEXT guestCtx; 94 82 } VBOXVIDEO_COMMON, *PVBOXVIDEO_COMMON; 95 83 … … 125 113 uint32_t VBoxVideoCmnPortReadUlong(RTIOPORT Port); 126 114 127 void* vboxHGSMIBufferAlloc(P VBOXVIDEO_COMMON pCommon,115 void* vboxHGSMIBufferAlloc(PHGSMIGUESTCOMMANDCONTEXT pCtx, 128 116 HGSMISIZE cbData, 129 117 uint8_t u8Ch, 130 118 uint16_t u16Op); 131 void vboxHGSMIBufferFree (PVBOXVIDEO_COMMON pCommon, void *pvBuffer);132 int vboxHGSMIBufferSubmit (PVBOXVIDEO_COMMON pCommon, void *pvBuffer);119 void vboxHGSMIBufferFree(PHGSMIGUESTCOMMANDCONTEXT pCtx, void *pvBuffer); 120 int vboxHGSMIBufferSubmit(PHGSMIGUESTCOMMANDCONTEXT pCtx, void *pvBuffer); 133 121 134 122 int VBoxMapAdapterMemory (PVBOXVIDEO_COMMON pCommon, … … 142 130 bool VBoxSyncToVideoIRQ(PVBOXVIDEO_COMMON pCommon, PFNVIDEOIRQSYNC pfnSync, 143 131 void *pvUser); 144 145 /*146 * Host and Guest port IO helpers.147 */148 DECLINLINE(void) VBoxHGSMIHostWrite(PVBOXVIDEO_COMMON pCommon, uint32_t data)149 {150 VBoxVideoCmnPortWriteUlong(pCommon->IOPortHost, data);151 }152 153 DECLINLINE(uint32_t) VBoxHGSMIHostRead(PVBOXVIDEO_COMMON pCommon)154 {155 return VBoxVideoCmnPortReadUlong(pCommon->IOPortHost);156 }157 158 DECLINLINE(void) VBoxHGSMIGuestWrite(PVBOXVIDEO_COMMON pCommon, uint32_t data)159 {160 VBoxVideoCmnPortWriteUlong(pCommon->IOPortGuest, data);161 }162 163 DECLINLINE(uint32_t) VBoxHGSMIGuestRead(PVBOXVIDEO_COMMON pCommon)164 {165 return VBoxVideoCmnPortReadUlong(pCommon->IOPortGuest);166 }167 132 168 133 bool VBoxHGSMIIsSupported (void); … … 196 161 uint8_t u8Channel); 197 162 198 void hgsmiProcessHostCommandQueue(P VBOXVIDEO_COMMON pCommon);163 void hgsmiProcessHostCommandQueue(PHGSMIHOSTCOMMANDCONTEXT pCtx); 199 164 200 void HGSMIClearIrq (PVBOXVIDEO_COMMON pCommon);165 void HGSMIClearIrq(PHGSMIHOSTCOMMANDCONTEXT pCtx); 201 166 202 167 } /* extern "C" */ -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideoHGSMI.cpp
r34090 r34346 32 32 // #include "vboxioctl.h" 33 33 34 void HGSMINotifyHostCmdComplete (PVBOXVIDEO_COMMON pCommon, HGSMIOFFSET offt) 35 { 36 VBoxHGSMIHostWrite(pCommon, offt); 37 } 38 39 void HGSMIClearIrq (PVBOXVIDEO_COMMON pCommon) 40 { 41 VBoxHGSMIHostWrite(pCommon, HGSMIOFFSET_VOID); 42 } 43 44 static void HGSMIHostCmdComplete (PVBOXVIDEO_COMMON pCommon, void * pvMem) 45 { 46 HGSMIOFFSET offMem = HGSMIPointerToOffset (&pCommon->areaHostHeap, HGSMIBufferHeaderFromData (pvMem)); 34 /** Send completion notification to the host for the command located at offset 35 * @a offt into the host command buffer. */ 36 void HGSMINotifyHostCmdComplete(PHGSMIHOSTCOMMANDCONTEXT pCtx, HGSMIOFFSET offt) 37 { 38 VBoxVideoCmnPortWriteUlong(pCtx->port, offt); 39 } 40 41 /** Acknowlege an IRQ. */ 42 void HGSMIClearIrq(PHGSMIHOSTCOMMANDCONTEXT pCtx) 43 { 44 VBoxVideoCmnPortWriteUlong(pCtx->port, HGSMIOFFSET_VOID); 45 } 46 47 /** Inform the host that a command has been handled. */ 48 static void HGSMIHostCmdComplete(PHGSMIHOSTCOMMANDCONTEXT pCtx, void * pvMem) 49 { 50 HGSMIBUFFERHEADER *pHdr = HGSMIBufferHeaderFromData(pvMem); 51 HGSMIOFFSET offMem = HGSMIPointerToOffset(&pCtx->areaCtx, pHdr); 47 52 Assert(offMem != HGSMIOFFSET_VOID); 48 53 if(offMem != HGSMIOFFSET_VOID) 49 54 { 50 HGSMINotifyHostCmdComplete (pCommon, offMem);51 } 52 } 53 54 static void hgsmiHostCmdProcess(PVBOXVIDEO_COMMON pCommon, HGSMIOFFSET offBuffer) 55 { 56 int rc = HGSMIBufferProcess (&pCommon->areaHostHeap,57 &pCommon->channels, 58 55 HGSMINotifyHostCmdComplete(pCtx, offMem); 56 } 57 } 58 59 /** Submit an incoming host command to the appropriate handler. */ 60 static void hgsmiHostCmdProcess(PHGSMIHOSTCOMMANDCONTEXT pCtx, 61 HGSMIOFFSET offBuffer) 62 { 63 int rc = HGSMIBufferProcess(&pCtx->areaCtx, &pCtx->channels, offBuffer); 59 64 Assert(!RT_FAILURE(rc)); 60 65 if(RT_FAILURE(rc)) … … 62 67 /* failure means the command was not submitted to the handler for some reason 63 68 * it's our responsibility to notify its completion in this case */ 64 HGSMINotifyHostCmdComplete(pC ommon, offBuffer);69 HGSMINotifyHostCmdComplete(pCtx, offBuffer); 65 70 } 66 71 /* if the cmd succeeded it's responsibility of the callback to complete it */ 67 72 } 68 73 69 static HGSMIOFFSET hgsmiGetHostBuffer (PVBOXVIDEO_COMMON pCommon) 70 { 71 return VBoxHGSMIHostRead(pCommon); 72 } 73 74 static void hgsmiHostCommandQueryProcess (PVBOXVIDEO_COMMON pCommon) 75 { 76 HGSMIOFFSET offset = hgsmiGetHostBuffer (pCommon); 77 Assert(offset != HGSMIOFFSET_VOID); 78 if(offset != HGSMIOFFSET_VOID)79 {80 hgsmiHostCmdProcess(pCommon, offset);81 82 } 83 84 void hgsmiProcessHostCommandQueue(P VBOXVIDEO_COMMON pCommon)85 { 86 while (pC ommon->pHostFlags->u32HostFlags & HGSMIHOSTFLAGS_COMMANDS_PENDING)87 { 88 if (!ASMAtomicCmpXchgBool(&pC ommon->bHostCmdProcessing, true, false))74 /** Get the next command from the host. */ 75 static HGSMIOFFSET hgsmiGetHostBuffer(PHGSMIHOSTCOMMANDCONTEXT pCtx) 76 { 77 return VBoxVideoCmnPortReadUlong(pCtx->port); 78 } 79 80 /** Get and handle the next command from the host. */ 81 static void hgsmiHostCommandQueryProcess(PHGSMIHOSTCOMMANDCONTEXT pCtx) 82 { 83 HGSMIOFFSET offset = hgsmiGetHostBuffer(pCtx); 84 AssertReturnVoid(offset != HGSMIOFFSET_VOID); 85 hgsmiHostCmdProcess(pCtx, offset); 86 } 87 88 /** Drain the host command queue. */ 89 void hgsmiProcessHostCommandQueue(PHGSMIHOSTCOMMANDCONTEXT pCtx) 90 { 91 while (pCtx->pfHostFlags->u32HostFlags & HGSMIHOSTFLAGS_COMMANDS_PENDING) 92 { 93 if (!ASMAtomicCmpXchgBool(&pCtx->fHostCmdProcessing, true, false)) 89 94 return; 90 hgsmiHostCommandQueryProcess(pC ommon);91 ASMAtomicWriteBool(&pC ommon->bHostCmdProcessing, false);92 } 93 } 94 95 /* Detect whether HGSMI is supported by the host. */95 hgsmiHostCommandQueryProcess(pCtx); 96 ASMAtomicWriteBool(&pCtx->fHostCmdProcessing, false); 97 } 98 } 99 100 /** Detect whether HGSMI is supported by the host. */ 96 101 bool VBoxHGSMIIsSupported (void) 97 102 { … … 112 117 typedef FNHGSMICALLFINALIZE *PFNHGSMICALLFINALIZE; 113 118 114 void* vboxHGSMIBufferAlloc(P VBOXVIDEO_COMMON pCommon,119 void* vboxHGSMIBufferAlloc(PHGSMIGUESTCOMMANDCONTEXT pCtx, 115 120 HGSMISIZE cbData, 116 121 uint8_t u8Ch, … … 120 125 /* @todo: add synchronization */ 121 126 #endif 122 return HGSMIHeapAlloc (&pC ommon->hgsmiAdapterHeap, cbData, u8Ch, u16Op);123 } 124 125 void vboxHGSMIBufferFree (PVBOXVIDEO_COMMON pCommon, void *pvBuffer)127 return HGSMIHeapAlloc (&pCtx->heapCtx, cbData, u8Ch, u16Op); 128 } 129 130 void vboxHGSMIBufferFree(PHGSMIGUESTCOMMANDCONTEXT pCtx, void *pvBuffer) 126 131 { 127 132 #ifdef VBOX_WITH_WDDM 128 133 /* @todo: add synchronization */ 129 134 #endif 130 HGSMIHeapFree (&pC ommon->hgsmiAdapterHeap, pvBuffer);131 } 132 133 int vboxHGSMIBufferSubmit (PVBOXVIDEO_COMMON pCommon, void *pvBuffer)135 HGSMIHeapFree (&pCtx->heapCtx, pvBuffer); 136 } 137 138 int vboxHGSMIBufferSubmit(PHGSMIGUESTCOMMANDCONTEXT pCtx, void *pvBuffer) 134 139 { 135 140 /* Initialize the buffer and get the offset for port IO. */ 136 HGSMIOFFSET offBuffer = HGSMIHeapBufferOffset (&pC ommon->hgsmiAdapterHeap, pvBuffer);141 HGSMIOFFSET offBuffer = HGSMIHeapBufferOffset (&pCtx->heapCtx, pvBuffer); 137 142 138 143 Assert(offBuffer != HGSMIOFFSET_VOID); … … 140 145 { 141 146 /* Submit the buffer to the host. */ 142 VBox HGSMIGuestWrite(pCommon, offBuffer);147 VBoxVideoCmnPortWriteUlong(pCtx->port, offBuffer); 143 148 return VINF_SUCCESS; 144 149 } … … 158 163 159 164 /* Allocate the IO buffer. */ 160 void *p = HGSMIHeapAlloc (&pCommon-> hgsmiAdapterHeap, cbData, u8Ch, u16Op);165 void *p = HGSMIHeapAlloc (&pCommon->guestCtx.heapCtx, cbData, u8Ch, u16Op); 161 166 162 167 if (!p) … … 174 179 if (RT_SUCCESS (rc)) 175 180 { 176 /* Initialize the buffer and get the offset for port IO. */ 177 HGSMIOFFSET offBuffer = HGSMIHeapBufferOffset (&pCommon->hgsmiAdapterHeap, 178 p); 179 180 /* Submit the buffer to the host. */ 181 VBoxHGSMIGuestWrite(pCommon, offBuffer); 182 183 if (pfnFinalize) 181 rc = vboxHGSMIBufferSubmit(&pCommon->guestCtx, p); 182 183 if (RT_SUCCESS(rc) && pfnFinalize) 184 184 { 185 185 rc = pfnFinalize (pCommon, pvContext, p); … … 193 193 194 194 /* Free the IO buffer. */ 195 HGSMIHeapFree (&pCommon-> hgsmiAdapterHeap, p);195 HGSMIHeapFree (&pCommon->guestCtx.heapCtx, p); 196 196 } 197 197 … … 271 271 int rc; 272 272 /* Issue the screen info command. */ 273 void *p = vboxHGSMIBufferAlloc (pCommon, sizeof(VBVAINFOVIEW) * u32Count,273 void *p = vboxHGSMIBufferAlloc(&pCommon->guestCtx, sizeof(VBVAINFOVIEW) * u32Count, 274 274 HGSMI_CH_VBVA, VBVA_INFO_VIEW); 275 275 Assert(p); … … 279 279 rc = pfnFill(pvData, pInfo); 280 280 if (RT_SUCCESS(rc)) 281 vboxHGSMIBufferSubmit ( pCommon, p);282 vboxHGSMIBufferFree ( pCommon, p);281 vboxHGSMIBufferSubmit (&pCommon->guestCtx, p); 282 vboxHGSMIBufferFree (&pCommon->guestCtx, p); 283 283 } 284 284 else … … 403 403 /** @note (michael) moved this here as it is done unconditionally in both 404 404 * driver branches. Feel free to fix if that is ever changed. */ 405 pCommon-> IOPortHost = (RTIOPORT)VGA_PORT_HGSMI_HOST;406 pCommon-> IOPortGuest = (RTIOPORT)VGA_PORT_HGSMI_GUEST;405 pCommon->hostCtx.port = (RTIOPORT)VGA_PORT_HGSMI_HOST; 406 pCommon->guestCtx.port = (RTIOPORT)VGA_PORT_HGSMI_GUEST; 407 407 408 408 /* Map the adapter information. It will be needed for HGSMI IO. */ … … 423 423 { 424 424 /* Setup a HGSMI heap within the adapter information area. */ 425 rc = HGSMIHeapSetup (&pCommon-> hgsmiAdapterHeap,425 rc = HGSMIHeapSetup (&pCommon->guestCtx.heapCtx, 426 426 pCommon->pvAdapterInformation, 427 427 VBVA_ADAPTER_INFORMATION_SIZE - sizeof(HGSMIHOSTFLAGS), … … 438 438 else 439 439 { 440 pCommon-> pHostFlags = (HGSMIHOSTFLAGS*)(((uint8_t*)pCommon->pvAdapterInformation)440 pCommon->hostCtx.pfHostFlags = (HGSMIHOSTFLAGS*)(((uint8_t*)pCommon->pvAdapterInformation) 441 441 + VBVA_ADAPTER_INFORMATION_SIZE - sizeof(HGSMIHOSTFLAGS)); 442 442 } … … 497 497 498 498 /* Init the host hap area. Buffers from the host will be placed there. */ 499 HGSMIAreaInitialize (&pCommon-> areaHostHeap,499 HGSMIAreaInitialize (&pCommon->hostCtx.areaCtx, 500 500 pCommon->pvMiniportHeap, 501 501 pCommon->cbMiniportHeap, … … 550 550 PVBOXVIDEO_COMMON pCommon = (PVBOXVIDEO_COMMON)pvCommon; 551 551 552 pCommon-> pHostFlags = NULL;552 pCommon->hostCtx.pfHostFlags = NULL; 553 553 return true; 554 554 } … … 557 557 { 558 558 VBoxUnmapAdapterMemory(pCommon, &pCommon->pvMiniportHeap); 559 HGSMIHeapDestroy(&pCommon-> hgsmiAdapterHeap);559 HGSMIHeapDestroy(&pCommon->guestCtx.heapCtx); 560 560 561 561 /* Unmap the adapter information needed for HGSMI IO. */ … … 734 734 DECLCALLBACK(void) hgsmiHostCmdComplete (HVBOXVIDEOHGSMI hHGSMI, struct _VBVAHOSTCMD * pCmd) 735 735 { 736 P VBOXVIDEO_COMMON pCommon = (PVBOXVIDEO_COMMON)hHGSMI;737 HGSMIHostCmdComplete (pCommon, pCmd);736 PHGSMIHOSTCOMMANDCONTEXT pCtx = &((PVBOXVIDEO_COMMON)hHGSMI)->hostCtx; 737 HGSMIHostCmdComplete(pCtx, pCmd); 738 738 } 739 739 … … 759 759 return VERR_INVALID_PARAMETER; 760 760 761 P VBOXVIDEO_COMMON pCommon = (PVBOXVIDEO_COMMON)hHGSMI;761 PHGSMIHOSTCOMMANDCONTEXT pCtx = &((PVBOXVIDEO_COMMON)hHGSMI)->hostCtx; 762 762 763 763 /* pick up the host commands */ 764 hgsmiProcessHostCommandQueue(pC ommon);765 766 HGSMICHANNEL * pChannel = HGSMIChannelFindById (&pCommon->channels, u8Channel);764 hgsmiProcessHostCommandQueue(pCtx); 765 766 HGSMICHANNEL *pChannel = HGSMIChannelFindById (&pCtx->channels, u8Channel); 767 767 if(pChannel) 768 768 { … … 855 855 Assert(!pCur->u.pNext); 856 856 #endif 857 HGSMIHostCmdComplete( pCallbacks->pCommon, pCur);857 HGSMIHostCmdComplete(&pCallbacks->pCommon->hostCtx, pCur); 858 858 #if 0 /* pNext is NULL, and the other things have already been asserted */ 859 859 pCur = pNext; … … 907 907 } 908 908 /* no handlers were found, need to complete the command here */ 909 HGSMIHostCmdComplete( pCallbacks->pCommon, pvBuffer);909 HGSMIHostCmdComplete(&pCallbacks->pCommon->hostCtx, pvBuffer); 910 910 return VINF_SUCCESS; 911 911 } … … 918 918 { 919 919 VBVA_CHANNELCONTEXTS * pContexts; 920 HGSMICHANNEL * pChannel = HGSMIChannelFindById (&pCommon-> channels, u8Channel);920 HGSMICHANNEL * pChannel = HGSMIChannelFindById (&pCommon->hostCtx.channels, u8Channel); 921 921 if(!pChannel) 922 922 { … … 948 948 if(!pChannel) 949 949 { 950 rc = HGSMIChannelRegister (&pCommon-> channels,950 rc = HGSMIChannelRegister (&pCommon->hostCtx.channels, 951 951 u8Channel, 952 952 "VGA Miniport HGSMI channel", -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVbva.cpp
r34079 r34346 22 22 { 23 23 int rc = VERR_NO_MEMORY; 24 void *p = vboxHGSMIBufferAlloc ( commonFromDeviceExt(pDevExt),24 void *p = vboxHGSMIBufferAlloc (&commonFromDeviceExt(pDevExt)->guestCtx, 25 25 sizeof (VBVAENABLE_EX), 26 26 HGSMI_CH_VBVA, … … 43 43 pEnable->i32Result = VERR_NOT_SUPPORTED; 44 44 45 vboxHGSMIBufferSubmit ( commonFromDeviceExt(pDevExt), p);45 vboxHGSMIBufferSubmit (&commonFromDeviceExt(pDevExt)->guestCtx, p); 46 46 47 47 if (bEnable) … … 53 53 rc = VINF_SUCCESS; 54 54 55 vboxHGSMIBufferFree ( commonFromDeviceExt(pDevExt), p);55 vboxHGSMIBufferFree (&commonFromDeviceExt(pDevExt)->guestCtx, p); 56 56 } 57 57 return rc; … … 143 143 { 144 144 /* Issue the flush command. */ 145 void *p = vboxHGSMIBufferAlloc ( commonFromDeviceExt(pDevExt),145 void *p = vboxHGSMIBufferAlloc (&commonFromDeviceExt(pDevExt)->guestCtx, 146 146 sizeof (VBVAFLUSH), 147 147 HGSMI_CH_VBVA, … … 158 158 pFlush->u32Reserved = 0; 159 159 160 vboxHGSMIBufferSubmit ( commonFromDeviceExt(pDevExt), p);161 162 vboxHGSMIBufferFree ( commonFromDeviceExt(pDevExt), p);160 vboxHGSMIBufferSubmit (&commonFromDeviceExt(pDevExt)->guestCtx, p); 161 162 vboxHGSMIBufferFree (&commonFromDeviceExt(pDevExt)->guestCtx, p); 163 163 } 164 164 -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVdma.cpp
r34345 r34346 1030 1030 static int vboxWddmVdmaSubmitHgsmi(struct _DEVICE_EXTENSION* pDevExt, PVBOXVDMAINFO pInfo, HGSMIOFFSET offDr) 1031 1031 { 1032 VBox HGSMIGuestWrite(commonFromDeviceExt(pDevExt), offDr);1032 VBoxVideoCmnPortWriteUlong(commonFromDeviceExt(pDevExt)->guestCtx.port, offDr); 1033 1033 return VINF_SUCCESS; 1034 1034 } … … 1040 1040 int rc = VINF_SUCCESS; 1041 1041 1042 PVBOXVDMA_CTL pCmd = (PVBOXVDMA_CTL)VBoxSHGSMICommandAlloc(&commonFromDeviceExt(pDevExt)-> hgsmiAdapterHeap, sizeof (VBOXVDMA_CTL), HGSMI_CH_VBVA, VBVA_VDMA_CTL);1042 PVBOXVDMA_CTL pCmd = (PVBOXVDMA_CTL)VBoxSHGSMICommandAlloc(&commonFromDeviceExt(pDevExt)->guestCtx.heapCtx, sizeof (VBOXVDMA_CTL), HGSMI_CH_VBVA, VBVA_VDMA_CTL); 1043 1043 if (pCmd) 1044 1044 { … … 1047 1047 pCmd->i32Result = VERR_NOT_SUPPORTED; 1048 1048 1049 const VBOXSHGSMIHEADER* pHdr = VBoxSHGSMICommandPrepSynch(&commonFromDeviceExt(pDevExt)-> hgsmiAdapterHeap, pCmd);1049 const VBOXSHGSMIHEADER* pHdr = VBoxSHGSMICommandPrepSynch(&commonFromDeviceExt(pDevExt)->guestCtx.heapCtx, pCmd); 1050 1050 Assert(pHdr); 1051 1051 if (pHdr) … … 1053 1053 do 1054 1054 { 1055 HGSMIOFFSET offCmd = VBoxSHGSMICommandOffset(&commonFromDeviceExt(pDevExt)-> hgsmiAdapterHeap, pHdr);1055 HGSMIOFFSET offCmd = VBoxSHGSMICommandOffset(&commonFromDeviceExt(pDevExt)->guestCtx.heapCtx, pHdr); 1056 1056 Assert(offCmd != HGSMIOFFSET_VOID); 1057 1057 if (offCmd != HGSMIOFFSET_VOID) … … 1061 1061 if (RT_SUCCESS(rc)) 1062 1062 { 1063 rc = VBoxSHGSMICommandDoneSynch(&commonFromDeviceExt(pDevExt)-> hgsmiAdapterHeap, pHdr);1063 rc = VBoxSHGSMICommandDoneSynch(&commonFromDeviceExt(pDevExt)->guestCtx.heapCtx, pHdr); 1064 1064 AssertRC(rc); 1065 1065 if (RT_SUCCESS(rc)) … … 1074 1074 rc = VERR_INVALID_PARAMETER; 1075 1075 /* fail to submit, cancel it */ 1076 VBoxSHGSMICommandCancelSynch(&commonFromDeviceExt(pDevExt)-> hgsmiAdapterHeap, pHdr);1076 VBoxSHGSMICommandCancelSynch(&commonFromDeviceExt(pDevExt)->guestCtx.heapCtx, pHdr); 1077 1077 } while (0); 1078 1078 } 1079 1079 1080 VBoxSHGSMICommandFree (&commonFromDeviceExt(pDevExt)-> hgsmiAdapterHeap, pCmd);1080 VBoxSHGSMICommandFree (&commonFromDeviceExt(pDevExt)->guestCtx.heapCtx, pCmd); 1081 1081 } 1082 1082 else -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoVhwa.cpp
r34129 r34346 45 45 if(!cRefs) 46 46 { 47 vboxHGSMIBufferFree( commonFromDeviceExt(pDevExt), pCmd);47 vboxHGSMIBufferFree(&commonFromDeviceExt(pDevExt)->guestCtx, pCmd); 48 48 } 49 49 } … … 61 61 vbvaVhwaCommandRetain(pDevExt, pCmd); 62 62 63 vboxHGSMIBufferSubmit( commonFromDeviceExt(pDevExt), pCmd);63 vboxHGSMIBufferSubmit(&commonFromDeviceExt(pDevExt)->guestCtx, pCmd); 64 64 65 65 if(!(pCmd->Flags & VBOXVHWACMD_FLAG_HG_ASYNCH) … … 100 100 VBVA_VHWA_CMD); 101 101 #else 102 VBOXVHWACMD* pHdr = (VBOXVHWACMD*)vboxHGSMIBufferAlloc( commonFromDeviceExt(pDevExt),102 VBOXVHWACMD* pHdr = (VBOXVHWACMD*)vboxHGSMIBufferAlloc(&commonFromDeviceExt(pDevExt)->guestCtx, 103 103 cbCmd + VBOXVHWACMD_HEADSIZE(), 104 104 HGSMI_CH_VBVA, -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/wddm/VBoxVideoWddm.cpp
r34130 r34346 120 120 NTSTATUS vboxWddmGhDisplayPostInfoScreenBySDesc (PDEVICE_EXTENSION pDevExt, PVBOXWDDM_SURFACE_DESC pDesc, POINT * pVScreenPos, uint16_t fFlags) 121 121 { 122 void *p = vboxHGSMIBufferAlloc ( commonFromDeviceExt(pDevExt),122 void *p = vboxHGSMIBufferAlloc (&commonFromDeviceExt(pDevExt)->guestCtx, 123 123 sizeof (VBVAINFOSCREEN), 124 124 HGSMI_CH_VBVA, … … 139 139 pScreen->u16Flags = fFlags; 140 140 141 vboxHGSMIBufferSubmit ( commonFromDeviceExt(pDevExt), p);142 143 vboxHGSMIBufferFree ( commonFromDeviceExt(pDevExt), p);141 vboxHGSMIBufferSubmit (&commonFromDeviceExt(pDevExt)->guestCtx, p); 142 143 vboxHGSMIBufferFree (&commonFromDeviceExt(pDevExt)->guestCtx, p); 144 144 } 145 145 … … 163 163 164 164 /* Issue the screen info command. */ 165 void *p = vboxHGSMIBufferAlloc ( commonFromDeviceExt(pDevExt),165 void *p = vboxHGSMIBufferAlloc (&commonFromDeviceExt(pDevExt)->guestCtx, 166 166 sizeof (VBVAINFOVIEW), 167 167 HGSMI_CH_VBVA, … … 178 178 pView->u32MaxScreenSize = pView->u32ViewSize; 179 179 180 vboxHGSMIBufferSubmit ( commonFromDeviceExt(pDevExt), p);181 182 vboxHGSMIBufferFree ( commonFromDeviceExt(pDevExt), p);180 vboxHGSMIBufferSubmit (&commonFromDeviceExt(pDevExt)->guestCtx, p); 181 182 vboxHGSMIBufferFree (&commonFromDeviceExt(pDevExt)->guestCtx, p); 183 183 } 184 184 … … 281 281 return &pDevExt->u.primary.Vdma.CmdHeap; 282 282 #endif 283 if (HGSMIAreaContainsOffset(&commonFromDeviceExt(pDevExt)-> hgsmiAdapterHeap.area, offCmd))284 return &commonFromDeviceExt(pDevExt)-> hgsmiAdapterHeap;283 if (HGSMIAreaContainsOffset(&commonFromDeviceExt(pDevExt)->guestCtx.heapCtx.area, offCmd)) 284 return &commonFromDeviceExt(pDevExt)->guestCtx.heapCtx; 285 285 return NULL; 286 286 } … … 301 301 return VBOXWDDM_HGSMICMD_TYPE_DMACMD; 302 302 #endif 303 if (HGSMIAreaContainsOffset(&commonFromDeviceExt(pDevExt)-> hgsmiAdapterHeap.area, offCmd))303 if (HGSMIAreaContainsOffset(&commonFromDeviceExt(pDevExt)->guestCtx.heapCtx.area, offCmd)) 304 304 return VBOXWDDM_HGSMICMD_TYPE_CTL; 305 305 return VBOXWDDM_HGSMICMD_TYPE_UNDEFINED; … … 834 834 BOOLEAN bOur = FALSE; 835 835 BOOLEAN bNeedDpc = FALSE; 836 if (commonFromDeviceExt(pDevExt)-> pHostFlags) /* If HGSMI is enabled at all. */836 if (commonFromDeviceExt(pDevExt)->hostCtx.pfHostFlags) /* If HGSMI is enabled at all. */ 837 837 { 838 838 VBOXSHGSMILIST CtlList; … … 850 850 #endif 851 851 852 uint32_t flags = commonFromDeviceExt(pDevExt)-> pHostFlags->u32HostFlags;852 uint32_t flags = commonFromDeviceExt(pDevExt)->hostCtx.pfHostFlags->u32HostFlags; 853 853 bOur = (flags & HGSMIHOSTFLAGS_IRQ); 854 854 do … … 857 857 { 858 858 /* read the command offset */ 859 HGSMIOFFSET offCmd = VBox HGSMIGuestRead(commonFromDeviceExt(pDevExt));859 HGSMIOFFSET offCmd = VBoxVideoCmnPortReadUlong(commonFromDeviceExt(pDevExt)->guestCtx.port); 860 860 Assert(offCmd != HGSMIOFFSET_VOID); 861 861 if (offCmd != HGSMIOFFSET_VOID) … … 874 874 case VBOXWDDM_HGSMICMD_TYPE_CTL: 875 875 pList = &CtlList; 876 pHeap = &commonFromDeviceExt(pDevExt)-> hgsmiAdapterHeap;876 pHeap = &commonFromDeviceExt(pDevExt)->guestCtx.heapCtx; 877 877 break; 878 878 default: … … 920 920 break; 921 921 922 flags = commonFromDeviceExt(pDevExt)-> pHostFlags->u32HostFlags;922 flags = commonFromDeviceExt(pDevExt)->hostCtx.pfHostFlags->u32HostFlags; 923 923 } while (1); 924 924 … … 953 953 if (bOur) 954 954 { 955 HGSMIClearIrq (commonFromDeviceExt(pDevExt));955 HGSMIClearIrq(&commonFromDeviceExt(pDevExt)->hostCtx); 956 956 #ifdef DEBUG_misha 957 957 /* this is not entirely correct since host may concurrently complete some commands and raise a new IRQ while we are here, 958 958 * still this allows to check that the host flags are correctly cleared after the ISR */ 959 Assert(commonFromDeviceExt(pDevExt)-> pHostFlags);960 uint32_t flags = commonFromDeviceExt(pDevExt)-> pHostFlags->u32HostFlags;959 Assert(commonFromDeviceExt(pDevExt)->HostCtx.pfHostFlags); 960 uint32_t flags = commonFromDeviceExt(pDevExt)->HostCtx.pfHostFlags->u32HostFlags; 961 961 Assert(flags == 0); 962 962 #endif … … 1041 1041 if (!vboxSHGSMIListIsEmpty(&context.data.CtlList)) 1042 1042 { 1043 int rc = VBoxSHGSMICommandPostprocessCompletion (&commonFromDeviceExt(pDevExt)-> hgsmiAdapterHeap, &context.data.CtlList);1043 int rc = VBoxSHGSMICommandPostprocessCompletion (&commonFromDeviceExt(pDevExt)->guestCtx.heapCtx, &context.data.CtlList); 1044 1044 AssertRC(rc); 1045 1045 }
Note:
See TracChangeset
for help on using the changeset viewer.