Changeset 33890 in vbox for trunk/src/VBox/Additions/WINNT/Graphics
- Timestamp:
- Nov 9, 2010 11:20:54 AM (14 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Display/vbox.c
r33048 r33890 480 480 { 481 481 VBVAHOSTCMD * pCmd, * pNextCmd; 482 int rc = ppdev->pfnHGSMIRequestCommands(ppdev->hMpHGSMI, HGSMI_CH_VBVA, &pCmd);482 int rc = ppdev->pfnHGSMIRequestCommands(ppdev->hMpHGSMI, HGSMI_CH_VBVA, ppdev->iDevice, &pCmd); 483 483 /* don't assert here, otherwise NT4 will be unhappy */ 484 484 if(RT_SUCCESS(rc)) -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxHGSMI.h
r33540 r33890 26 26 27 27 /* request the host commands addressed to the display */ 28 typedef DECLCALLBACK(int) FNVBOXVIDEOHGSMICOMMANDS(HVBOXVIDEOHGSMI hHGSMI, uint8_t u8Channel, struct _VBVAHOSTCMD ** ppCmd);28 typedef DECLCALLBACK(int) FNVBOXVIDEOHGSMICOMMANDS(HVBOXVIDEOHGSMI hHGSMI, uint8_t u8Channel, uint32_t iDevice, struct _VBVAHOSTCMD ** ppCmd); 29 29 typedef FNVBOXVIDEOHGSMICOMMANDS *PFNVBOXVIDEOHGSMICOMMANDS; 30 30 -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp
r33879 r33890 3578 3578 HGSMIQUERYCALLBACKS *pInfo = (HGSMIQUERYCALLBACKS *)RequestPacket->OutputBuffer; 3579 3579 3580 pInfo->hContext = pDevExt;3580 pInfo->hContext = commonFromDeviceExt(pDevExt); 3581 3581 pInfo->pfnCompletionHandler = hgsmiHostCmdComplete; 3582 3582 pInfo->pfnRequestCommandsHandler = hgsmiHostCmdRequest; … … 3632 3632 HGSMIHANDLERENABLE *pInfo = (HGSMIHANDLERENABLE *)RequestPacket->InputBuffer; 3633 3633 3634 int rc = vboxVBVAChannelDisplayEnable( pDevExt->pPrimary,3634 int rc = vboxVBVAChannelDisplayEnable(commonFromDeviceExt(pDevExt), 3635 3635 pDevExt->iDevice, 3636 3636 pInfo->u8Channel); -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.h
r33876 r33890 691 691 #ifndef VBOX_WITH_WDDM 692 692 DECLCALLBACK(void) hgsmiHostCmdComplete (HVBOXVIDEOHGSMI hHGSMI, struct _VBVAHOSTCMD * pCmd); 693 DECLCALLBACK(int) hgsmiHostCmdRequest (HVBOXVIDEOHGSMI hHGSMI, uint8_t u8Channel, struct _VBVAHOSTCMD ** ppCmd);694 #endif 695 696 697 int vboxVBVAChannelDisplayEnable(P DEVICE_EXTENSION PrimaryExtension,693 DECLCALLBACK(int) hgsmiHostCmdRequest (HVBOXVIDEOHGSMI hHGSMI, uint8_t u8Channel, uint32_t iDisplay, struct _VBVAHOSTCMD ** ppCmd); 694 #endif 695 696 697 int vboxVBVAChannelDisplayEnable(PVBOXVIDEO_COMMON pCommon, 698 698 int iDisplay, /* negative would mean this is a miniport handler */ 699 699 uint8_t u8Channel); -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideoHGSMI.cpp
r33876 r33890 689 689 } 690 690 691 void dbgCheckList(P DEVICE_EXTENSION PrimaryExtension, VBVADISP_CHANNELCONTEXT *pList, struct _VBVAHOSTCMD * pCmd)691 void dbgCheckList(PVBOXVIDEO_COMMON pCommon, VBVADISP_CHANNELCONTEXT *pList, struct _VBVAHOSTCMD * pCmd) 692 692 { 693 693 VBOXVCMNIRQL oldIrql; 694 VBoxVideoCmnSpinLockAcquire( PrimaryExtension, &pList->pSynchLock, &oldIrql);694 VBoxVideoCmnSpinLockAcquire(commonToPrimaryExt(pCommon), &pList->pSynchLock, &oldIrql); 695 695 696 696 dbgCheckListLocked(pList, pCmd); 697 697 698 VBoxVideoCmnSpinLockRelease( PrimaryExtension, &pList->pSynchLock, oldIrql);698 VBoxVideoCmnSpinLockRelease(commonToPrimaryExt(pCommon), &pList->pSynchLock, oldIrql); 699 699 } 700 700 701 701 #define DBG_CHECKLIST_LOCKED(_pl, pc) dbgCheckListLocked(_pl, pc) 702 #define DBG_CHECKLIST(_p e, _pl, pc) dbgCheckList(_pe, _pl, pc)702 #define DBG_CHECKLIST(_pv, _pl, pc) dbgCheckList(_pv, _pl, pc) 703 703 704 704 #else 705 705 #define DBG_CHECKLIST_LOCKED(_pl, pc) do{}while(0) 706 #define DBG_CHECKLIST(_p e, _pl, pc) do{}while(0)706 #define DBG_CHECKLIST(_pv, _pl, pc) do{}while(0) 707 707 #endif 708 708 … … 710 710 typedef struct _VBVA_CHANNELCONTEXTS 711 711 { 712 P DEVICE_EXTENSION PrimaryExtension;712 PVBOXVIDEO_COMMON pCommon; 713 713 uint32_t cUsed; 714 714 uint32_t cContexts; … … 724 724 } 725 725 726 static int vboxVBVACreateChannelContexts(P DEVICE_EXTENSION PrimaryExtension, VBVA_CHANNELCONTEXTS ** ppContext)727 { 728 uint32_t cDisplays = (uint32_t) commonFromDeviceExt(PrimaryExtension)->cDisplays;726 static int vboxVBVACreateChannelContexts(PVBOXVIDEO_COMMON pCommon, VBVA_CHANNELCONTEXTS ** ppContext) 727 { 728 uint32_t cDisplays = (uint32_t)pCommon->cDisplays; 729 729 const size_t size = RT_OFFSETOF(VBVA_CHANNELCONTEXTS, aContexts[cDisplays]); 730 VBVA_CHANNELCONTEXTS * pContext = (VBVA_CHANNELCONTEXTS*)VBoxVideoCmnMemAllocDriver( commonFromDeviceExt(PrimaryExtension), size);730 VBVA_CHANNELCONTEXTS * pContext = (VBVA_CHANNELCONTEXTS*)VBoxVideoCmnMemAllocDriver(pCommon, size); 731 731 if(pContext) 732 732 { 733 733 memset(pContext, 0, size); 734 734 pContext->cContexts = cDisplays; 735 pContext-> PrimaryExtension = PrimaryExtension;735 pContext->pCommon = pCommon; 736 736 *ppContext = pContext; 737 737 return VINF_SUCCESS; … … 755 755 DECLCALLBACK(void) hgsmiHostCmdComplete (HVBOXVIDEOHGSMI hHGSMI, struct _VBVAHOSTCMD * pCmd) 756 756 { 757 P DEVICE_EXTENSION PrimaryExtension = ((PDEVICE_EXTENSION)hHGSMI)->pPrimary;758 HGSMIHostCmdComplete ( commonFromDeviceExt(PrimaryExtension), pCmd);759 } 760 761 DECLCALLBACK(int) hgsmiHostCmdRequest (HVBOXVIDEOHGSMI hHGSMI, uint8_t u8Channel, struct _VBVAHOSTCMD ** ppCmd)757 PVBOXVIDEO_COMMON pCommon = (PVBOXVIDEO_COMMON)hHGSMI; 758 HGSMIHostCmdComplete (pCommon, pCmd); 759 } 760 761 DECLCALLBACK(int) hgsmiHostCmdRequest (HVBOXVIDEOHGSMI hHGSMI, uint8_t u8Channel, uint32_t iDevice, struct _VBVAHOSTCMD ** ppCmd) 762 762 { 763 763 // if(display < 0) … … 766 766 return VERR_INVALID_PARAMETER; 767 767 768 PDEVICE_EXTENSION pDevExt = (PDEVICE_EXTENSION)hHGSMI; 769 PDEVICE_EXTENSION PrimaryExtension = pDevExt->pPrimary; 768 PVBOXVIDEO_COMMON pCommon = (PVBOXVIDEO_COMMON)hHGSMI; 770 769 771 770 /* pick up the host commands */ 772 hgsmiProcessHostCommandQueue( commonFromDeviceExt(PrimaryExtension));773 774 HGSMICHANNEL * pChannel = HGSMIChannelFindById (& commonFromDeviceExt(PrimaryExtension)->channels, u8Channel);771 hgsmiProcessHostCommandQueue(pCommon); 772 773 HGSMICHANNEL * pChannel = HGSMIChannelFindById (&pCommon->channels, u8Channel); 775 774 if(pChannel) 776 775 { 777 776 VBVA_CHANNELCONTEXTS * pContexts = (VBVA_CHANNELCONTEXTS *)pChannel->handler.pvHandler; 778 VBVADISP_CHANNELCONTEXT *pDispContext = vboxVBVAFindHandlerInfo(pContexts, pDevExt->iDevice);777 VBVADISP_CHANNELCONTEXT *pDispContext = vboxVBVAFindHandlerInfo(pContexts, iDevice); 779 778 Assert(pDispContext); 780 779 if(pDispContext) 781 780 { 782 781 UCHAR oldIrql; 783 VBoxVideoCmnSpinLockAcquire( PrimaryExtension, &pDispContext->pSynchLock, &oldIrql);782 VBoxVideoCmnSpinLockAcquire(commonToPrimaryExt(pCommon), &pDispContext->pSynchLock, &oldIrql); 784 783 785 784 DBG_CHECKLIST_LOCKED(pDispContext, NULL); … … 791 790 pDispContext->cCmds = 0; 792 791 #endif 793 VBoxVideoCmnSpinLockRelease( PrimaryExtension, &pDispContext->pSynchLock, oldIrql);794 795 DBG_CHECKLIST( PrimaryExtension, pDispContext, NULL);792 VBoxVideoCmnSpinLockRelease(commonToPrimaryExt(pCommon), &pDispContext->pSynchLock, oldIrql); 793 794 DBG_CHECKLIST(pCommon, pDispContext, NULL); 796 795 797 796 return VINF_SUCCESS; … … 857 856 { 858 857 VBVAHOSTCMDEVENT *pEventCmd = VBVAHOSTCMD_BODY(pCur, VBVAHOSTCMDEVENT); 859 VBoxVideoCmnSignalEvent( commonFromDeviceExt(pCallbacks->PrimaryExtension), pEventCmd->pEvent);858 VBoxVideoCmnSignalEvent(pCallbacks->pCommon, pEventCmd->pEvent); 860 859 } 861 860 default: 862 861 { 863 DBG_CHECKLIST(pCallbacks-> PrimaryExtension, pHandler, pCur);862 DBG_CHECKLIST(pCallbacks->pCommon, pHandler, pCur); 864 863 Assert(u16ChannelInfo==VBVAHG_EVENT); 865 864 Assert(!pCur->u.Data); … … 873 872 Assert(!pCur->u.pNext); 874 873 #endif 875 HGSMIHostCmdComplete( commonFromDeviceExt(pCallbacks->PrimaryExtension), pCur);874 HGSMIHostCmdComplete(pCallbacks->pCommon, pCur); 876 875 #if 0 /* pNext is NULL, and the other things have already been asserted */ 877 876 pCur = pNext; … … 887 886 } 888 887 889 DBG_CHECKLIST(pCallbacks-> PrimaryExtension, pHandler, pFirst);888 DBG_CHECKLIST(pCallbacks->pCommon, pHandler, pFirst); 890 889 891 890 /* we do not support lists currently */ … … 900 899 Assert(pLast); 901 900 UCHAR oldIrql; 902 VBoxVideoCmnSpinLockAcquire( pCallbacks->PrimaryExtension,901 VBoxVideoCmnSpinLockAcquire(commonToPrimaryExt(pCallbacks->pCommon), 903 902 &pHandler->pSynchLock, 904 903 &oldIrql); … … 922 921 DBG_CHECKLIST_LOCKED(pHandler, NULL); 923 922 924 VBoxVideoCmnSpinLockRelease( pCallbacks->PrimaryExtension,923 VBoxVideoCmnSpinLockRelease(commonToPrimaryExt(pCallbacks->pCommon), 925 924 &pHandler->pSynchLock, 926 925 oldIrql); … … 946 945 } 947 946 /* no handlers were found, need to complete the command here */ 948 HGSMIHostCmdComplete( commonFromDeviceExt(pCallbacks->PrimaryExtension), pvBuffer);947 HGSMIHostCmdComplete(pCallbacks->pCommon, pvBuffer); 949 948 return VINF_SUCCESS; 950 949 } … … 952 951 static HGSMICHANNELHANDLER g_OldHandler; 953 952 954 int vboxVBVAChannelDisplayEnable(P DEVICE_EXTENSION PrimaryExtension,953 int vboxVBVAChannelDisplayEnable(PVBOXVIDEO_COMMON pCommon, 955 954 int iDisplay, /* negative would mean this is a miniport handler */ 956 955 uint8_t u8Channel) 957 956 { 958 957 VBVA_CHANNELCONTEXTS * pContexts; 959 HGSMICHANNEL * pChannel = HGSMIChannelFindById (& commonFromDeviceExt(PrimaryExtension)->channels, u8Channel);958 HGSMICHANNEL * pChannel = HGSMIChannelFindById (&pCommon->channels, u8Channel); 960 959 if(!pChannel) 961 960 { 962 int rc = vboxVBVACreateChannelContexts( PrimaryExtension, &pContexts);961 int rc = vboxVBVACreateChannelContexts(pCommon, &pContexts); 963 962 if(RT_FAILURE(rc)) 964 963 { … … 989 988 #endif 990 989 991 VBoxVideoCmnSpinLockCreate( PrimaryExtension, &pDispContext->pSynchLock);990 VBoxVideoCmnSpinLockCreate(commonToPrimaryExt(pCommon), &pDispContext->pSynchLock); 992 991 993 992 int rc = VINF_SUCCESS; 994 993 if(!pChannel) 995 994 { 996 rc = HGSMIChannelRegister (& commonFromDeviceExt(PrimaryExtension)->channels,995 rc = HGSMIChannelRegister (&pCommon->channels, 997 996 u8Channel, 998 997 "VGA Miniport HGSMI channel", … … 1012 1011 if(!pChannel) 1013 1012 { 1014 vboxVBVADeleteChannelContexts( commonFromDeviceExt(PrimaryExtension), pContexts);1013 vboxVBVADeleteChannelContexts(pCommon, pContexts); 1015 1014 } 1016 1015
Note:
See TracChangeset
for help on using the changeset viewer.