Changeset 22408 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Aug 24, 2009 10:59:45 AM (15 years ago)
- Location:
- trunk/src/VBox/Additions/WINNT/Graphics/Display
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Display/dd.c
r22247 r22408 701 701 } 702 702 } 703 vb oxVHWACommandFree(pDev, pCmd);703 vbvaVHWACommandRelease(pDev, pCmd); 704 704 } 705 705 return DDHAL_DRIVER_NOTHANDLED; … … 830 830 lpCanCreateSurface->ddRVal = DDERR_GENERIC; 831 831 } 832 vb oxVHWACommandFree(pDev, pCmd);832 vbvaVHWACommandRelease(pDev, pCmd); 833 833 } 834 834 else … … 1091 1091 /* wait for the surface to be locked and memory buffer updated */ 1092 1092 vboxVHWACommandSubmit(pDev, pCmd); 1093 vb oxVHWACommandFree(pDev, pCmd);1093 vbvaVHWACommandRelease(pDev, pCmd); 1094 1094 vboxVHWARegionClear(&pDesc->NonupdatedMemRegion); 1095 1095 lpLock->ddRVal = DD_OK; … … 2507 2507 ASMAtomicDecU32(&pDestDesc->cPendingBltsDst); 2508 2508 2509 vb oxVHWACommandFree(ppdev, pCmd);2509 vbvaVHWACommandRelease(ppdev, pCmd); 2510 2510 } 2511 2511 … … 2519 2519 ASMAtomicDecU32(&pTargDesc->cPendingFlipsTarg); 2520 2520 2521 vb oxVHWACommandFree(ppdev, pCmd);2521 vbvaVHWACommandRelease(ppdev, pCmd); 2522 2522 } 2523 2523 -
trunk/src/VBox/Additions/WINNT/Graphics/Display/driver.h
r22247 r22408 318 318 VBOXVHWACMD* vboxVHWACommandCreate (PPDEV ppdev, VBOXVHWACMD_TYPE enmCmd, VBOXVHWACMD_LENGTH cbCmd); 319 319 void vboxVHWACommandFree (PPDEV ppdev, VBOXVHWACMD* pCmd); 320 DECLINLINE(void) vbvaVHWACommandRelease (PPDEV ppdev, VBOXVHWACMD* pCmd) 321 { 322 uint32_t cRefs = ASMAtomicDecU32(&pCmd->cRefs); 323 Assert(cRefs < UINT32_MAX / 2); 324 if(!cRefs) 325 { 326 vboxVHWACommandFree(ppdev, pCmd); 327 } 328 } 329 330 DECLINLINE(void) vbvaVHWACommandRetain (PPDEV ppdev, VBOXVHWACMD* pCmd) 331 { 332 ASMAtomicIncU32(&pCmd->cRefs); 333 } 334 320 335 BOOL vboxVHWACommandSubmit (PPDEV ppdev, VBOXVHWACMD* pCmd); 321 336 void vboxVHWACommandSubmitAsynch (PPDEV ppdev, VBOXVHWACMD* pCmd, PFNVBOXVHWACMDCOMPLETION pfnCompletion, void * pContext); -
trunk/src/VBox/Additions/WINNT/Graphics/Display/vbox.c
r22274 r22408 710 710 pHdr->rc = VERR_GENERAL_FAILURE; 711 711 pHdr->enmCmd = enmCmd; 712 pHdr->cRefs = 1; 712 713 } 713 714 … … 784 785 pCmd->GuestVBVAReserved1 = (uintptr_t)pEvent; 785 786 pCmd->GuestVBVAReserved2 = 0; 787 /* ensure the command is not removed until we're processing it */ 788 vbvaVHWACommandRetain(ppdev, pCmd); 786 789 787 790 /* complete it asynchronously by setting event */ 788 791 pCmd->Flags |= VBOXVHWACMD_FLAG_GH_ASYNCH_EVENT; 789 792 vboxHGSMIBufferSubmit (ppdev, pCmd); 790 //TODO: dbg 791 #if 0 793 792 794 if(!(ASMAtomicReadU32((volatile uint32_t *)&pCmd->Flags) & VBOXVHWACMD_FLAG_HG_ASYNCH)) 793 795 { … … 795 797 EngSetEvent(pEvent); 796 798 } 797 #endif 799 800 vbvaVHWACommandRelease(ppdev, pCmd); 798 801 } 799 802 … … 827 830 pCmd->GuestVBVAReserved1 = (uintptr_t)pfnCompletion; 828 831 pCmd->GuestVBVAReserved2 = (uintptr_t)pContext; 832 vbvaVHWACommandRetain(ppdev, pCmd); 829 833 830 834 vboxHGSMIBufferSubmit (ppdev, pCmd); 831 //TODO: dbg 832 #if 0 835 833 836 if(!(pCmd->Flags & VBOXVHWACMD_FLAG_HG_ASYNCH)) 834 837 { … … 836 839 pfnCompletion(ppdev, pCmd, pContext); 837 840 } 838 #endif 841 842 vbvaVHWACommandRelease(ppdev, pCmd); 839 843 } 840 844 841 845 static DECLCALLBACK(void) vboxVHWAFreeCmdCompletion(PPDEV ppdev, VBOXVHWACMD * pCmd, void * pContext) 842 846 { 843 vb oxVHWACommandFree(ppdev, pCmd);847 vbvaVHWACommandRelease(ppdev, pCmd); 844 848 } 845 849 … … 849 853 pCmd->GuestVBVAReserved1 = (uintptr_t)vboxVHWAFreeCmdCompletion; 850 854 855 vbvaVHWACommandRetain(ppdev, pCmd); 856 851 857 pCmd->Flags |= VBOXVHWACMD_FLAG_GH_ASYNCH_NOCOMPLETION; 852 858 853 859 vboxHGSMIBufferSubmit (ppdev, pCmd); 854 //TODO: dbg 855 #if 0 860 856 861 if(!(pCmd->Flags & VBOXVHWACMD_FLAG_HG_ASYNCH) 857 862 || pCmd->Flags & VBOXVHWACMD_FLAG_HG_ASYNCH_RETURNED) … … 860 865 vboxVHWAFreeCmdCompletion(ppdev, pCmd, NULL); 861 866 } 862 #endif 867 868 vbvaVHWACommandRelease(ppdev, pCmd); 863 869 } 864 870 … … 866 872 { 867 873 VBOXVHWACMD* pCmd = VBOXVHWACMD_HEAD(pInfo); 868 vb oxVHWACommandFree (ppdev, pCmd);874 vbvaVHWACommandRelease (ppdev, pCmd); 869 875 } 870 876 … … 872 878 { 873 879 VBOXVHWACMD* pCmd = VBOXVHWACMD_HEAD(pInfo); 874 vb oxVHWACommandFree (ppdev, pCmd);880 vbvaVHWACommandRelease (ppdev, pCmd); 875 881 } 876 882 … … 905 911 } 906 912 907 vb oxVHWACommandFree (ppdev, pCmd);913 vbvaVHWACommandRelease (ppdev, pCmd); 908 914 return NULL; 909 915 } … … 933 939 } 934 940 935 vb oxVHWACommandFree (ppdev, pCmd);941 vbvaVHWACommandRelease (ppdev, pCmd); 936 942 return NULL; 937 943 } … … 1000 1006 } 1001 1007 1002 vb oxVHWACommandFree (ppdev, pCmd);1008 vbvaVHWACommandRelease (ppdev, pCmd); 1003 1009 return rc; 1004 1010 } … … 1022 1028 } 1023 1029 1024 vb oxVHWACommandFree (ppdev, pCmd);1030 vbvaVHWACommandRelease (ppdev, pCmd); 1025 1031 1026 1032 vboxVHWACommandCheckHostCmds(ppdev);
Note:
See TracChangeset
for help on using the changeset viewer.