Changeset 22448 in vbox for trunk/src/VBox/Additions/WINNT
- Timestamp:
- Aug 25, 2009 11:12:49 PM (15 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Display/driver.h
r22440 r22448 41 41 42 42 #include <VBox/VBoxVideo.h> 43 #ifdef VBOX_WITH_VIDEOHWACCEL 44 #include <iprt/asm.h> 45 #endif 43 46 44 47 /* Forward declaration. */ … … 207 210 PFNVBOXVIDEOHGSMICOMPLETION pfnHGSMICommandComplete; /* called to complete the command we receive from the miniport */ 208 211 PFNVBOXVIDEOHGSMICOMMANDS pfnHGSMIRequestCommands; /* called to requests the commands posted to us from the host */ 212 213 PVOID pVideoPortContext; 214 VBOXVIDEOPORTPROCS VideoPortProcs; 209 215 #endif /* VBOX_WITH_HGSMI */ 210 216 … … 329 335 BOOL vboxVHWACommandSubmit (PPDEV ppdev, VBOXVHWACMD* pCmd); 330 336 void vboxVHWACommandSubmitAsynch (PPDEV ppdev, VBOXVHWACMD* pCmd, PFNVBOXVHWACMDCOMPLETION pfnCompletion, void * pContext); 331 void vboxVHWACommandSubmitAsynchByEvent (PPDEV ppdev, VBOXVHWACMD* pCmd, PEVENT pEvent);337 void vboxVHWACommandSubmitAsynchByEvent (PPDEV ppdev, VBOXVHWACMD* pCmd, VBOXPEVENT pEvent); 332 338 void vboxVHWACommandCheckHostCmds(PPDEV ppdev); 333 339 void vboxVHWACommandSubmitAsynchAndComplete (PPDEV ppdev, VBOXVHWACMD* pCmd); -
trunk/src/VBox/Additions/WINNT/Graphics/Display/screen.c
r22440 r22448 119 119 if(!err) 120 120 { 121 HGSMI HANDLERENABLE HandlerReg;122 RtlZeroMemory(& HandlerReg, sizeof(HandlerReg));121 HGSMIQUERYCPORTPROCS PortProcs; 122 RtlZeroMemory(&PortProcs, sizeof(PortProcs)); 123 123 124 124 ppdev->hMpHGSMI = Callbacks.hContext; … … 127 127 ppdev->pfnHGSMIRequestCommands = Callbacks.pfnRequestCommandsHandler; 128 128 129 HandlerReg.u8Channel = HGSMI_CH_VBVA;130 129 err = EngDeviceIoControl(ppdev->hDriver, 131 IOCTL_VIDEO_HGSMI_HANDLER_ENABLE, 132 &HandlerReg, 133 sizeof(HandlerReg), 130 IOCTL_VIDEO_HGSMI_QUERY_PORTPROCS, 134 131 NULL, 135 132 0, 133 &PortProcs, 134 sizeof(PortProcs), 136 135 &returnedDataLength); 137 136 Assert(!err); 137 if(!err) 138 { 139 HGSMIHANDLERENABLE HandlerReg; 140 RtlZeroMemory(&HandlerReg, sizeof(HandlerReg)); 141 142 ppdev->pVideoPortContext = PortProcs.pContext; 143 ppdev->VideoPortProcs = PortProcs.VideoPortProcs; 144 145 HandlerReg.u8Channel = HGSMI_CH_VBVA; 146 err = EngDeviceIoControl(ppdev->hDriver, 147 IOCTL_VIDEO_HGSMI_HANDLER_ENABLE, 148 &HandlerReg, 149 sizeof(HandlerReg), 150 NULL, 151 0, 152 &returnedDataLength); 153 Assert(!err); 154 } 138 155 } 139 156 … … 142 159 ppdev->bHGSMISupported = FALSE; 143 160 } 144 145 161 } 146 162 #endif /* VBOX_WITH_HGSMI */ -
trunk/src/VBox/Additions/WINNT/Graphics/Display/vbox.c
r22440 r22448 729 729 static DECLCALLBACK(void) vboxVHWACommandCompletionCallbackEvent(PPDEV ppdev, VBOXVHWACMD * pCmd, void * pContext) 730 730 { 731 PEVENT pEvent = (PEVENT)pContext;732 LONG oldState = EngSetEvent(pEvent);731 VBOXPEVENT pEvent = (VBOXPEVENT)pContext; 732 LONG oldState = ppdev->VideoPortProcs.pfnSetEvent(ppdev->pVideoPortContext, pEvent); 733 733 Assert(!oldState); 734 734 } … … 783 783 } 784 784 785 void vboxVHWACommandSubmitAsynchByEvent (PPDEV ppdev, VBOXVHWACMD* pCmd, PEVENT pEvent)785 void vboxVHWACommandSubmitAsynchByEvent (PPDEV ppdev, VBOXVHWACMD* pCmd, VBOXPEVENT pEvent) 786 786 { 787 787 // Assert(0); … … 798 798 { 799 799 /* the command is completed */ 800 EngSetEvent(pEvent);800 ppdev->VideoPortProcs.pfnSetEvent(ppdev->pVideoPortContext, pEvent); 801 801 } 802 802 … … 806 806 BOOL vboxVHWACommandSubmit (PPDEV ppdev, VBOXVHWACMD* pCmd) 807 807 { 808 PEVENT pEvent;809 BOOL brc = EngCreateEvent(&pEvent);810 Assert( brc);811 812 if( brc)808 VBOXPEVENT pEvent; 809 VBOXVP_STATUS rc = ppdev->VideoPortProcs.pfnCreateEvent(ppdev->pVideoPortContext, VBOXNOTIFICATION_EVENT, NULL, &pEvent); 810 Assert(rc == VBOXNO_ERROR); 811 812 if(rc == VBOXNO_ERROR) 813 813 { 814 814 pCmd->Flags |= VBOXVHWACMD_FLAG_GH_ASYNCH_IRQ; 815 815 vboxVHWACommandSubmitAsynchByEvent (ppdev, pCmd, pEvent); 816 816 817 brc = EngWaitForSingleObject(pEvent,817 rc = ppdev->VideoPortProcs.pfnWaitForSingleObject(ppdev->pVideoPortContext, pEvent, 818 818 NULL /*IN PLARGE_INTEGER pTimeOut*/ 819 819 ); 820 Assert( brc);821 if( brc)822 { 823 EngDeleteEvent(pEvent);824 } 825 } 826 return brc;820 Assert(rc == VBOXNO_ERROR); 821 if(rc == VBOXNO_ERROR) 822 { 823 ppdev->VideoPortProcs.pfnDeleteEvent(ppdev->pVideoPortContext, pEvent); 824 } 825 } 826 return rc == VBOXNO_ERROR; 827 827 } 828 828 -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp
r22446 r22448 1158 1158 1159 1159 #ifdef VBOX_WITH_HGSMI 1160 VideoPortCreateSpinLock(HwDeviceExtension, &((PDEVICE_EXTENSION)HwDeviceExtension)->u.primary.pGHRWLock); 1160 VBoxSetupVideoPortFunctions((PDEVICE_EXTENSION)HwDeviceExtension, &((PDEVICE_EXTENSION)HwDeviceExtension)->u.primary.VideoPortProcs, ConfigInfo); 1161 ((PDEVICE_EXTENSION)HwDeviceExtension)->u.primary.VideoPortProcs.pfnCreateSpinLock(HwDeviceExtension, &((PDEVICE_EXTENSION)HwDeviceExtension)->u.primary.pGHRWLock); 1161 1162 #endif 1162 1163 … … 1998 1999 break; 1999 2000 } 2001 case IOCTL_VIDEO_HGSMI_QUERY_PORTPROCS: 2002 { 2003 dprintf(("VBoxVideo::VBoxVideoStartIO: IOCTL_VIDEO_HGSMI_QUERY_PORTPROCS\n")); 2004 2005 if (RequestPacket->OutputBufferLength < sizeof(HGSMIQUERYCPORTPROCS)) 2006 { 2007 dprintf(("VBoxVideo::VBoxVideoStartIO: Output buffer too small: %d needed: %d!!!\n", 2008 RequestPacket->OutputBufferLength, sizeof(HGSMIQUERYCPORTPROCS))); 2009 RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER; 2010 return FALSE; 2011 } 2012 2013 if (!pDevExt->pPrimary->u.primary.bHGSMI) 2014 { 2015 RequestPacket->StatusBlock->Status = ERROR_INVALID_FUNCTION; 2016 return FALSE; 2017 } 2018 2019 HGSMIQUERYCPORTPROCS *pInfo = (HGSMIQUERYCPORTPROCS *)RequestPacket->OutputBuffer; 2020 pInfo->pContext = pDevExt->pPrimary; 2021 pInfo->VideoPortProcs = pDevExt->pPrimary->u.primary.VideoPortProcs; 2022 2023 RequestPacket->StatusBlock->Information = sizeof(HGSMIQUERYCPORTPROCS); 2024 Result = TRUE; 2025 break; 2026 } 2000 2027 case IOCTL_VIDEO_HGSMI_HANDLER_ENABLE: 2001 2028 { -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h
r22446 r22448 40 40 RT_C_DECLS_END 41 41 42 43 42 #define VBE_DISPI_IOPORT_INDEX 0x01CE 44 43 #define VBE_DISPI_IOPORT_DATA 0x01CF … … 151 150 /* The IO Port Number for guest commands. */ 152 151 RTIOPORT IOPortGuest; 152 153 /* Video Port API dynamically picked up at runtime for binary backwards compatibility with older NT versions */ 154 VBOXVIDEOPORTPROCS VideoPortProcs; 153 155 #endif /* VBOX_WITH_HGSMI */ 154 156 } primary; … … 296 298 { 297 299 UCHAR oldIrql; 298 VideoPortAcquireSpinLock(PrimaryExtension,300 PrimaryExtension->u.primary.VideoPortProcs.pfnAcquireSpinLock(PrimaryExtension, 299 301 PrimaryExtension->u.primary.pGHRWLock, 300 302 &oldIrql); 301 303 VBoxVideoVBEWriteUlongLocked(dataType, data); 302 VideoPortReleaseSpinLock(PrimaryExtension,304 PrimaryExtension->u.primary.VideoPortProcs.pfnReleaseSpinLock(PrimaryExtension, 303 305 PrimaryExtension->u.primary.pGHRWLock, 304 306 oldIrql); … … 308 310 { 309 311 UCHAR oldIrql; 310 VideoPortAcquireSpinLock(PrimaryExtension,312 PrimaryExtension->u.primary.VideoPortProcs.pfnAcquireSpinLock(PrimaryExtension, 311 313 PrimaryExtension->u.primary.pGHRWLock, 312 314 &oldIrql); 313 315 VBoxVideoVBEWriteUshortLocked(dataType, data); 314 VideoPortReleaseSpinLock(PrimaryExtension,316 PrimaryExtension->u.primary.VideoPortProcs.pfnReleaseSpinLock(PrimaryExtension, 315 317 PrimaryExtension->u.primary.pGHRWLock, 316 318 oldIrql); … … 321 323 ULONG data; 322 324 UCHAR oldIrql; 323 VideoPortAcquireSpinLock(PrimaryExtension,325 PrimaryExtension->u.primary.VideoPortProcs.pfnAcquireSpinLock(PrimaryExtension, 324 326 PrimaryExtension->u.primary.pGHRWLock, 325 327 &oldIrql); 326 328 data = VBoxVideoVBEReadUlongLocked(dataType); 327 VideoPortReleaseSpinLock(PrimaryExtension,329 PrimaryExtension->u.primary.VideoPortProcs.pfnReleaseSpinLock(PrimaryExtension, 328 330 PrimaryExtension->u.primary.pGHRWLock, 329 331 oldIrql); … … 355 357 356 358 BOOLEAN VBoxHGSMIIsSupported (PDEVICE_EXTENSION PrimaryExtension); 359 360 void VBoxSetupVideoPortFunctions(PDEVICE_EXTENSION PrimaryExtension, 361 VBOXVIDEOPORTPROCS *pCallbacks, 362 PVIDEO_PORT_CONFIG_INFO pConfigInfo); 357 363 358 364 VOID VBoxSetupDisplaysHGSMI (PDEVICE_EXTENSION PrimaryExtension, -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/vboxioctl.h
r22136 r22448 60 60 #define IOCTL_VIDEO_HGSMI_HANDLER_DISABLE \ 61 61 CTL_CODE(FILE_DEVICE_VIDEO, 0x433, METHOD_BUFFERED, FILE_ANY_ACCESS) 62 63 #define IOCTL_VIDEO_HGSMI_QUERY_PORTPROCS \ 64 CTL_CODE(FILE_DEVICE_VIDEO, 0x434, METHOD_BUFFERED, FILE_ANY_ACCESS) 62 65 63 66 #endif /* VBOX_WITH_HGSMI */ … … 136 139 137 140 /** 141 * Data returned by IOCTL_VIDEO_HGSMI_QUERY_PORTPROCS 142 */ 143 typedef struct _HGSMIQUERYCPORTPROCS 144 { 145 PVOID pContext; 146 VBOXVIDEOPORTPROCS VideoPortProcs; 147 } HGSMIQUERYCPORTPROCS; 148 149 /** 138 150 * Data returned by IOCTL_VIDEO_HGSMI_HANDLER_ENABLE. 139 151 *
Note:
See TracChangeset
for help on using the changeset viewer.