Changeset 40483 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
- Timestamp:
- Mar 15, 2012 2:20:20 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
r40387 r40483 3645 3645 break; 3646 3646 } 3647 3647 3648 case VBOXESC_UHGSMI_DEALLOCATE: 3648 3649 { … … 3661 3662 break; 3662 3663 } 3664 3663 3665 case VBOXESC_GETVBOXVIDEOCMCMD: 3664 3666 { … … 3677 3679 break; 3678 3680 } 3681 3682 case VBOXESC_CRHGSMICTLCON_CALL: 3683 { 3684 PVBOXWDDM_CONTEXT pContext = (PVBOXWDDM_CONTEXT)pEscape->hContext; 3685 PVBOXDISPIFESCAPE_CRHGSMICTLCON_CALL pCall = (PVBOXDISPIFESCAPE_CRHGSMICTLCON_CALL)pEscapeHdr; 3686 if (pEscape->PrivateDriverDataSize >= sizeof (*pCall)) 3687 { 3688 /* this is true due to the above condition */ 3689 Assert(pEscape->PrivateDriverDataSize > RT_OFFSETOF(VBOXDISPIFESCAPE_CRHGSMICTLCON_CALL, CallInfo)); 3690 int rc = VBoxMpCrCtlConCallUserData(pDevExt, &pCall->CallInfo, pEscape->PrivateDriverDataSize - RT_OFFSETOF(VBOXDISPIFESCAPE_CRHGSMICTLCON_CALL, CallInfo)); 3691 if (RT_SUCCESS(rc)) 3692 Status = STATUS_SUCCESS; 3693 else 3694 { 3695 WARN(("VBoxMpCrUmCtlConCall failed, rc(%d)", rc)); 3696 Status = STATUS_UNSUCCESSFUL; 3697 } 3698 } 3699 else 3700 { 3701 WARN(("buffer too small!")); 3702 Status = STATUS_BUFFER_TOO_SMALL; 3703 } 3704 3705 break; 3706 } 3707 3708 case VBOXESC_CRHGSMICTLCON_GETCLIENTID: 3709 { 3710 PVBOXWDDM_CONTEXT pContext = (PVBOXWDDM_CONTEXT)pEscape->hContext; 3711 if (pEscape->PrivateDriverDataSize == sizeof (*pEscapeHdr)) 3712 { 3713 pEscapeHdr->u32CmdSpecific = pContext->u32CrConClientID; 3714 Status = STATUS_SUCCESS; 3715 } 3716 else 3717 { 3718 WARN(("unexpected buffer size!")); 3719 Status = STATUS_INVALID_PARAMETER; 3720 } 3721 3722 break; 3723 } 3724 3679 3725 case VBOXESC_SETVISIBLEREGION: 3680 3726 { … … 5615 5661 if (Status == STATUS_SUCCESS) 5616 5662 { 5617 // Assert(KeGetCurrentIrql() < DISPATCH_LEVEL); 5618 // ExAcquireFastMutex(&pDevExt->ContextMutex); 5619 ASMAtomicIncU32(&pDevExt->cContexts3D); 5620 // ExReleaseFastMutex(&pDevExt->ContextMutex); 5621 break; 5663 int rc = VINF_SUCCESS; 5664 if (pInfo->crVersionMajor || pInfo->crVersionMinor) 5665 { 5666 rc = VBoxMpCrCtlConConnect(pDevExt, 5667 pInfo->crVersionMajor, pInfo->crVersionMinor, 5668 &pContext->u32CrConClientID); 5669 if (!RT_SUCCESS(rc)) 5670 { 5671 WARN(("VBoxMpCrCtlConConnect failed rc (%d)", rc)); 5672 Status = STATUS_UNSUCCESSFUL; 5673 } 5674 } 5675 5676 if (RT_SUCCESS(rc)) 5677 { 5678 // Assert(KeGetCurrentIrql() < DISPATCH_LEVEL); 5679 // ExAcquireFastMutex(&pDevExt->ContextMutex); 5680 ASMAtomicIncU32(&pDevExt->cContexts3D); 5681 // ExReleaseFastMutex(&pDevExt->ContextMutex); 5682 break; 5683 } 5622 5684 } 5623 5685 5624 5686 vboxWddmSwapchainCtxTerm(pDevExt, pContext); 5625 5687 } 5688 vboxVideoAMgrCtxDestroy(&pContext->AllocContext); 5626 5689 } 5627 5690 break; … … 5630 5693 case VBOXWDDM_CONTEXT_TYPE_CUSTOM_UHGSMI_GL: 5631 5694 { 5695 pContext->enmType = pInfo->enmType; 5632 5696 Status = vboxVideoAMgrCtxCreate(&pDevExt->AllocMgr, &pContext->AllocContext); 5633 5697 Assert(Status == STATUS_SUCCESS); 5634 if (Status != STATUS_SUCCESS) 5635 break; 5636 /* do not break to go to the _2D branch and do the rest stuff */ 5698 if (Status == STATUS_SUCCESS) 5699 { 5700 int rc = VINF_SUCCESS; 5701 if (pInfo->crVersionMajor || pInfo->crVersionMinor) 5702 { 5703 rc = VBoxMpCrCtlConConnect(pDevExt, 5704 pInfo->crVersionMajor, pInfo->crVersionMinor, 5705 &pContext->u32CrConClientID); 5706 if (!RT_SUCCESS(rc)) 5707 { 5708 WARN(("VBoxMpCrCtlConConnect failed rc (%d)", rc)); 5709 Status = STATUS_UNSUCCESSFUL; 5710 } 5711 } 5712 5713 if (RT_SUCCESS(rc)) 5714 { 5715 break; 5716 } 5717 vboxVideoAMgrCtxDestroy(&pContext->AllocContext); 5718 } 5719 break; 5637 5720 } 5638 5721 case VBOXWDDM_CONTEXT_TYPE_CUSTOM_2D: … … 5684 5767 PVBOXWDDM_CONTEXT pContext = (PVBOXWDDM_CONTEXT)hContext; 5685 5768 PVBOXMP_DEVEXT pDevExt = pContext->pDevice->pAdapter; 5686 if (pContext->enmType == VBOXWDDM_CONTEXT_TYPE_CUSTOM_3D) 5687 { 5688 Assert(KeGetCurrentIrql() < DISPATCH_LEVEL); 5689 // ExAcquireFastMutex(&pDevExt->ContextMutex); 5690 // RemoveEntryList(&pContext->ListEntry); 5691 uint32_t cContexts = ASMAtomicDecU32(&pDevExt->cContexts3D); 5692 // ExReleaseFastMutex(&pDevExt->ContextMutex); 5693 Assert(cContexts < UINT32_MAX/2); 5769 switch(pContext->enmType) 5770 { 5771 case VBOXWDDM_CONTEXT_TYPE_CUSTOM_3D: 5772 { 5773 Assert(KeGetCurrentIrql() < DISPATCH_LEVEL); 5774 // ExAcquireFastMutex(&pDevExt->ContextMutex); 5775 // RemoveEntryList(&pContext->ListEntry); 5776 uint32_t cContexts = ASMAtomicDecU32(&pDevExt->cContexts3D); 5777 // ExReleaseFastMutex(&pDevExt->ContextMutex); 5778 Assert(cContexts < UINT32_MAX/2); 5779 /* don't break! */ 5780 } 5781 case VBOXWDDM_CONTEXT_TYPE_CUSTOM_UHGSMI_3D: 5782 case VBOXWDDM_CONTEXT_TYPE_CUSTOM_UHGSMI_GL: 5783 if (pContext->u32CrConClientID) 5784 { 5785 VBoxMpCrCtlConDisconnect(pDevExt, pContext->u32CrConClientID); 5786 } 5787 break; 5788 default: 5789 break; 5694 5790 } 5695 5791
Note:
See TracChangeset
for help on using the changeset viewer.