Changeset 20009 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Display/vbox.c
- Timestamp:
- May 25, 2009 6:36:52 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Display/vbox.c
r19844 r20009 692 692 # ifdef VBOX_WITH_VIDEOHWACCEL 693 693 694 VBOXVHWACMD* vboxVHWAC reateCommand(PPDEV ppdev, VBOXVHWACMD_LENGTH cbCmd)694 VBOXVHWACMD* vboxVHWACommandCreate (PPDEV ppdev, VBOXVHWACMD_LENGTH cbCmd) 695 695 { 696 696 VBOXVHWACMD* pHdr = (VBOXVHWACMD*)HGSMIHeapAlloc (&ppdev->hgsmiDisplayHeap, … … 700 700 if (!pHdr) 701 701 { 702 DISPDBG((0, "VBoxDISP::vboxVHWAC reateCommand: HGSMIHeapAlloc failed\n"));702 DISPDBG((0, "VBoxDISP::vboxVHWACommandCreate: HGSMIHeapAlloc failed\n")); 703 703 } 704 704 … … 706 706 } 707 707 708 void vboxVHWA FreeCommand(PPDEV ppdev, VBOXVHWACMD* pCmd)708 void vboxVHWACommandFree (PPDEV ppdev, VBOXVHWACMD* pCmd) 709 709 { 710 710 HGSMIHeapFree (&ppdev->hgsmiDisplayHeap, pCmd); 711 711 } 712 712 713 void vboxVHWASubmitCommand (PPDEV ppdev, VBOXVHWACMD* pCmd) 714 { 713 static void vboxVHWACommandCompletionCallbackEvent(PPDEV ppdev, VBOXVHWACMD * pCmd, void * pContext) 714 { 715 PEVENT pEvent = (PEVENT)pContext; 716 LONG oldState = EngSetEvent(pEvent); 717 Assert(!oldState); 718 } 719 720 BOOL vboxVHWACommandSubmit (PPDEV ppdev, VBOXVHWACMD* pCmd) 721 { 722 PEVENT pEvent; 723 BOOL brc = EngCreateEvent(&pEvent); 724 Assert(brc); 725 if(brc) 726 { 727 vboxVHWACommandSubmitAssynch (ppdev, pCmd, vboxVHWACommandCompletionCallbackEvent, pEvent); 728 729 brc = EngWaitForSingleObject(pEvent, 730 NULL /*IN PLARGE_INTEGER pTimeOut*/ 731 ); 732 Assert(brc); 733 if(brc) 734 { 735 EngDeleteEvent(pEvent); 736 } 737 } 738 return brc; 739 } 740 741 /* do not wait for completion */ 742 void vboxVHWACommandSubmitAssynch (PPDEV ppdev, VBOXVHWACMD* pCmd, PFNVBOXVHWACMDCOMPLETION pfnCompletion, void * pContext) 743 { 744 pCmd->GuestVBVAReserved1 = (uintptr_t)pfnCompletion; 745 pCmd->GuestVBVAReserved2 = (uintptr_t)pContext; 746 715 747 vboxHGSMIBufferSubmit (ppdev, pCmd); 716 if(pCmd->rc == VINF_VHWA_CMD_PENDING) 717 { 718 719 } 720 } 721 722 /* do not wait for completion */ 723 void vboxVHWASubmitCommandAssynch (PPDEV ppdev, VBOXVHWACMD* pCmd) 724 { 725 vboxHGSMIBufferSubmit (ppdev, pCmd); 748 749 if(pCmd->rc != VINF_VHWA_CMD_PENDING) 750 { 751 /* the command is completed */ 752 pfnCompletion(ppdev, pCmd, pContext); 753 } 754 726 755 } 727 756 728 757 static int vboxVHWAHanldeVHWACmdCompletion(PPDEV ppdev, void *pvBuffer, HGSMISIZE cbBuffer) 729 758 { 730 Assert(0); 731 759 VBOXVHWACMD* pCmd = (VBOXVHWACMD*)pvBuffer; 760 PFNVBOXVHWACMDCOMPLETION pfnCompletion = (PFNVBOXVHWACMDCOMPLETION)pCmd->GuestVBVAReserved1; 761 void * pContext = (void *)pCmd->GuestVBVAReserved2; 762 763 pfnCompletion(ppdev, pCmd, pContext); 764 return 0; 765 } 766 767 # endif 768 769 void vboxVBVAHostCommandComplete(PPDEV ppdev, void *pvBuffer) 770 { 732 771 ppdev->pfnHGSMICommandComplete(ppdev->hMpHGSMI, pvBuffer); 733 return 0; 734 } 735 736 # endif 737 738 DECLCALLBACK(int) vboxVHWACommandHanlder(void *pvHandler, uint16_t u16ChannelInfo, void *pvBuffer, HGSMISIZE cbBuffer) 772 } 773 774 DECLCALLBACK(int) vboxVBVAHostCommandHanlder(void *pvHandler, uint16_t u16ChannelInfo, void *pvBuffer, HGSMISIZE cbBuffer) 739 775 { 740 776 int rc = VINF_SUCCESS; … … 752 788 default: 753 789 { 754 ppdev->pfnHGSMICommandComplete(ppdev->hMpHGSMI, pvBuffer); 755 } 756 790 vboxVBVAHostCommandComplete(ppdev, pvBuffer); 791 } 757 792 } 758 793 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.